From 1b565a9a82bc14f1670bd8090f159fb0e1e566f3 Mon Sep 17 00:00:00 2001 From: Thierry Schork Date: Sat, 14 Feb 2026 11:52:58 +0100 Subject: [PATCH] - binding super + del to suspend command - added suspend.sh - corrected $TERMINAL assignement in startup.sh --- .config/hypr/hyprland.conf | 7 ++----- bin/startup.sh | 2 +- bin/suspend.sh | 28 ++++++++++++++++++++++++++++ 3 files changed, 31 insertions(+), 6 deletions(-) create mode 100755 bin/suspend.sh diff --git a/.config/hypr/hyprland.conf b/.config/hypr/hyprland.conf index 3a69990..f9e26b5 100755 --- a/.config/hypr/hyprland.conf +++ b/.config/hypr/hyprland.conf @@ -6,7 +6,6 @@ # See https://wiki.hyprland.org/Configuring/Monitors/ monitor=eDP-1,1920x1080@120, 0x0, 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 @@ -164,19 +163,17 @@ bind = $mainMod SHIFT, Q, exec, alacritty bind = $mainMod, C, killactive, bind = $mainMod, W, killactive, bind = $mainMod, M, exit, -bind = $mainMod, E, exec, nautilus #nemo +bind = $mainMod, E, exec, nemo bind = $mainMod, Y, exec, copyq toggle bind = $mainMod, A, exec, swaync-client -t -sw bind = $mainMod, V, togglefloating, bind = $mainMod, space, exec, fuzzel -#bind = $mainMod, space, exec, wofi --show drun bind = $mainMod, D, exec, wayscriber --active bind = $mainMod, P, pseudo, # dwindle bind = $mainMod, J, togglesplit, # dwindle -#bind = $mainMod, L, exec, swaylock --screenshots --effect-blur 7x5 --clock bind = $mainMod, L, exec, hyprlock bind = $mainMod, F, fullscreen, - +bind = $mainMod, Delete, exec, ~/bin/suspend.sh #laptop screen brightness bind = $mainMod ALT, 1, exec, sudo brightnessctl s 10% diff --git a/bin/startup.sh b/bin/startup.sh index b400d49..dd6dc36 100755 --- a/bin/startup.sh +++ b/bin/startup.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -export $TERMINAL=weztzerm +export TERMINAL=weztzerm source /home/thierry/keepass.env source /home/thierry/bin/alias diff --git a/bin/suspend.sh b/bin/suspend.sh new file mode 100755 index 0000000..807328d --- /dev/null +++ b/bin/suspend.sh @@ -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 +