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>
29 lines
948 B
Bash
Executable File
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
|