Files
arthur-os/bin/omarchy-launch-screensaver

60 lines
1.6 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
;;
*foot*)
hyprctl dispatch exec -- \
foot --app-id=org.omarchy.screensaver \
--config="$OMARCHY_PATH/default/foot/screensaver.ini" \
-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, Foot, Ghostty, or Kitty"
;;
esac
done
hyprctl dispatch focusmonitor $focused