[zsh] add wallpaper switcher function

legacy
Simon Bruder 2019-02-09 20:21:30 +00:00
parent 4df7444e40
commit 0d638c9dfd
No known key found for this signature in database
GPG Key ID: 6F03E0000CC5B62F
1 changed files with 19 additions and 0 deletions

View File

@ -117,6 +117,25 @@ function timer() {
)
}
## Wallpaper switcher
function wp() {
(
if [ -z "$1" ] || ([ "$1" = "rand" ] && [ -z "$2" ]); then
echo "USAGE: $0 rand|default [path]"
return 1
fi
if [ "$1" = "default" ];then
echo "d"
feh --bg-fill /usr/share/wallpapers/wallpaper.jpg
fi
if [ "$1" = "rand" ]; then
base="$HOME/Bilder/wallpaper"
rand=$(shuf -n1 -e $base/$2/*)
[ -z "$rand" ] || feh --bg-fill "$rand"
fi
)
}
# Program aliases/env
## Aliases for programs