From b5bb61b4318c3175afd5eb6d006de2d8722cf5c9 Mon Sep 17 00:00:00 2001 From: oxypomme Date: Tue, 22 Jul 2025 08:30:15 +0200 Subject: [PATCH] fix: fixed lid config --- .config/kanshi/config | 2 +- .config/kanshi/lid.sh | 16 ++++++++++++---- .config/sway/config | 4 ++++ .config/sway/config.d/50-rules-mails.conf | 2 +- .config/sway/config.d/50-rules-portal.conf | 3 +++ .config/sway/config.d/50-rules-zoom.conf | 11 +++++++++++ 6 files changed, 32 insertions(+), 6 deletions(-) create mode 100644 .config/sway/config.d/50-rules-portal.conf create mode 100644 .config/sway/config.d/50-rules-zoom.conf diff --git a/.config/kanshi/config b/.config/kanshi/config index d28b180..3fdcb2f 100644 --- a/.config/kanshi/config +++ b/.config/kanshi/config @@ -48,7 +48,7 @@ profile Nomad { output $INTERNAL enable exec ~/.config/kanshi/lid.sh - exec tuned-adm profile balanced + exec tuned-adm profile balanced-battery } profile Home { diff --git a/.config/kanshi/lid.sh b/.config/kanshi/lid.sh index 994d67d..9e0362d 100755 --- a/.config/kanshi/lid.sh +++ b/.config/kanshi/lid.sh @@ -3,10 +3,18 @@ LAPTOP_OUTPUT="eDP-1" LID_STATE_FILE="/proc/acpi/button/lid/LID0/state" +# Resume previous state read -r LS < "$LID_STATE_FILE" - case "$LS" in -*open) swaymsg output "$LAPTOP_OUTPUT" enable ;; -*closed) swaymsg output "$LAPTOP_OUTPUT" disable ;; -*) echo "Could not get lid state" >&2 ; exit 1 ;; + *open) + swaymsg output "$LAPTOP_OUTPUT" enable + ;; + *closed) + swaymsg output "$LAPTOP_OUTPUT" disable + systemctl suspend + ;; + *) + echo "Could not get lid state" >&2 + exit 1 + ;; esac diff --git a/.config/sway/config b/.config/sway/config index f15fcb4..f8ac8f5 100644 --- a/.config/sway/config +++ b/.config/sway/config @@ -49,6 +49,10 @@ output * bg ~/Images/Perso/Wallpapers/wave.jpg fill # -> Managed by Kanshi (~/.config/kanshi/config) +# Watch lid changes +bindswitch --reload --locked lid:on output eDP-1 disable +bindswitch --reload --locked lid:off output eDP-1 enable + ### Idle configuration # -> Managed by swayidle (/usr/share/sway/config.d/90-swayidle.conf) diff --git a/.config/sway/config.d/50-rules-mails.conf b/.config/sway/config.d/50-rules-mails.conf index e4385ab..4461131 100644 --- a/.config/sway/config.d/50-rules-mails.conf +++ b/.config/sway/config.d/50-rules-mails.conf @@ -1,5 +1,5 @@ # thunderbird reminders for_window [app_id="org.mozilla.Thunderbird" title="[0-9]+ rappels?"] { floating enable - resize width 960 px height 540 px + resize set 960 540 } diff --git a/.config/sway/config.d/50-rules-portal.conf b/.config/sway/config.d/50-rules-portal.conf new file mode 100644 index 0000000..5205e54 --- /dev/null +++ b/.config/sway/config.d/50-rules-portal.conf @@ -0,0 +1,3 @@ +for_window [app_id="xdg-desktop-portal-gtk" title="Open (File|Folder)"] { + floating enable +} diff --git a/.config/sway/config.d/50-rules-zoom.conf b/.config/sway/config.d/50-rules-zoom.conf new file mode 100644 index 0000000..8a7dbb4 --- /dev/null +++ b/.config/sway/config.d/50-rules-zoom.conf @@ -0,0 +1,11 @@ +for_window [app_id="Zoom Workplace"] { + floating enable +} + +for_window [app_id="Zoom Workplace" title="Zoom Workplace - Free Account"] { + floating disable +} + +for_window [app_id="Zoom Workplace" title="Meeting"] { + floating disable +}