Files
omarchycn/bin/omarchy-branding-screensaver
David Heinemeier HanssonandClaude Fable 5 87940c3cf4 Pick branding images with the portal file chooser
omarchy-file-select gains an --extensions filter, passed through the
portal's native filters option, so the branding commands can offer
only png/svg instead of walking a find-generated menu of Pictures.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-01 19:55:02 -05:00

29 lines
948 B
Bash
Executable File

#!/bin/bash
# omarchy:summary=Edit, set, or reset screensaver branding
# omarchy:group=branding
# omarchy:name=screensaver
# omarchy:args=<image|text|reset>
# omarchy:examples=omarchy branding screensaver image | omarchy branding screensaver text | omarchy branding screensaver reset
set -euo pipefail
case "${1:-}" in
image)
image=$(omarchy-file-select --title "Pick PNG or SVG for screensaver" --extensions "png svg")
if omarchy-transcode-ascii "$image" ~/.config/omarchy/branding/screensaver.txt; then
omarchy-launch-screensaver force >/dev/null 2>&1
fi
;;
text)
omarchy-launch-editor ~/.config/omarchy/branding/screensaver.txt >/dev/null 2>&1 && omarchy-launch-screensaver force >/dev/null 2>&1
;;
reset)
cp "$OMARCHY_PATH/logo.txt" ~/.config/omarchy/branding/screensaver.txt && omarchy-launch-screensaver force >/dev/null 2>&1
;;
*)
echo "Usage: omarchy-branding-screensaver <image|text|reset>" >&2
exit 1
;;
esac