about summary refs log blame commit diff stats
path: root/bin/xbg
blob: 339ed69045a4c99dea8eba9a3cf4898a57ead52c (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
         


                                                                                                                                                                                                                                          






                                                             
#!/bin/sh
# if there is an argument, forcibly symlink it to $PICPATH and set $PICPATH to the background using xwallpaper.
# if there is not an argument, set the wallpaper through the aforementioned method without setting the symlink.
# $PICPATH is by default $XDG_PICTURES_DIR/bg.png, determined by xdg-user-dir if available or assumed to be ~/Pictures/bg.png if unavailable. $PICPATH can be set by the user in shrc if they wish to use a different background location.
if command -v xdg-user-dir >/dev/null; then
	PICPATH=${PICPATH:="$(xdg-user-dir PICTURES)/bg.png"}
else
	PICPATH=${PICPATH:="$HOME/Pictures/bg.png"}
fi
[ -n "$1" ]&&ln -sf "$1" "$PICPATH"
xwallpaper --zoom "$PICPATH"