aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorChristopher R. Nelson <christopher.nelson@languidnights.com>2026-11-01 00:27:57 -0400
committerChristopher R. Nelson <christopher.nelson@languidnights.com>2026-11-01 00:27:57 -0400
commitf1933ef4b012de715e637f489bbcb89d944496f8 (patch)
tree8a00179529584f6376dfa1a40d3713c30795bd41 /README.md
parent7fb53e418a48b8baa7bcab89967a0755f2230162 (diff)
Save the chosen wallpaper and restore it at loginHEADmain
Menu items now call the program back with --set FILE, which runs the configured command and, if it exits 0, saves the path to $XDG_STATE_HOME/wallpaper-switcher/current. --restore sets the saved wallpaper again, for use in labwc/openbox autostart. Items use the binary's absolute path so the menu works when it is not on PATH. Paths from the command line are parsed as native namestrings so file names containing * or [ are not treated as wildcards. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'README.md')
-rw-r--r--README.md21
1 files changed, 19 insertions, 2 deletions
diff --git a/README.md b/README.md
index 0ee66af..e43c21c 100644
--- a/README.md
+++ b/README.md
@@ -22,6 +22,21 @@ In `menu.xml`:
Then reference `wallpapers` from your root menu and reconfigure Openbox.
+Picking an item runs `wallpaper-switcher --set FILE`, which runs the
+configured command and saves the path to
+`$XDG_STATE_HOME/wallpaper-switcher/current` (usually
+`~/.local/state/wallpaper-switcher/current`). Items call the program by its
+absolute path, so it does not need to be on `PATH`.
+
+## Restoring at login
+
+Add this to `~/.config/labwc/autostart` (or `~/.config/openbox/autostart`):
+
+ wallpaper-switcher --restore &
+
+It sets the saved wallpaper again with the current `command` setting. If you
+pass `--config` or `--command` to the menu, pass the same options here.
+
## Configuration
Optional. Put it in `$XDG_CONFIG_HOME/wallpaper-switcher/config` (usually
@@ -32,8 +47,10 @@ Optional. Put it in `$XDG_CONFIG_HOME/wallpaper-switcher/config` (usually
# hidden ones (starting with .) are skipped.
directory = ~/.wallpapers
-# Shell command run when an item is picked. %f is the file (already quoted
-# for the shell), %% is a literal %.
+# Shell command run when an item is picked or restored. %f is the file
+# (already quoted for the shell), %% is a literal %. It is run with sh -c and
+# waited for, so anything long-running (like swaybg) must end with &. The
+# wallpaper is only saved if the command exits with status 0.
command = pkill -x swaybg; swaybg -m fill -i %f &
# File extensions to include, matched without regard to case.