From 6ecc09abdbe58506b740c8b8df6dd00d1370cddb Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sat, 2 Aug 2025 14:14:03 +0200 Subject: [PATCH] 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 --- bin/omarchy-launch-screensaver | 2 +- bin/omarchy-refresh-hypridle | 6 ++++++ config/hypr/hypridle.conf | 5 +++++ migrations/1754136581.sh | 5 +++++ 4 files changed, 17 insertions(+), 1 deletion(-) create mode 100755 bin/omarchy-refresh-hypridle create mode 100644 migrations/1754136581.sh diff --git a/bin/omarchy-launch-screensaver b/bin/omarchy-launch-screensaver index a5736c3..4617044 100755 --- a/bin/omarchy-launch-screensaver +++ b/bin/omarchy-launch-screensaver @@ -1,5 +1,5 @@ #!/bin/bash -pkill -f "alacritty --class Screensaver" || +pgrep -f "alacritty --class Screensaver" || alacritty --class Screensaver --title Screensaver -o 'colors.primary.background="#000000"' \ -o 'colors.cursor.cursor="#000000"' -e ~/.local/share/omarchy/bin/omarchy-cmd-screensaver diff --git a/bin/omarchy-refresh-hypridle b/bin/omarchy-refresh-hypridle new file mode 100755 index 0000000..0e1600c --- /dev/null +++ b/bin/omarchy-refresh-hypridle @@ -0,0 +1,6 @@ +#!/bin/bash + +omarchy-refresh-config hypr/hypridle.conf +pkill -x hypridle +uwsm app -- hypridle >/dev/null 2>&1 & + diff --git a/config/hypr/hypridle.conf b/config/hypr/hypridle.conf index a7eaaf1..5a1e016 100644 --- a/config/hypr/hypridle.conf +++ b/config/hypr/hypridle.conf @@ -5,6 +5,11 @@ general { on_unlock_cmd = omarchy-restart-waybar # prevent stacking of waybar when waking } +listener { + timeout = 60 # 1min + on-timeout = omarchy-launch-screensaver # start screensaver +} + listener { timeout = 300 # 5min on-timeout = loginctl lock-session # lock screen when timeout has passed diff --git a/migrations/1754136581.sh b/migrations/1754136581.sh new file mode 100644 index 0000000..2f59425 --- /dev/null +++ b/migrations/1754136581.sh @@ -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