#!/bin/sh # Set the wallpaper through aurora. aurora owns the wallpaper: it draws it itself (mono dots, colour dots or photo, # see its settings), records it in ~/.local/state/aurora/wallpaper and runs matugen (colours). This is just the CLI front-end for its IPC. # # setwall random wallpaper from the folder selected in aurora's picker # setwall -m open (toggle) aurora's wallpaper picker # setwall [-p] FILE set FILE as the wallpaper usage() { echo "Usage: setwall [-m] [[-p] /path/to/image]" >&2 exit 1 } # `qs ipc call` exits 0 even when it fails, but void calls print nothing on success ipc() { out=$(qs -c aurora ipc call shell "$@" 2>&1) && [ -z "$out" ] && return echo "setwall: aurora: ${out:-not running}" >&2 echo " (is it running? systemctl --user start aurora)" >&2 exit 1 } case "$1" in "") ipc wallrandom ;; -m) ipc wall ;; -p) [ -n "$2" ] || usage; file="$2" ;; -h|-*) usage ;; *) file="$1" ;; esac if [ -n "$file" ]; then if [ ! -f "$file" ]; then echo "setwall: file not found -> $file" >&2 exit 1 fi ipc wallset "$(realpath "$file")" fi