[zsh] add wallpaper switcher function
This commit is contained in:
parent
4df7444e40
commit
0d638c9dfd
|
@ -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
|
||||
|
|
Reference in a new issue