scwrypts v3 refactor
This commit is contained in:
27
scwrypts/desktop/i3/set-background
Executable file
27
scwrypts/desktop/i3/set-background
Executable file
@@ -0,0 +1,27 @@
|
||||
#!/bin/zsh
|
||||
DEPENDENCIES+=()
|
||||
REQUIRED_ENV+=(
|
||||
DESKTOP__WALLPAPER_PATH
|
||||
)
|
||||
|
||||
CHECK_ENVIRONMENT
|
||||
#####################################################################
|
||||
|
||||
|
||||
[ ! -d $WALLPAPER_PATH ] \
|
||||
&& FAIL 1 "no such directory for DESKTOP__WALLPAPER_PATH='$DESKTOP__WALLPAPER_PATH'"
|
||||
|
||||
SELECTION="$1"
|
||||
[ ! $SELECTION ] && SELECTION=random
|
||||
|
||||
case $SELECTION in
|
||||
random )
|
||||
feh --recursive --randomize --bg-fill $WALLPAPER_PATH
|
||||
;;
|
||||
* )
|
||||
[ ! -f $DESKTOP__WALLPAPER_PATH/$SELECTION ] \
|
||||
&& FAIL 2 "no such wallpaper '$SELECTION' in wallpaper path"
|
||||
|
||||
feh --bg-fill $DESKTOP__WALLPAPER_PATH/$SELECTION
|
||||
;;
|
||||
esac
|
Reference in New Issue
Block a user