- binding super + del to suspend command

- added suspend.sh
- corrected $TERMINAL assignement in startup.sh
This commit is contained in:
2026-02-14 11:52:58 +01:00
parent a7339279a1
commit 1b565a9a82
3 changed files with 31 additions and 6 deletions

View File

@@ -6,7 +6,6 @@
# See https://wiki.hyprland.org/Configuring/Monitors/ # See https://wiki.hyprland.org/Configuring/Monitors/
monitor=eDP-1,1920x1080@120, 0x0, 1 monitor=eDP-1,1920x1080@120, 0x0, 1
monitor=HDMI-A-1,2560x1440@74.78, 1920x0, 1 monitor=HDMI-A-1,2560x1440@74.78, 1920x0, 1
#monitor=DP-1,2560x1440@60,1920x0, 1
# See https://wiki.hyprland.org/Configuring/Keywords/ for more # See https://wiki.hyprland.org/Configuring/Keywords/ for more
@@ -164,19 +163,17 @@ bind = $mainMod SHIFT, Q, exec, alacritty
bind = $mainMod, C, killactive, bind = $mainMod, C, killactive,
bind = $mainMod, W, killactive, bind = $mainMod, W, killactive,
bind = $mainMod, M, exit, bind = $mainMod, M, exit,
bind = $mainMod, E, exec, nautilus #nemo bind = $mainMod, E, exec, nemo
bind = $mainMod, Y, exec, copyq toggle bind = $mainMod, Y, exec, copyq toggle
bind = $mainMod, A, exec, swaync-client -t -sw bind = $mainMod, A, exec, swaync-client -t -sw
bind = $mainMod, V, togglefloating, bind = $mainMod, V, togglefloating,
bind = $mainMod, space, exec, fuzzel bind = $mainMod, space, exec, fuzzel
#bind = $mainMod, space, exec, wofi --show drun
bind = $mainMod, D, exec, wayscriber --active bind = $mainMod, D, exec, wayscriber --active
bind = $mainMod, P, pseudo, # dwindle bind = $mainMod, P, pseudo, # dwindle
bind = $mainMod, J, togglesplit, # dwindle bind = $mainMod, J, togglesplit, # dwindle
#bind = $mainMod, L, exec, swaylock --screenshots --effect-blur 7x5 --clock
bind = $mainMod, L, exec, hyprlock bind = $mainMod, L, exec, hyprlock
bind = $mainMod, F, fullscreen, bind = $mainMod, F, fullscreen,
bind = $mainMod, Delete, exec, ~/bin/suspend.sh
#laptop screen brightness #laptop screen brightness
bind = $mainMod ALT, 1, exec, sudo brightnessctl s 10% bind = $mainMod ALT, 1, exec, sudo brightnessctl s 10%

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
export $TERMINAL=weztzerm export TERMINAL=weztzerm
source /home/thierry/keepass.env source /home/thierry/keepass.env
source /home/thierry/bin/alias source /home/thierry/bin/alias

28
bin/suspend.sh Executable file
View File

@@ -0,0 +1,28 @@
#!/usr/bin/env bash
set -euo pipefail
pgrep -x hyprlock >/dev/null || hyprlock &
systemctl suspend-then-hibernate
sleep 2
INTERNAL="eDP-1"
external_on_count=$(
hyprctl -j monitors | jq -r --arg internal "$INTERNAL" '
[ .[]
| select(.name != $internal)
| select(.disabled != true)
| select(.dpmsStatus == true)
] | length
'
)
if [ "$external_on_count" -eq 0 ]; then
# no external screen, we enable internal screen
hyprctl keyword monitor "$INTERNAL, 1920x1080@120, 0x0, 1"
else
# external monitor active, we turn off internal screen
hyprctl keyword monitor "$INTERNAL, disable"
fi