Some users may choose to disable notification timeout for normal-level notifications to ensure no notifications are missed when the user is away from the screen. However, there are several Omarchy notifications that only serve as an immediate feedback for a user action, such as "Screensaver enabled" or "Editing config file foo.conf", for which disabling the timeout is not desirable. This commit drops the urgency level for such notification to low, allowing configuring a different timeout value for them. Notifications with an explicitly set timeout are excluded from this commit.
55 lines
1.5 KiB
Bash
Executable File
55 lines
1.5 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# Launch the Omarchy screensaver in the default terminal on the system with the correct font configuration.
|
|
|
|
# Exit early if we don't have the tte show
|
|
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 [[ -f ~/.local/state/omarchy/toggles/screensaver-off ]] && [[ $1 != "force" ]]; then
|
|
exit 1
|
|
fi
|
|
|
|
# Silently quit Walker on overlay
|
|
walker -q
|
|
|
|
focused=$(hyprctl monitors -j | jq -r '.[] | select(.focused == true).name')
|
|
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-cmd-screensaver
|
|
;;
|
|
*ghostty*)
|
|
hyprctl dispatch exec -- \
|
|
ghostty --class=org.omarchy.screensaver \
|
|
--config-file=~/.local/share/omarchy/default/ghostty/screensaver \
|
|
--font-size=18 \
|
|
-e omarchy-cmd-screensaver
|
|
;;
|
|
*kitty*)
|
|
hyprctl dispatch exec -- \
|
|
kitty --class=org.omarchy.screensaver \
|
|
--override font_size=18 \
|
|
--override window_padding_width=0 \
|
|
-e omarchy-cmd-screensaver
|
|
;;
|
|
*)
|
|
notify-send -u low "✋ Screensaver only runs in Alacritty, Ghostty, or Kitty"
|
|
;;
|
|
esac
|
|
done
|
|
|
|
hyprctl dispatch focusmonitor $focused
|