#!/bin/sh # Apply or restore the Geminux desktop wallpaper via geminux-themes CLI engine (POSIX sh) set -eu case "${1:-}" in -h|--help) printf 'Usage:\n' printf ' geminux-apply-wallpaper [--restore]\n' printf ' geminux-apply-wallpaper IMAGE_PATH [--mode fill|fit|center|tile|stretch|span] [--bg #RRGGBB|theme] [--no-save]\n' printf ' geminux-apply-wallpaper --solid #RRGGBB [--no-save]\n' printf ' geminux-apply-wallpaper --theme-bg [--no-save]\n' exit 0 ;; esac SCRIPT_DIR="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)" if [ -x "$SCRIPT_DIR/geminux-themes" ]; then BIN="$SCRIPT_DIR/geminux-themes" elif command -v geminux-themes >/dev/null 2>&1; then BIN="$(command -v geminux-themes)" else printf 'geminux-apply-wallpaper: geminux-themes executable not found\n' >&2 exit 1 fi case "${1:-}" in ""|--restore) exec "$BIN" --restore-wallpaper ;; *) exec "$BIN" --apply-wallpaper "$@" ;; esac