diff --git a/home/.zshrc.local b/home/.zshrc.local index 02c54c6..3bec6e2 100644 --- a/home/.zshrc.local +++ b/home/.zshrc.local @@ -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