Files
arthur-os/bin/omarchy-launch-screensaver
T
David Heinemeier Hansson bc512b437f Merge remote-tracking branch 'origin/dev' into omarchy-cli
# Conflicts:
#	bin/omarchy-hyprland-monitor-watch
#	bin/omarchy-plymouth-reset
#	bin/omarchy-sudo-passwordless
2026-05-01 17:07:09 +02:00

54 lines
1.4 KiB
Bash
Executable File

#!/bin/bash
# omarchy:summary=Launch the Omarchy screensaver in the default terminal on the system with the correct font configuration.
if ! command -v tte &>/dev/null; then
exit 1
fi
# Exit early if screensave is already running
pgrep -f org.omarchy.screensaver && exit 0
# Allow screensaver to be turned off but also force started
if omarchy-toggle-enabled screensaver-off && [[ $1 != "force" ]]; then
exit 1
fi
# Silently quit Walker on overlay
walker -q
focused=$(omarchy-hyprland-monitor-focused)
terminal=$(xdg-terminal-exec --print-id)
for m in $(hyprctl monitors -j | jq -r '.[] | .name'); do
hyprctl dispatch focusmonitor $m
case $terminal in
*Alacritty*)
hyprctl dispatch exec -- \
alacritty --class=org.omarchy.screensaver \
--config-file ~/.local/share/omarchy/default/alacritty/screensaver.toml \
-e omarchy-screensaver
;;
*ghostty*)
hyprctl dispatch exec -- \
ghostty --class=org.omarchy.screensaver \
--config-file=~/.local/share/omarchy/default/ghostty/screensaver \
--font-size=18 \
-e omarchy-screensaver
;;
*kitty*)
hyprctl dispatch exec -- \
kitty --class=org.omarchy.screensaver \
--override font_size=18 \
--override window_padding_width=0 \
-e omarchy-screensaver
;;
*)
notify-send -u low "✋ Screensaver only runs in Alacritty, Ghostty, or Kitty"
;;
esac
done
hyprctl dispatch focusmonitor $focused