Start screensaver automatically (#453)

* No need to kill any more since any key will quit

* Command to refresh hypridle

* Start screensaver automatically after a minute

* Add migration
This commit is contained in:
David Heinemeier Hansson
2025-08-02 14:14:03 +02:00
committed by GitHub
parent 4db468a450
commit 6ecc09abdb
4 changed files with 17 additions and 1 deletions

View File

@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
pkill -f "alacritty --class Screensaver" || pgrep -f "alacritty --class Screensaver" ||
alacritty --class Screensaver --title Screensaver -o 'colors.primary.background="#000000"' \ alacritty --class Screensaver --title Screensaver -o 'colors.primary.background="#000000"' \
-o 'colors.cursor.cursor="#000000"' -e ~/.local/share/omarchy/bin/omarchy-cmd-screensaver -o 'colors.cursor.cursor="#000000"' -e ~/.local/share/omarchy/bin/omarchy-cmd-screensaver

6
bin/omarchy-refresh-hypridle Executable file
View File

@ -0,0 +1,6 @@
#!/bin/bash
omarchy-refresh-config hypr/hypridle.conf
pkill -x hypridle
uwsm app -- hypridle >/dev/null 2>&1 &

View File

@ -5,6 +5,11 @@ general {
on_unlock_cmd = omarchy-restart-waybar # prevent stacking of waybar when waking on_unlock_cmd = omarchy-restart-waybar # prevent stacking of waybar when waking
} }
listener {
timeout = 60 # 1min
on-timeout = omarchy-launch-screensaver # start screensaver
}
listener { listener {
timeout = 300 # 5min timeout = 300 # 5min
on-timeout = loginctl lock-session # lock screen when timeout has passed on-timeout = loginctl lock-session # lock screen when timeout has passed

5
migrations/1754136581.sh Normal file
View File

@ -0,0 +1,5 @@
echo "Start screensaver automatically after 1 minute"
if ! grep -q "omarchy-launch-screensaver" ~/.config/hypr/hypridle.conf; then
omarchy-refresh-hypridle
fi