From 5ef73f12a3c5d4f533464b3751a3bf44039e175c Mon Sep 17 00:00:00 2001 From: Henrik Bakken Date: Thu, 15 May 2025 21:41:12 +0200 Subject: [PATCH] sway use systemctl for services --- sway/config | 22 +++++++++------------- sway/idle.yaml | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 13 deletions(-) create mode 100644 sway/idle.yaml diff --git a/sway/config b/sway/config index a2680ef..6361564 100644 --- a/sway/config +++ b/sway/config @@ -99,23 +99,19 @@ exec_always { } exec { pamac-tray-plasma - blueman-applet wlsunset -l 59.91:10.76 - swayidle -w \ - timeout 1200 'swaymsg exec "/usr/share/sway/scripts/keyboard-backlight-switch.sh off"' resume 'swaymsg exec "/usr/share/sway/scripts/keyboard-backlight-switch.sh on"' \ - timeout 1200 'swaymsg exec "$locking"' \ - timeout 1200 'swaymsg "output * power off"' resume 'swaymsg "output * power on"' \ - timeout 1200 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' \ - before-sleep 'swaymsg exec "$locking"' \ - after-resume 'swaymsg "output * dpms on"' \ - idlehint '240' - idlehack + systemctl --user enable --now blueman-applet + # idle lock + systemctl --user enable --now swayidle + systemctl --user enable --now idlehack # focus switch animations - flashfocus + systemctl --user enable --now flashfocus # usb automount - pcmanfm -d + systemctl --user enable --now pcmanfm # workspace icons - sworkstyle -d -l error + systemctl --user enable --now sworkstyle + # foot server + systemctl --user enable --now foot-server # swappy notify $script_path/screenshot-notify.sh } diff --git a/sway/idle.yaml b/sway/idle.yaml new file mode 100644 index 0000000..e0ca9b5 --- /dev/null +++ b/sway/idle.yaml @@ -0,0 +1,33 @@ +--- +debug: true +wait: false +timeouts: + # idle_timeout + - timeout: 240 + command: brightnessctl -s && brightnessctl set 10 + resume: brightnessctl -r + # locking_timeout + - timeout: 1200 + command: swaymsg exec \$locking + # keyboard_timeout + - timeout: 1200 + command: /usr/share/sway/scripts/keyboard-backlight-switch.sh off + resume: /usr/share/sway/scripts/keyboard-backlight-switch.sh on + # screen_timeout + - timeout: 2400 + command: swaymsg "output * power off" + resume: swaymsg "output * power on" + # dpms_timeout + - timeout: 2400 + command: swaymsg "output * dpms off" + resume: swaymsg "output * dpms on" + # sleep_timeout_bat + # - timeout: 900 + # command: acpi --ac-adapter | grep -v 'on-line' && systemctl sleep + # sleep_timeout_ac + # - timeout: 3600 + # command: acpi --ac-adapter | grep 'on-line' && systemctl sleep +before-sleep: swaymsg exec \$locking +after-resume: swaymsg "output * dpms on" +lock: swaymsg exec \$locking +idlehint: '240'