Files
omarchy/bin/omarchy-cmd-screensaver
Ofir Miller 7e1c88b932 update to use $TERMINAL instead of alacitty (#1648)
* update to use $TERMINAL instead of alacitty

* revert

* move env to hyprconfig

* Only set if we have alacritty

* Add launcher for wifi settings so it can be used in mako config

* Set system terminal in config/uwsm/env to ensure its available everywhere

* Ensure that $TERMINAL is available after update

* Didn't work to have the TERMINAL env in Hyprland

* Configure terminal settings against a full set of options

* Make About usable with any terminal

* One more alacritty-specific setting

* Use the new wifi launcher bin

* Only require the update/relaunch if TERMINAL isn't already set in config/uwsm/env

* More alacritty usage converted to $TERMINAL

* Use new launcher

* Change scrolltouchpad input rule to apply to all terminals

* Its a singular match

* Take current font from waybar, in case we don't have alacritty

* Only set font for alacritty if its being used

* Get ready to be terminal agnostic on the refresh of config too

* Use new launcher

* Note the last reliance we have on alacritty

* Make theme setting for terminals generic and include kitty

* Set font_family for kitty as well

* Quiet grep

---------

Co-authored-by: David Heinemeier Hansson <david@hey.com>
2025-09-16 14:32:40 +02:00

30 lines
811 B
Bash
Executable File

#!/bin/bash
screensaver_in_focus() {
hyprctl activewindow -j | jq -e '.class == "Screensaver"' >/dev/null 2>&1
}
exit_screensaver() {
hyprctl keyword cursor:invisible false
pkill -x tte 2>/dev/null
pkill -f "$TERMINAL --class Screensaver" 2>/dev/null
exit 0
}
trap exit_screensaver SIGINT SIGTERM SIGHUP SIGQUIT
hyprctl keyword cursor:invisible true
while true; do
effect=$(tte 2>&1 | grep -oP '{\K[^}]+' | tr ',' ' ' | tr ' ' '\n' | sed -n '/^beams$/,$p' | sort -u | shuf -n1)
tte -i ~/.config/omarchy/branding/screensaver.txt \
--frame-rate 240 --canvas-width 0 --canvas-height $(($(tput lines) - 2)) --anchor-canvas c --anchor-text c \
"$effect" &
while pgrep -x tte >/dev/null; do
if read -n 1 -t 3 || ! screensaver_in_focus; then
exit_screensaver
fi
done
done