From f386c25a224e2c26e652f5a3f49268b6db2e1472 Mon Sep 17 00:00:00 2001 From: Alan Orth Date: Thu, 31 Oct 2024 09:39:00 +0300 Subject: [PATCH] dotfiles: minor updates for Sway v1.10 --- dotfiles/config/sway/config | 22 ++++++++++++------- dotfiles/config/systemd/user/swayidle.service | 4 ++-- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/dotfiles/config/sway/config b/dotfiles/config/sway/config index 941cb68..03af196 100644 --- a/dotfiles/config/sway/config +++ b/dotfiles/config/sway/config @@ -70,7 +70,7 @@ set $WOBSOCK $XDG_RUNTIME_DIR/wob.sock # # exec swayidle -w \ # timeout 300 'swaylock -f -c 000000' \ -# timeout 600 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' \ +# timeout 600 'swaymsg "output * power off"' resume 'swaymsg "output * power on"' \ # before-sleep 'swaylock -f -c 000000' # # This will lock your screen after 300 seconds of inactivity, then turn off @@ -130,13 +130,6 @@ input type:keyboard { # Exit sway (logs you out of your Wayland session) bindsym $mod+Shift+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit' - bindsym XF86AudioRaiseVolume exec pamixer -ui 5 && pamixer --get-volume > $WOBSOCK - bindsym XF86AudioLowerVolume exec pamixer -ud 5 && pamixer --get-volume > $WOBSOCK - bindsym XF86AudioMute exec pamixer --toggle-mute && ( pamixer --get-mute && echo 0 > $WOBSOCK ) || pamixer --get-volume > $WOBSOCK - bindsym XF86AudioMicMute exec pactl set-source-mute @DEFAULT_SOURCE@ toggle - bindsym XF86MonBrightnessUp exec light -S "$(light -G | awk '{ print int(($1 + .72) * 1.4) }')" && light -G | cut -d'.' -f1 > $WOBSOCK - bindsym XF86MonBrightnessDown exec light -S "$(light -G | awk '{ print int($1 / 1.4) }')" && light -G | cut -d'.' -f1 > $WOBSOCK - # # Moving around: # @@ -259,6 +252,19 @@ mode "resize" { bindsym Escape mode "default" } bindsym $mod+r mode "resize" +# +# Utilities: +# + # Special keys to adjust volume via PulseAudio + bindsym --locked XF86AudioMute exec pamixer --toggle-mute && ( pamixer --get-mute && echo 0 > $WOBSOCK ) || pamixer --get-volume > $WOBSOCK + bindsym --locked XF86AudioLowerVolume exec pamixer -ud 5 && pamixer --get-volume > $WOBSOCK + bindsym --locked XF86AudioRaiseVolume exec pamixer -ui 5 && pamixer --get-volume > $WOBSOCK + bindsym --locked XF86AudioMicMute exec pactl set-source-mute @DEFAULT_SOURCE@ toggle + # Special keys to adjust brightness via brightnessctl + bindsym --locked XF86MonBrightnessUp exec light -S "$(light -G | awk '{ print int(($1 + .72) * 1.4) }')" && light -G | cut -d'.' -f1 > $WOBSOCK + bindsym --locked XF86MonBrightnessDown exec light -S "$(light -G | awk '{ print int($1 / 1.4) }')" && light -G | cut -d'.' -f1 > $WOBSOCK + + # # Status Bar: diff --git a/dotfiles/config/systemd/user/swayidle.service b/dotfiles/config/systemd/user/swayidle.service index 42a53ba..7224224 100644 --- a/dotfiles/config/systemd/user/swayidle.service +++ b/dotfiles/config/systemd/user/swayidle.service @@ -8,8 +8,8 @@ Type=simple ExecStart=/usr/bin/swayidle -w \ timeout 300 'swaylock -f -c 000000 \ -i /home/aorth/Downloads/3121px-Jerusalem-2013-Temple_Mount-Dome_of_the_Rock-Detail_01.jpg' \ - timeout 600 'swaymsg "output * dpms off"' \ - resume 'swaymsg "output * dpms on"' \ + timeout 600 'swaymsg "output * power off"' \ + resume 'swaymsg "output * power on"' \ before-sleep 'swaylock -f -c 000000 \ -i /home/aorth/Downloads/3121px-Jerusalem-2013-Temple_Mount-Dome_of_the_Rock-Detail_01.jpg'