mirror of
https://github.com/basecamp/omarchy.git
synced 2026-02-17 15:25:37 +00:00
Bugfix screensaver not exiting (#1687)
* exit if screensaver not in focus * Extract explaining function * Consistent function style --------- Co-authored-by: David Heinemeier Hansson <david@hey.com>
This commit is contained in:
@@ -1,6 +1,10 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
function exit_screensaver {
|
screensaver_in_focus() {
|
||||||
|
hyprctl activewindow -j | jq -e '.class == "Screensaver"' >/dev/null 2>&1
|
||||||
|
}
|
||||||
|
|
||||||
|
exit_screensaver() {
|
||||||
hyprctl keyword cursor:invisible false
|
hyprctl keyword cursor:invisible false
|
||||||
pkill -x tte 2>/dev/null
|
pkill -x tte 2>/dev/null
|
||||||
pkill -f "alacritty --class Screensaver" 2>/dev/null
|
pkill -f "alacritty --class Screensaver" 2>/dev/null
|
||||||
@@ -18,7 +22,7 @@ while true; do
|
|||||||
"$effect" &
|
"$effect" &
|
||||||
|
|
||||||
while pgrep -x tte >/dev/null; do
|
while pgrep -x tte >/dev/null; do
|
||||||
if read -n 1 -t 3; then
|
if read -n 1 -t 3 || ! screensaver_in_focus; then
|
||||||
exit_screensaver
|
exit_screensaver
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|||||||
Reference in New Issue
Block a user