From 3266a188976b85ab65761cd819696c397bcd4574 Mon Sep 17 00:00:00 2001 From: Alexandre Perreault Date: Fri, 29 Aug 2025 15:38:46 -0400 Subject: [PATCH] fix screensaver exit behavior on multiple monitors (#1249) --- bin/omarchy-cmd-screensaver | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/bin/omarchy-cmd-screensaver b/bin/omarchy-cmd-screensaver index eb32060..21eaa0a 100755 --- a/bin/omarchy-cmd-screensaver +++ b/bin/omarchy-cmd-screensaver @@ -1,4 +1,11 @@ #!/bin/bash +function exit_screensaver { + pkill -x tte 2>/dev/null + pkill -f "alacritty --class Screensaver" 2>/dev/null + exit 0 +} + +trap exit_screensaver SIGINT SIGTERM SIGHUP SIGQUIT while true; do effect=$(tte 2>&1 | grep -oP '{\K[^}]+' | tr ',' ' ' | tr ' ' '\n' | sed -n '/^beams$/,$p' | sort -u | shuf -n1) @@ -8,9 +15,7 @@ while true; do while pgrep -x tte >/dev/null; do if read -n 1 -t 0.01; then - pkill -x tte 2>/dev/null - pkill -f "alacritty --class Screensaver" 2>/dev/null - exit 0 + exit_screensaver fi done done