scwrypts v3 refactor
This commit is contained in:
40
scwrypts/desktop/i3/lock
Executable file
40
scwrypts/desktop/i3/lock
Executable file
@@ -0,0 +1,40 @@
|
||||
#!/bin/zsh
|
||||
DEPENDENCIES+=(
|
||||
i3lock
|
||||
)
|
||||
REQUIRED_ENV+=()
|
||||
|
||||
use desktop/colorscheme --group dotwryn
|
||||
use desktop/notify --group dotwryn
|
||||
|
||||
CHECK_ENVIRONMENT
|
||||
#####################################################################
|
||||
|
||||
ARGS=(
|
||||
--ignore-empty-password
|
||||
--force-clock
|
||||
--pass-screen-keys
|
||||
--pass-media-keys
|
||||
--pass-volume-keys
|
||||
--pass-power-keys
|
||||
--verif-text=''
|
||||
--wrong-text=''
|
||||
--blur=11
|
||||
--insidever-color=$(GET_COLORSCHEME_HEX 6)
|
||||
--ringver-color=$(GET_COLORSCHEME_HEX 10)
|
||||
--insidewrong-color=$(GET_COLORSCHEME_HEX 1)
|
||||
--ringwrong-color=$(GET_COLORSCHEME_HEX 9)
|
||||
--inside-color=$(GET_COLORSCHEME_HEX 0)
|
||||
--ring-color=$(GET_COLORSCHEME_HEX 2)
|
||||
--time-color=$(GET_COLORSCHEME_HEX 7)
|
||||
--date-color=$(GET_COLORSCHEME_HEX 15)
|
||||
--keyhl-color=$(GET_COLORSCHEME_HEX 11)
|
||||
--bshl-color=$(GET_COLORSCHEME_HEX 13)
|
||||
)
|
||||
|
||||
RADIUS=$(xrandr | grep 'connected primary' | sed 's/.* \([0-9]\+\)x.*/\1/' | awk '{print int($1*0.08)}')
|
||||
[ $RADIUS ] && ARGS+=(--radius=$RADIUS)
|
||||
|
||||
i3lock ${ARGS[@]} \
|
||||
|| NOTIFY_ERROR 'i3lock-color' 'something went wrong; unable to lock' \
|
||||
;
|
16
scwrypts/desktop/i3/logout
Executable file
16
scwrypts/desktop/i3/logout
Executable file
@@ -0,0 +1,16 @@
|
||||
#!/bin/zsh
|
||||
DEPENDENCIES+=(
|
||||
i3-nagbar
|
||||
)
|
||||
REQUIRED_ENV+=()
|
||||
|
||||
use desktop/notify --group dotwryn
|
||||
|
||||
CHECK_ENVIRONMENT
|
||||
#####################################################################
|
||||
i3-nagbar \
|
||||
-t warning \
|
||||
-m 'Do you really want to exit i3?' \
|
||||
-B 'Yes' "notify-send 'system' 'exiting i3...' -i face-tired; i3-msg exit" \
|
||||
|| NOTIFY_ERROR 'unable to launch i3-nagbar'
|
||||
|
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