- wm: hot corner polling via select()-based wm_run loop; TL=Exposé, TR=show desktop, BL=launcher, BR=lock - wm: XF86 media key grabs (volume, brightness, playback) + Super+V for clipboard - wm: autostart reads ~/.config/orionos/autostart on startup - events: media key dispatch (amixer/brightnessctl/playerctl); Super+V → orionclip --show; Print → orionshot - orionshot: new X11 screenshot tool, full-screen and rubber-band region modes, saves PNG to ~/Pictures/Screenshots/ - orionclip: new clipboard manager daemon; polls clipboard, stores 20 entries, popup via Super+V IPC - orionnotify: append-only notification history log at ~/.local/share/orionos/notif-history.log - themes: GTK accent updated from #3A6898 to #1E58A8 to match WM/deskbar - themes: orionwallpaper gains --slideshow DIR [SECS] mode using feh + sleep loop - iso: Docker-based archiso builder, live-session xinitrc, profiledef.sh - Makefile: add orionshot and orionclip to all/clean/install; Docker-based iso target
81 lines
2.7 KiB
Bash
81 lines
2.7 KiB
Bash
#!/usr/bin/env bash
|
|
# orionwallpaper — set or restore the OrionOS desktop wallpaper
|
|
#
|
|
# Usage:
|
|
# orionwallpaper # restore saved wallpaper (called from xinitrc)
|
|
# orionwallpaper /path/to/image.jpg # set new wallpaper and save it
|
|
# orionwallpaper --color "#6B8FB5" # set solid color
|
|
# orionwallpaper --reset # reset to default blue-gray solid color
|
|
# orionwallpaper --slideshow DIR [SECS] # rotate images in DIR every SECS seconds (default 300)
|
|
#
|
|
# Wallpaper preference is stored in ~/.config/orionos/wallpaper
|
|
|
|
CONF_DIR="$HOME/.config/orionos"
|
|
CONF_FILE="$CONF_DIR/wallpaper"
|
|
DEFAULT_COLOR="#1A2840"
|
|
WALLPAPER_DIR="/usr/share/orionos/wallpapers"
|
|
|
|
mkdir -p "$CONF_DIR"
|
|
|
|
case "${1:-}" in
|
|
--slideshow)
|
|
DIR="${2:-$WALLPAPER_DIR}"
|
|
SECS="${3:-300}"
|
|
if [[ ! -d "$DIR" ]]; then
|
|
echo "Error: directory not found: $DIR" >&2
|
|
exit 1
|
|
fi
|
|
while true; do
|
|
IMG="$(find "$DIR" -maxdepth 1 -type f \( -iname '*.png' -o -iname '*.jpg' -o -iname '*.jpeg' \) | shuf -n1)"
|
|
if [[ -n "$IMG" ]]; then
|
|
feh --no-fehbg --bg-fill "$IMG"
|
|
fi
|
|
sleep "$SECS"
|
|
done
|
|
;;
|
|
--reset)
|
|
echo "color:$DEFAULT_COLOR" > "$CONF_FILE"
|
|
xsetroot -solid "$DEFAULT_COLOR"
|
|
echo "Wallpaper reset to default color."
|
|
;;
|
|
--color)
|
|
COLOR="${2:-$DEFAULT_COLOR}"
|
|
echo "color:$COLOR" > "$CONF_FILE"
|
|
xsetroot -solid "$COLOR"
|
|
echo "Wallpaper set to solid $COLOR."
|
|
;;
|
|
"")
|
|
# Restore from saved config
|
|
if [[ -f "$CONF_FILE" ]]; then
|
|
SAVED="$(cat "$CONF_FILE")"
|
|
if [[ "$SAVED" == color:* ]]; then
|
|
xsetroot -solid "${SAVED#color:}"
|
|
elif [[ -f "$SAVED" ]]; then
|
|
feh --no-fehbg --bg-fill "$SAVED"
|
|
else
|
|
xsetroot -solid "$DEFAULT_COLOR"
|
|
fi
|
|
else
|
|
# First run: use default wallpaper if it exists, else solid color
|
|
if [[ -f "$WALLPAPER_DIR/orionos-default.png" ]]; then
|
|
feh --no-fehbg --bg-fill "$WALLPAPER_DIR/orionos-default.png"
|
|
echo "$WALLPAPER_DIR/orionos-default.png" > "$CONF_FILE"
|
|
else
|
|
xsetroot -solid "$DEFAULT_COLOR"
|
|
echo "color:$DEFAULT_COLOR" > "$CONF_FILE"
|
|
fi
|
|
fi
|
|
;;
|
|
*)
|
|
# Set specific image file
|
|
IMG="$1"
|
|
if [[ ! -f "$IMG" ]]; then
|
|
echo "Error: file not found: $IMG" >&2
|
|
exit 1
|
|
fi
|
|
echo "$IMG" > "$CONF_FILE"
|
|
feh --no-fehbg --bg-fill "$IMG"
|
|
echo "Wallpaper set to: $IMG"
|
|
;;
|
|
esac
|