diff --git a/etc/skel/.config/river/init b/etc/skel/.config/river/init index a07c5f1..1594ee7 100755 --- a/etc/skel/.config/river/init +++ b/etc/skel/.config/river/init @@ -62,9 +62,6 @@ nwg-drawer -r & disown # Screenshot notification riverctl spawn /usr/share/river/scripts/screenshot-notify.sh & disown -# Lock screen daemon -riverctl spawn $HOME/.config/river/screenlock.sh - # Set background and border color riverctl background-color 0x002b36 riverctl border-color-focused 0x8aadf4 diff --git a/etc/skel/.config/river/screenlock.sh b/etc/skel/.config/river/screenlock.sh deleted file mode 100755 index 6de6516..0000000 --- a/etc/skel/.config/river/screenlock.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -lock="~/.config/swaylock/lock.sh" - -pkill swayidle -sleep 1s - -exec swayidle -w \ - timeout 240 'light -G > /tmp/brightness && light -S 10' resume 'light -S $([ -f /tmp/brightness ] && cat /tmp/brightness || echo 100%)' \ - timeout 300 $lock \ - before-sleep 'playerctl pause' \ - before-sleep $lock \ - lock $lock & disown diff --git a/etc/skel/.config/swayidle/config b/etc/skel/.config/swayidle/config new file mode 100644 index 0000000..36c92e1 --- /dev/null +++ b/etc/skel/.config/swayidle/config @@ -0,0 +1,6 @@ +timeout 240 'light -G > /tmp/brightness && light -S 10' resume 'light -S $([ -f /tmp/brightness ] && cat /tmp/brightness || echo 100%)' +timeout 300 ~/.config/swaylock/lock.sh +timeout 600 'swaymsg "output * power off"' resume 'swaymsg "output * power on"' +before-sleep 'playerctl pause' +before-sleep ~/.config/swaylock/lock.sh +lock ~/.config/swaylock/lock.sh diff --git a/usr/lib/systemd/user/swayidle.service b/usr/lib/systemd/user/swayidle.service new file mode 100644 index 0000000..d5fa25f --- /dev/null +++ b/usr/lib/systemd/user/swayidle.service @@ -0,0 +1,12 @@ +[Unit] +Description=Idle manager for Wayland +Documentation=man:swayidle(1) +PartOf=graphical-session.target +ConditionPathExists=/usr/bin/swayidle + +[Service] +Type=simple +ExecStart=/usr/bin/swayidle + +[Install] +WantedBy=sway-session.target