~kris/dots

srice

ref: 3bdfd3e0c26b75a939850355c30bee6fa9cc9abd srice/.local/bin/media/bg-picker -rwxr-xr-x 441 bytes
3bdfd3e0 — Kris Yotam sync: lock down plan9 theme, wallpapers, nvim configs 3 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/bin/sh

# bg-picker - wallpaper picker using ThumbPick
# Opens ThumbPick with vim keybinds to browse wallpapers.
# On selection, runs setbg to apply the chosen wallpaper.

WALLPAPER_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/wallpapers"

[ -d "$WALLPAPER_DIR" ] || { notify-send "bg-picker" "No wallpapers directory found at $WALLPAPER_DIR"; exit 1; }

chosen="$(thumbpick "$WALLPAPER_DIR" -v)" || exit 1

[ -n "$chosen" ] && setbg "$chosen"