scwrypts v4 compatibility
This commit is contained in:
parent
fab3d7c54e
commit
a7590c1b84
@ -1,73 +1,70 @@
|
|||||||
#!/bin/zsh
|
#!/bin/zsh
|
||||||
DEPENDENCIES+=()
|
|
||||||
REQUIRED_ENV+=()
|
|
||||||
|
|
||||||
use desktop/notify --group dotwryn
|
use desktop/notify --group dotwryn
|
||||||
|
|
||||||
CHECK_ENVIRONMENT
|
|
||||||
#####################################################################
|
#####################################################################
|
||||||
|
|
||||||
{
|
MAIN() {
|
||||||
command -v xbacklight && UTIL=xbacklight
|
local UTIL
|
||||||
command -v gmux_backlight && UTIL=gmux_backlight
|
for UTIL in enlighten gmux_backlight xbacklight
|
||||||
command -v enlighten && UTIL=enlighten
|
do
|
||||||
} >/dev/null 2>&1
|
command -v $UTIL >/dev/null 2>&1 && break
|
||||||
|
done
|
||||||
|
|
||||||
[[ $UTIL =~ ^enlighten$ ]] && {
|
[[ $UTIL =~ ^enlighten$ ]] && {
|
||||||
CURRENT_PERCENT=$(enlighten | sed 's/.*(//;s/%.*//')
|
CURRENT_PERCENT=$(enlighten | sed 's/.*(//;s/%.*//')
|
||||||
[[ $CURRENT_PERCENT -gt 60 ]] && DELTA=20
|
[[ $CURRENT_PERCENT -gt 60 ]] && DELTA=20
|
||||||
[[ $CURRENT_PERCENT -le 60 ]] && DELTA=10
|
[[ $CURRENT_PERCENT -le 60 ]] && DELTA=10
|
||||||
[[ $CURRENT_PERCENT -le 40 ]] && DELTA=5
|
[[ $CURRENT_PERCENT -le 40 ]] && DELTA=5
|
||||||
[[ $CURRENT_PERCENT -le 10 ]] && DELTA=1
|
[[ $CURRENT_PERCENT -le 10 ]] && DELTA=1
|
||||||
|
}
|
||||||
|
|
||||||
|
case $1 in
|
||||||
|
up )
|
||||||
|
case $UTIL in
|
||||||
|
xbacklight ) xbacklight + 10 ;;
|
||||||
|
gmux_backlight ) gmux_backlight +100 ;;
|
||||||
|
|
||||||
|
enlighten )
|
||||||
|
[[ $CURRENT_PERCENT -ge 99 ]] && NOTIFY_SEND 'at maximum brightness' && exit 0
|
||||||
|
enlighten +${DELTA}%
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
down )
|
||||||
|
case $UTIL in
|
||||||
|
xbacklight ) xbacklight - 10 ;;
|
||||||
|
gmux_backlight ) gmux_backlight -100 ;;
|
||||||
|
|
||||||
|
enlighten )
|
||||||
|
[[ $CURRENT_PERCENT -le 1 ]] && NOTIFY_SEND 'at minimum brightness' && exit 0
|
||||||
|
[[ $CURRENT_PERCENT -le 2 ]] && ARGS='=1%' || ARGS="-${DELTA}%"
|
||||||
|
enlighten "$ARGS"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
set )
|
||||||
|
[ ! $2 ] && FAIL 1 'no value provided to set'
|
||||||
|
case $UTIL in
|
||||||
|
xbacklight ) xbacklight -set $2 ;;
|
||||||
|
gmux_backlight ) gmux_backlight $2 ;;
|
||||||
|
enlighten ) enlighten "=$2" ;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
min | minimum )
|
||||||
|
case $UTIL in
|
||||||
|
enlighten ) enlighten '=1%' ;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
max | maximum )
|
||||||
|
case $UTIL in
|
||||||
|
enlighten ) enlighten '=100%' ;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
query | '' )
|
||||||
|
case $UTIL in
|
||||||
|
enlighten ) NOTIFY_SUCCESS "current brightness : $(enlighten)" ;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
|
||||||
|
* ) NOTIFY_FAIL 1 "operation '$1' not supported" ;;
|
||||||
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
case $1 in
|
|
||||||
up )
|
|
||||||
case $UTIL in
|
|
||||||
xbacklight ) xbacklight + 10 ;;
|
|
||||||
gmux_backlight ) gmux_backlight +100 ;;
|
|
||||||
|
|
||||||
enlighten )
|
|
||||||
[[ $CURRENT_PERCENT -ge 99 ]] && NOTIFY_SEND 'at maximum brightness' && exit 0
|
|
||||||
enlighten +${DELTA}%
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
;;
|
|
||||||
down )
|
|
||||||
case $UTIL in
|
|
||||||
xbacklight ) xbacklight - 10 ;;
|
|
||||||
gmux_backlight ) gmux_backlight -100 ;;
|
|
||||||
|
|
||||||
enlighten )
|
|
||||||
[[ $CURRENT_PERCENT -le 1 ]] && NOTIFY_SEND 'at minimum brightness' && exit 0
|
|
||||||
[[ $CURRENT_PERCENT -le 2 ]] && ARGS='=1%' || ARGS="-${DELTA}%"
|
|
||||||
enlighten "$ARGS"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
;;
|
|
||||||
set )
|
|
||||||
[ ! $2 ] && FAIL 1 'no value provided to set'
|
|
||||||
case $UTIL in
|
|
||||||
xbacklight ) xbacklight -set $2 ;;
|
|
||||||
gmux_backlight ) gmux_backlight $2 ;;
|
|
||||||
enlighten ) enlighten "=$2" ;;
|
|
||||||
esac
|
|
||||||
;;
|
|
||||||
min | minimum )
|
|
||||||
case $UTIL in
|
|
||||||
enlighten ) enlighten '=1%' ;;
|
|
||||||
esac
|
|
||||||
;;
|
|
||||||
max | maximum )
|
|
||||||
case $UTIL in
|
|
||||||
enlighten ) enlighten '=100%' ;;
|
|
||||||
esac
|
|
||||||
;;
|
|
||||||
query | '' )
|
|
||||||
case $UTIL in
|
|
||||||
enlighten ) NOTIFY_SUCCESS "current brightness : $(enlighten)" ;;
|
|
||||||
esac
|
|
||||||
;;
|
|
||||||
|
|
||||||
* ) NOTIFY_FAIL 1 "operation '$1' not supported" ;;
|
|
||||||
esac
|
|
||||||
|
@ -1,16 +1,7 @@
|
|||||||
#!/bin/zsh
|
#!/bin/zsh
|
||||||
DEPENDENCIES+=()
|
|
||||||
REQUIRED_ENV+=()
|
|
||||||
|
|
||||||
use desktop/colorscheme --group dotwryn
|
use desktop/colorscheme --group dotwryn
|
||||||
|
|
||||||
CHECK_ENVIRONMENT
|
|
||||||
#####################################################################
|
#####################################################################
|
||||||
|
|
||||||
MAIN() {
|
MAIN() {
|
||||||
unset USAGE
|
|
||||||
GET_COLORSCHEME_HEX $@
|
GET_COLORSCHEME_HEX $@
|
||||||
}
|
}
|
||||||
|
|
||||||
#####################################################################
|
|
||||||
MAIN $@
|
|
||||||
|
@ -1,16 +1,7 @@
|
|||||||
#!/bin/zsh
|
#!/bin/zsh
|
||||||
DEPENDENCIES+=()
|
|
||||||
REQUIRED_ENV+=()
|
|
||||||
|
|
||||||
use desktop/colorscheme --group dotwryn
|
use desktop/colorscheme --group dotwryn
|
||||||
|
|
||||||
CHECK_ENVIRONMENT
|
|
||||||
#####################################################################
|
#####################################################################
|
||||||
|
|
||||||
MAIN() {
|
MAIN() {
|
||||||
unset USAGE
|
|
||||||
SET_THEME $@
|
SET_THEME $@
|
||||||
}
|
}
|
||||||
|
|
||||||
#####################################################################
|
|
||||||
MAIN $@
|
|
||||||
|
@ -1,45 +1,40 @@
|
|||||||
#!/bin/zsh
|
#!/bin/zsh
|
||||||
DEPENDENCIES+=(
|
DEPENDENCIES+=(diff)
|
||||||
diff
|
REQUIRED_ENV+=(I3__MODEL_CONFIG)
|
||||||
)
|
#####################################################################
|
||||||
REQUIRED_ENV+=(
|
|
||||||
I3__MODEL_CONFIG
|
USAGE="
|
||||||
)
|
usage: [...options...]
|
||||||
|
|
||||||
|
options:
|
||||||
|
-f, --force force replacement of existing i3config
|
||||||
|
-n, --no-link if output config and template are the same, don't create link
|
||||||
|
|
||||||
|
environment:
|
||||||
|
I3__MODEL_CONFIG fully-qualified path to sourced i3config
|
||||||
|
I3__GLOBAL_FONT_SIZE global font size
|
||||||
|
I3__DMENU_FONT_SIZE (optional) font size for 'dmenu' command
|
||||||
|
I3__BORDER_PIXEL_SIZE (optional) pixel-width of window borders
|
||||||
|
|
||||||
|
I3 provides no way to include dynamic variables in your config.
|
||||||
|
The main difference I want between my i3 configurations is font-size
|
||||||
|
to match the current monitor. Since i3-msg provides no way to change
|
||||||
|
font size, I run this command to update those variables on a local
|
||||||
|
copy of my sourced config
|
||||||
|
"
|
||||||
|
|
||||||
CHECK_ENVIRONMENT
|
|
||||||
#####################################################################
|
#####################################################################
|
||||||
|
|
||||||
REGEX_FONT='^\(font [^0-9]*\)\(.*\)'
|
REGEX_FONT='^\(font [^0-9]*\)\(.*\)'
|
||||||
REGEX_DMENU="^\\(.*dmenu_run .*-fn '[^0-9]*\\)\\([0-9]*\\)'"
|
REGEX_DMENU="^\\(.*dmenu_run .*-fn '[^0-9]*\\)\\([0-9]*\\)'"
|
||||||
REGEX_BORDER='^\(for_window.*border pixel \)\(.*\)'
|
REGEX_BORDER='^\(for_window.*border pixel \)\(.*\)'
|
||||||
|
|
||||||
INSTALL() {
|
MAIN() {
|
||||||
local USAGE="
|
|
||||||
usage: [...options...]
|
|
||||||
|
|
||||||
options
|
|
||||||
-f, --force force replacement of existing i3config
|
|
||||||
-n, --no-link if output config and template are the same, don't create link
|
|
||||||
|
|
||||||
-h, --help print this message and exit
|
|
||||||
|
|
||||||
environment
|
|
||||||
I3__MODEL_CONFIG fully-qualified path to sourced i3config
|
|
||||||
I3__GLOBAL_FONT_SIZE global font size
|
|
||||||
I3__DMENU_FONT_SIZE (optional) font size for 'dmenu' command
|
|
||||||
I3__BORDER_PIXEL_SIZE (optional) pixel-width of window borders
|
|
||||||
|
|
||||||
I3 provides no way to include dynamic variables in your config.
|
|
||||||
The main difference I want between my i3 configurations is font-size
|
|
||||||
to match the current monitor. Since i3-msg provides no way to change
|
|
||||||
font size, I run this command to update those variables on a local
|
|
||||||
copy of my sourced config
|
|
||||||
"
|
|
||||||
local FORCE=0
|
local FORCE=0
|
||||||
local AUTOLINK=1
|
local AUTOLINK=1
|
||||||
while [[ $# -gt 0 ]]
|
while [[ $# -gt 0 ]]
|
||||||
do
|
do
|
||||||
case $1 in
|
case $1 in
|
||||||
-f | --force ) FORCE=1 ;;
|
-f | --force ) FORCE=1 ;;
|
||||||
-n | --no-link ) AUTOLINK=0 ;;
|
-n | --no-link ) AUTOLINK=0 ;;
|
||||||
-h | --help ) USAGE; exit 0 ;;
|
-h | --help ) USAGE; exit 0 ;;
|
||||||
@ -84,19 +79,16 @@ INSTALL() {
|
|||||||
[ -f "$CONFIG_FILE.bak" ] \
|
[ -f "$CONFIG_FILE.bak" ] \
|
||||||
&& diff "$CONFIG_FILE" "$CONFIG_FILE.bak" -q >/dev/null \
|
&& diff "$CONFIG_FILE" "$CONFIG_FILE.bak" -q >/dev/null \
|
||||||
&& mv "$CONFIG_FILE.bak" "$CONFIG_FILE" \
|
&& mv "$CONFIG_FILE.bak" "$CONFIG_FILE" \
|
||||||
&& INFO "no changes were made" \
|
&& DEBUG "no changes were made" \
|
||||||
;
|
;
|
||||||
|
|
||||||
[[ $AUTOLINK -eq 1 ]] \
|
[[ $AUTOLINK -eq 1 ]] \
|
||||||
&& diff "$CONFIG_FILE" "$I3__MODEL_CONFIG" -q >/dev/null \
|
&& diff "$CONFIG_FILE" "$I3__MODEL_CONFIG" -q >/dev/null \
|
||||||
&& rm "$CONFIG_FILE" \
|
&& rm "$CONFIG_FILE" \
|
||||||
&& ln -s "$I3__MODEL_CONFIG" "$CONFIG_FILE" \
|
&& ln -s "$I3__MODEL_CONFIG" "$CONFIG_FILE" \
|
||||||
&& INFO "output is the same as model, i3config has been linked to model" \
|
&& DEBUG "output is the same as model, i3config has been linked to model" \
|
||||||
;
|
;
|
||||||
|
|
||||||
[[ $FORCE -eq 1 ]] && rm "$CONFIG.bak" >/dev/null 2>&1
|
[[ $FORCE -eq 1 ]] && rm "$CONFIG.bak" >/dev/null 2>&1
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
#####################################################################
|
|
||||||
INSTALL $@
|
|
||||||
|
@ -1,45 +1,41 @@
|
|||||||
#!/bin/zsh
|
#!/bin/zsh
|
||||||
DEPENDENCIES+=(
|
|
||||||
i3-msg
|
|
||||||
xdotool
|
|
||||||
xrandr
|
|
||||||
)
|
|
||||||
REQUIRED_ENV+=()
|
|
||||||
|
|
||||||
use system/desktop/notify
|
use system/desktop/notify
|
||||||
|
|
||||||
CHECK_ENVIRONMENT
|
DEPENDENCIES+=(i3-msg xdotool xrandr)
|
||||||
#####################################################################
|
#####################################################################
|
||||||
|
|
||||||
LAUNCH_OR_SHOW() {
|
USAGE="
|
||||||
INFO $@
|
usage: <path-executable> [client-class] [...options...]
|
||||||
local USAGE="
|
|
||||||
usage: <path-executable> [client-class] [...options...]
|
|
||||||
|
|
||||||
options
|
options
|
||||||
-c, --client <string> if different from the executable name, xprop CLIENT_CLASS
|
-c, --client <string> if different from the executable name, xprop CLIENT_CLASS
|
||||||
|
|
||||||
-s, --scale <value> (default: 0.8 or 0.5 if screen width >3000px)
|
-s, --scale <value> (default: 0.8 or 0.5 if screen width >3000px)
|
||||||
-x, --x-offset <value> (default: 0.0)
|
-x, --x-offset <value> (default: 0.0)
|
||||||
-y, --y-offset <value> (default: 0.0)
|
-y, --y-offset <value> (default: 0.0)
|
||||||
|
|
||||||
-a, --always-launch invoke executable even if client-class exists
|
-a, --always-launch invoke executable even if client-class exists
|
||||||
-n, --no-resize don't resize the window (ignores -sxy flags)
|
-n, --no-resize don't resize the window (ignores -sxy flags)
|
||||||
-l, --no-center leave the window wherever it was last positioned
|
-l, --no-center leave the window wherever it was last positioned
|
||||||
|
|
||||||
--has-statusbar-icon (default: false) use if program has a statusbar icon
|
--has-statusbar-icon (default: false) use if program has a statusbar icon
|
||||||
|
|
||||||
-h, --help print this message and exit
|
-h, --help print this message and exit
|
||||||
|
|
||||||
Makes it easy to bind appications to key shortcuts without having to
|
Makes it easy to bind appications to key shortcuts without having to
|
||||||
spin up redundant instances or cycle through the scratchpad queue.
|
spin up redundant instances or cycle through the scratchpad queue.
|
||||||
|
|
||||||
Performs a variety of tasks based on states:
|
Performs a variety of tasks based on states:
|
||||||
1) starts and application
|
1) starts and application
|
||||||
2) adds all instances of the specified application to the scratchpad
|
2) adds all instances of the specified application to the scratchpad
|
||||||
3) (toggle) hides all visible instances
|
3) (toggle) hides all visible instances
|
||||||
4) (toggle) shows all scratchpad-hidden instances
|
4) (toggle) shows all scratchpad-hidden instances
|
||||||
"
|
"
|
||||||
|
|
||||||
|
#####################################################################
|
||||||
|
|
||||||
|
MAIN() {
|
||||||
|
DEBUG $@
|
||||||
local APPLICATION CLIENT_CLASS
|
local APPLICATION CLIENT_CLASS
|
||||||
|
|
||||||
local XFFSET=0.0
|
local XFFSET=0.0
|
||||||
@ -55,7 +51,7 @@ LAUNCH_OR_SHOW() {
|
|||||||
|
|
||||||
while [[ $# -gt 0 ]]
|
while [[ $# -gt 0 ]]
|
||||||
do
|
do
|
||||||
case $1 in
|
case $1 in
|
||||||
-c | --client ) CLIENT_CLASS="$2"; shift 1 ;;
|
-c | --client ) CLIENT_CLASS="$2"; shift 1 ;;
|
||||||
-x | --x-offset ) XFFSET=$2; shift 1 ;;
|
-x | --x-offset ) XFFSET=$2; shift 1 ;;
|
||||||
-y | --y-offset ) YFFSET=$2; shift 1 ;;
|
-y | --y-offset ) YFFSET=$2; shift 1 ;;
|
||||||
@ -112,7 +108,7 @@ LAUNCH_OR_SHOW() {
|
|||||||
| awk -v f=$SCALE -v x=$XFFSET -v y=$YFFSET \
|
| awk -v f=$SCALE -v x=$XFFSET -v y=$YFFSET \
|
||||||
'{print int($1*f+x)," ",int($2*f+y);}'\
|
'{print int($1*f+x)," ",int($2*f+y);}'\
|
||||||
)
|
)
|
||||||
INFO "window size: $WINDOW_SIZE"
|
DEBUG "window size: $WINDOW_SIZE"
|
||||||
|
|
||||||
STATUS 'moving window to scratchpad'
|
STATUS 'moving window to scratchpad'
|
||||||
i3-msg "[class=$CLIENT_CLASS] move scratchpad"
|
i3-msg "[class=$CLIENT_CLASS] move scratchpad"
|
||||||
@ -131,6 +127,3 @@ LAUNCH_OR_SHOW() {
|
|||||||
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
#####################################################################
|
|
||||||
LAUNCH_OR_SHOW $@
|
|
||||||
|
@ -1,40 +1,37 @@
|
|||||||
#!/bin/zsh
|
#!/bin/zsh
|
||||||
DEPENDENCIES+=(
|
|
||||||
i3lock
|
|
||||||
)
|
|
||||||
REQUIRED_ENV+=()
|
|
||||||
|
|
||||||
use desktop/colorscheme --group dotwryn
|
use desktop/colorscheme --group dotwryn
|
||||||
use desktop/notify --group dotwryn
|
use desktop/notify --group dotwryn
|
||||||
|
|
||||||
CHECK_ENVIRONMENT
|
DEPENDENCIES+=(i3lock)
|
||||||
#####################################################################
|
#####################################################################
|
||||||
|
|
||||||
ARGS=(
|
MAIN() {
|
||||||
--ignore-empty-password
|
local ARGS=(
|
||||||
--force-clock
|
--ignore-empty-password
|
||||||
--pass-screen-keys
|
--force-clock
|
||||||
--pass-media-keys
|
--pass-screen-keys
|
||||||
--pass-volume-keys
|
--pass-media-keys
|
||||||
--pass-power-keys
|
--pass-volume-keys
|
||||||
--verif-text=''
|
--pass-power-keys
|
||||||
--wrong-text=''
|
--verif-text=''
|
||||||
--blur=11
|
--wrong-text=''
|
||||||
--insidever-color=$(GET_COLORSCHEME_HEX 6)
|
--blur=11
|
||||||
--ringver-color=$(GET_COLORSCHEME_HEX 10)
|
--insidever-color=$(GET_COLORSCHEME_HEX 6)
|
||||||
--insidewrong-color=$(GET_COLORSCHEME_HEX 1)
|
--ringver-color=$(GET_COLORSCHEME_HEX 10)
|
||||||
--ringwrong-color=$(GET_COLORSCHEME_HEX 9)
|
--insidewrong-color=$(GET_COLORSCHEME_HEX 1)
|
||||||
--inside-color=$(GET_COLORSCHEME_HEX 0)
|
--ringwrong-color=$(GET_COLORSCHEME_HEX 9)
|
||||||
--ring-color=$(GET_COLORSCHEME_HEX 2)
|
--inside-color=$(GET_COLORSCHEME_HEX 0)
|
||||||
--time-color=$(GET_COLORSCHEME_HEX 7)
|
--ring-color=$(GET_COLORSCHEME_HEX 2)
|
||||||
--date-color=$(GET_COLORSCHEME_HEX 15)
|
--time-color=$(GET_COLORSCHEME_HEX 7)
|
||||||
--keyhl-color=$(GET_COLORSCHEME_HEX 11)
|
--date-color=$(GET_COLORSCHEME_HEX 15)
|
||||||
--bshl-color=$(GET_COLORSCHEME_HEX 13)
|
--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)}')
|
local RADIUS=$(xrandr | grep 'connected primary' | sed 's/.* \([0-9]\+\)x.*/\1/' | awk '{print int($1*0.08)}')
|
||||||
[ $RADIUS ] && ARGS+=(--radius=$RADIUS)
|
[ $RADIUS ] && ARGS+=(--radius=$RADIUS)
|
||||||
|
|
||||||
i3lock ${ARGS[@]} \
|
i3lock ${ARGS[@]} \
|
||||||
|| NOTIFY_ERROR 'i3lock-color' 'something went wrong; unable to lock' \
|
|| NOTIFY_ERROR 'i3lock-color' 'something went wrong; unable to lock' \
|
||||||
;
|
;
|
||||||
|
}
|
||||||
|
@ -1,16 +1,13 @@
|
|||||||
#!/bin/zsh
|
#!/bin/zsh
|
||||||
DEPENDENCIES+=(
|
use desktop/notify --group dotwryn
|
||||||
i3-nagbar
|
|
||||||
)
|
|
||||||
REQUIRED_ENV+=()
|
|
||||||
|
|
||||||
use desktop/notify --group dotwryn
|
DEPENDENCIES+=(i3-nagbar)
|
||||||
|
|
||||||
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'
|
|
||||||
|
|
||||||
|
MAIN() {
|
||||||
|
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'
|
||||||
|
}
|
||||||
|
@ -1,27 +1,23 @@
|
|||||||
#!/bin/zsh
|
#!/bin/zsh
|
||||||
DEPENDENCIES+=()
|
REQUIRED_ENV+=(DESKTOP__WALLPAPER_PATH)
|
||||||
REQUIRED_ENV+=(
|
|
||||||
DESKTOP__WALLPAPER_PATH
|
|
||||||
)
|
|
||||||
|
|
||||||
CHECK_ENVIRONMENT
|
|
||||||
#####################################################################
|
#####################################################################
|
||||||
|
|
||||||
|
MAIN() {
|
||||||
|
[ ! -d $WALLPAPER_PATH ] \
|
||||||
|
&& FAIL 1 "no such directory for DESKTOP__WALLPAPER_PATH='$DESKTOP__WALLPAPER_PATH'"
|
||||||
|
|
||||||
[ ! -d $WALLPAPER_PATH ] \
|
SELECTION="$1"
|
||||||
&& FAIL 1 "no such directory for DESKTOP__WALLPAPER_PATH='$DESKTOP__WALLPAPER_PATH'"
|
[ ! $SELECTION ] && SELECTION=random
|
||||||
|
|
||||||
SELECTION="$1"
|
case $SELECTION in
|
||||||
[ ! $SELECTION ] && SELECTION=random
|
random )
|
||||||
|
feh --recursive --randomize --bg-fill $WALLPAPER_PATH
|
||||||
|
;;
|
||||||
|
* )
|
||||||
|
[ ! -f $DESKTOP__WALLPAPER_PATH/$SELECTION ] \
|
||||||
|
&& FAIL 2 "no such wallpaper '$SELECTION' in wallpaper path"
|
||||||
|
|
||||||
case $SELECTION in
|
feh --bg-fill $DESKTOP__WALLPAPER_PATH/$SELECTION
|
||||||
random )
|
;;
|
||||||
feh --recursive --randomize --bg-fill $WALLPAPER_PATH
|
esac
|
||||||
;;
|
}
|
||||||
* )
|
|
||||||
[ ! -f $DESKTOP__WALLPAPER_PATH/$SELECTION ] \
|
|
||||||
&& FAIL 2 "no such wallpaper '$SELECTION' in wallpaper path"
|
|
||||||
|
|
||||||
feh --bg-fill $DESKTOP__WALLPAPER_PATH/$SELECTION
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
@ -1,10 +1,7 @@
|
|||||||
#!/bin/zsh
|
#!/bin/zsh
|
||||||
DEPENDENCIES+=()
|
|
||||||
REQUIRED_ENV+=()
|
|
||||||
|
|
||||||
use media/audio --group dotwryn
|
use media/audio --group dotwryn
|
||||||
|
|
||||||
CHECK_ENVIRONMENT
|
|
||||||
#####################################################################
|
#####################################################################
|
||||||
|
|
||||||
MEDIA__PLAY_SFX $@
|
MAIN() {
|
||||||
|
MEDIA__PLAY_SFX $@
|
||||||
|
}
|
||||||
|
@ -1,10 +1,7 @@
|
|||||||
#!/bin/zsh
|
#!/bin/zsh
|
||||||
DEPENDENCIES+=()
|
|
||||||
REQUIRED_ENV+=()
|
|
||||||
|
|
||||||
use desktop/pulse-audio --group dotwryn
|
use desktop/pulse-audio --group dotwryn
|
||||||
|
|
||||||
CHECK_ENVIRONMENT
|
|
||||||
#####################################################################
|
#####################################################################
|
||||||
|
|
||||||
PA__SET_DEFAULT_AUDIO $@
|
MAIN() {
|
||||||
|
PA__SET_DEFAULT_AUDIO $@
|
||||||
|
}
|
||||||
|
@ -1,46 +1,45 @@
|
|||||||
#!/bin/zsh
|
#!/bin/zsh
|
||||||
source $HOME/.config/wryn/env.zsh
|
|
||||||
DEPENDENCIES+=(
|
|
||||||
pactl
|
|
||||||
)
|
|
||||||
REQUIRED_ENV+=()
|
|
||||||
|
|
||||||
use desktop/notify --group dotwryn
|
use desktop/notify --group dotwryn
|
||||||
use media/audio --group dotwryn
|
use media/audio --group dotwryn
|
||||||
|
|
||||||
|
DEPENDENCIES+=(pactl)
|
||||||
|
|
||||||
|
source $HOME/.config/wryn/env.zsh
|
||||||
#####################################################################
|
#####################################################################
|
||||||
|
|
||||||
DEVICE="$1"
|
MAIN() {
|
||||||
COMMAND="$2"
|
local DEVICE="$1"
|
||||||
|
local COMMAND="$2"
|
||||||
|
|
||||||
case $DEVICE in
|
case $DEVICE in
|
||||||
sink ) AMIXER_DEVICE=Master ;;
|
sink ) AMIXER_DEVICE=Master ;;
|
||||||
source ) AMIXER_DEVICE=Capture ;;
|
source ) AMIXER_DEVICE=Capture ;;
|
||||||
* ) NOTIFY_FAIL 1 "Unsupported device '$DEVICE'" ;;
|
* ) NOTIFY_FAIL 1 "Unsupported device '$DEVICE'" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
DEFAULT_DEVICE="@DEFAULT_$(echo $DEVICE | tr '[:lower:]' '[:upper:]')@"
|
local DEFAULT_DEVICE="@DEFAULT_$(echo $DEVICE | tr '[:lower:]' '[:upper:]')@"
|
||||||
case $COMMAND in
|
case $COMMAND in
|
||||||
up )
|
up )
|
||||||
pactl set-$DEVICE-volume $DEFAULT_DEVICE +10% \
|
pactl set-$DEVICE-volume $DEFAULT_DEVICE +10% \
|
||||||
|| NOTIFY_ERROR "pactl error with set-$DEVICE-volume"
|
|| NOTIFY_ERROR "pactl error with set-$DEVICE-volume"
|
||||||
|
|
||||||
MEDIA__PLAY_SFX volume
|
MEDIA__PLAY_SFX volume
|
||||||
;;
|
;;
|
||||||
|
|
||||||
down )
|
down )
|
||||||
pactl set-$DEVICE-volume $DEFAULT_DEVICE -10% \
|
pactl set-$DEVICE-volume $DEFAULT_DEVICE -10% \
|
||||||
|| NOTIFY_ERROR "pactl error with set-$DEVICE-volume"
|
|| NOTIFY_ERROR "pactl error with set-$DEVICE-volume"
|
||||||
|
|
||||||
MEDIA__PLAY_SFX volume
|
MEDIA__PLAY_SFX volume
|
||||||
;;
|
;;
|
||||||
|
|
||||||
mute )
|
mute )
|
||||||
pactl set-$DEVICE-mute $DEFAULT_DEVICE toggle \
|
pactl set-$DEVICE-mute $DEFAULT_DEVICE toggle \
|
||||||
&& NOTIFY_SUCCESS "default $DEVICE" "$(amixer sget $AMIXER_DEVICE | grep -q '\[on\]' && echo unmuted || echo muted)" \
|
&& NOTIFY_SUCCESS "default $DEVICE" "$(amixer sget $AMIXER_DEVICE | grep -q '\[on\]' && echo unmuted || echo muted)" \
|
||||||
|| NOTIFY_ERROR "pactl error with set-$DEVICE-mute"
|
|| NOTIFY_ERROR "pactl error with set-$DEVICE-mute"
|
||||||
MEDIA__PLAY_SFX mute
|
MEDIA__PLAY_SFX mute
|
||||||
;;
|
;;
|
||||||
|
|
||||||
* ) NOTIFY_FAIL 1 "Unsupported command '$COMMAND'" ;;
|
* ) NOTIFY_FAIL 1 "Unsupported command '$COMMAND'" ;;
|
||||||
esac
|
esac
|
||||||
|
}
|
||||||
|
@ -1,52 +1,51 @@
|
|||||||
#!/bin/zsh
|
#!/bin/zsh
|
||||||
DEPENDENCIES+=(xset)
|
|
||||||
REQUIRED_ENV+=()
|
|
||||||
|
|
||||||
use desktop/notify --group dotwryn
|
use desktop/notify --group dotwryn
|
||||||
|
|
||||||
CHECK_ENVIRONMENT
|
DEPENDENCIES+=(xset)
|
||||||
#####################################################################
|
#####################################################################
|
||||||
|
|
||||||
case $1 in
|
MAIN() {
|
||||||
enable | disable | query | toggle ) ACTION="$1" ;;
|
case $1 in
|
||||||
* )
|
enable | disable | query | toggle ) ACTION="$1" ;;
|
||||||
[ ! $1 ] && ACTION=toggle
|
* )
|
||||||
echo $ACTION
|
[ ! $1 ] && ACTION=toggle
|
||||||
;;
|
echo $ACTION
|
||||||
esac
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
[[ $ACTION =~ ^toggle$ ]] && {
|
[[ $ACTION =~ ^toggle$ ]] && {
|
||||||
xset -q | grep -qi 'prefer blanking: *no' \
|
|
||||||
&& ACTION='enable' || ACTION='disable'
|
|
||||||
}
|
|
||||||
|
|
||||||
[ ! $ACTION ] && NOTIFY_FAIL 1 "unknown screen blank action '$1'"
|
|
||||||
|
|
||||||
case $ACTION in
|
|
||||||
enable ) : \
|
|
||||||
&& STATUS 'enabling screen blank' \
|
|
||||||
&& xset +dpms \
|
|
||||||
&& xset s blank \
|
|
||||||
&& xset s on \
|
|
||||||
&& NOTIFY_SUCCESS 'enabled screen blank' \
|
|
||||||
|| NOTIFY_FAIL 2 'error enabling screen blank'
|
|
||||||
;;
|
|
||||||
|
|
||||||
disable ) : \
|
|
||||||
&& STATUS 'disabling screen blank' \
|
|
||||||
&& xset dpms 0 0 0 \
|
|
||||||
&& xset s noblank \
|
|
||||||
&& xset s off \
|
|
||||||
&& NOTIFY_SUCCESS 'disabled screen blank' \
|
|
||||||
|| NOTIFY_FAIL 2 'error disabling screen blank'
|
|
||||||
;;
|
|
||||||
|
|
||||||
query )
|
|
||||||
xset -q | grep -qi 'prefer blanking: *no' \
|
xset -q | grep -qi 'prefer blanking: *no' \
|
||||||
&& CURRENT_STATE='disabled' || CURRENT_STATE='enabled'
|
&& ACTION='enable' || ACTION='disable'
|
||||||
|
}
|
||||||
|
|
||||||
[ ! $CURRENT_STATE ] && NOTIFY_FAIL 3 'unable to determine current setting'
|
[ ! $ACTION ] && NOTIFY_FAIL 1 "unknown screen blank action '$1'"
|
||||||
|
|
||||||
NOTIFY_SUCCESS "screen blank is currently \\033[0;34m$CURRENT_STATE"
|
case $ACTION in
|
||||||
;;
|
enable ) : \
|
||||||
esac
|
&& STATUS 'enabling screen blank' \
|
||||||
|
&& xset +dpms \
|
||||||
|
&& xset s blank \
|
||||||
|
&& xset s on \
|
||||||
|
&& NOTIFY_SUCCESS 'enabled screen blank' \
|
||||||
|
|| NOTIFY_FAIL 2 'error enabling screen blank'
|
||||||
|
;;
|
||||||
|
|
||||||
|
disable ) : \
|
||||||
|
&& STATUS 'disabling screen blank' \
|
||||||
|
&& xset dpms 0 0 0 \
|
||||||
|
&& xset s noblank \
|
||||||
|
&& xset s off \
|
||||||
|
&& NOTIFY_SUCCESS 'disabled screen blank' \
|
||||||
|
|| NOTIFY_FAIL 2 'error disabling screen blank'
|
||||||
|
;;
|
||||||
|
|
||||||
|
query )
|
||||||
|
xset -q | grep -qi 'prefer blanking: *no' \
|
||||||
|
&& CURRENT_STATE='disabled' || CURRENT_STATE='enabled'
|
||||||
|
|
||||||
|
[ ! $CURRENT_STATE ] && NOTIFY_FAIL 3 'unable to determine current setting'
|
||||||
|
|
||||||
|
NOTIFY_SUCCESS "screen blank is currently \\033[0;34m$CURRENT_STATE"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
@ -1,10 +1,7 @@
|
|||||||
#!/bin/zsh
|
#!/bin/zsh
|
||||||
DEPENDENCIES+=()
|
|
||||||
REQUIRED_ENV+=()
|
|
||||||
|
|
||||||
use desktop/xrandr --group dotwryn
|
use desktop/xrandr --group dotwryn
|
||||||
|
|
||||||
CHECK_ENVIRONMENT
|
|
||||||
#####################################################################
|
#####################################################################
|
||||||
|
|
||||||
XRANDR__DISCONNECT_ALL_DISPLAYS $@
|
MAIN() {
|
||||||
|
XRANDR__DISCONNECT_ALL_DISPLAYS $@
|
||||||
|
}
|
||||||
|
@ -1,12 +1,6 @@
|
|||||||
#!/bin/zsh
|
#!/bin/zsh
|
||||||
DEPENDENCIES+=(
|
DEPENDENCIES+=(hostnamectl)
|
||||||
hostnamectl
|
REQUIRED_ENV+=(WRYN__SERVER_HOSTNAMES)
|
||||||
)
|
|
||||||
REQUIRED_ENV+=(
|
|
||||||
WRYN__SERVER_HOSTNAMES
|
|
||||||
)
|
|
||||||
|
|
||||||
CHECK_ENVIRONMENT
|
|
||||||
#####################################################################
|
#####################################################################
|
||||||
|
|
||||||
SESSION='update'
|
SESSION='update'
|
||||||
@ -60,38 +54,38 @@ CURRENT_SESSION=$(\
|
|||||||
|
|
||||||
#####################################################################
|
#####################################################################
|
||||||
|
|
||||||
CHECK_SESSION && FAIL 1 'update currently in progress'
|
MAIN() {
|
||||||
|
CHECK_SESSION && FAIL 1 'update currently in progress'
|
||||||
|
|
||||||
tmux new -d -s $SESSION "echo 'updating all systems'; echo '(leave this window open)'; while true; do sleep 30; done"
|
tmux new -d -s $SESSION "echo 'updating all systems'; echo '(leave this window open)'; while true; do sleep 30; done"
|
||||||
|
|
||||||
yN 'after update, do you want to reboot all machines?' && REBOOT=1 || REBOOT=0
|
yN 'after update, do you want to reboot all machines?' && REBOOT=1 || REBOOT=0
|
||||||
REMINDER
|
REMINDER "
|
||||||
REMINDER 'manual action is required; (in another tab) connect to tmux:'
|
manual action is required; (in another tab) connect to tmux:
|
||||||
REMINDER "tmux a -t $SESSION"
|
tmux a -t $SESSION
|
||||||
REMINDER
|
|
||||||
REMINDER 'to stop the update at any time, run:'
|
|
||||||
REMINDER "tmux kill-session -t $SESSION"
|
|
||||||
REMINDER
|
|
||||||
|
|
||||||
[ $CURRENT_SESSION ] && {
|
to stop the update at any time, run:
|
||||||
SUCCESS 'currently in a tmux session; opening new window...'
|
tmux kill-session -t $SESSION
|
||||||
tmux new-window -t $CURRENT_SESSION "unset TMUX; tmux a -t $SESSION"
|
"
|
||||||
|
|
||||||
|
[ $CURRENT_SESSION ] && {
|
||||||
|
SUCCESS 'currently in a tmux session; opening new window...'
|
||||||
|
tmux new-window -t $CURRENT_SESSION "unset TMUX; tmux a -t $SESSION"
|
||||||
|
}
|
||||||
|
|
||||||
|
UPDATE_ALL 'yay -Syu'
|
||||||
|
UPDATE_ALL 'cd ~/.wryn; git pull --autostash'
|
||||||
|
UPDATE_ALL '~/.wryn/bin/scwrypts config update'
|
||||||
|
UPDATE_ALL '~/.wryn/bin/scwrypts media push'
|
||||||
|
UPDATE_ALL '~/.wryn/bin/scwrypts media pull'
|
||||||
|
UPDATE_ALL 'command -v i3-msg >/dev/null 2>&1 || exit 0; ~/.wryn/bin/scwrypts i3 font override'
|
||||||
|
|
||||||
|
[[ $REBOOT -eq 1 ]] && UPDATE_ALL 'reboot || sudo reboot'
|
||||||
|
|
||||||
|
tmux kill-session -t $SESSION >/dev/null 2>&1
|
||||||
|
CHECK_SESSION && WARNING "unable to close tmux session '$SESSION'"
|
||||||
|
|
||||||
|
SUCCESS " \nfinished system update accross all servers\n "
|
||||||
|
|
||||||
|
[[ $REBOOT -eq 1 ]] && { STATUS 'rebooting host machine'; sleep 3; reboot || sudo reboot; }
|
||||||
}
|
}
|
||||||
|
|
||||||
UPDATE_ALL 'yay -Syu'
|
|
||||||
UPDATE_ALL 'cd ~/.wryn; git pull --autostash'
|
|
||||||
UPDATE_ALL '~/.wryn/bin/scwrypts config update'
|
|
||||||
UPDATE_ALL '~/.wryn/bin/scwrypts media push'
|
|
||||||
UPDATE_ALL '~/.wryn/bin/scwrypts media pull'
|
|
||||||
UPDATE_ALL 'command -v i3-msg >/dev/null 2>&1 || exit 0; ~/.wryn/bin/scwrypts i3 font override'
|
|
||||||
|
|
||||||
[[ $REBOOT -eq 1 ]] && UPDATE_ALL 'reboot || sudo reboot'
|
|
||||||
|
|
||||||
tmux kill-session -t $SESSION >/dev/null 2>&1
|
|
||||||
CHECK_SESSION && WARNING "unable to close tmux session '$SESSION'"
|
|
||||||
|
|
||||||
SUCCESS
|
|
||||||
SUCCESS 'finished system update accross all servers'
|
|
||||||
SUCCESS
|
|
||||||
|
|
||||||
[[ $REBOOT -eq 1 ]] && { STATUS 'rebooting host machine'; sleep 3; reboot || sudo reboot; }
|
|
||||||
|
@ -1,13 +1,6 @@
|
|||||||
#!/bin/zsh
|
#!/bin/zsh
|
||||||
#####################################################################
|
|
||||||
|
|
||||||
DEPENDENCIES+=()
|
|
||||||
REQUIRED_ENV+=()
|
|
||||||
|
|
||||||
use ssh --group remote
|
use ssh --group remote
|
||||||
|
|
||||||
CHECK_ENVIRONMENT
|
CHECK_ENVIRONMENT
|
||||||
|
|
||||||
#####################################################################
|
|
||||||
|
|
||||||
REMOTE__LOGIN $@
|
REMOTE__LOGIN $@
|
||||||
|
@ -1,13 +1,6 @@
|
|||||||
#!/bin/zsh
|
#!/bin/zsh
|
||||||
#####################################################################
|
|
||||||
|
|
||||||
DEPENDENCIES+=()
|
|
||||||
REQUIRED_ENV+=()
|
|
||||||
|
|
||||||
use tmux --group remote
|
use tmux --group remote
|
||||||
|
|
||||||
CHECK_ENVIRONMENT
|
CHECK_ENVIRONMENT
|
||||||
|
|
||||||
#####################################################################
|
|
||||||
|
|
||||||
REMOTE_CONNECT_TMUX $@
|
REMOTE_CONNECT_TMUX $@
|
||||||
|
@ -1,13 +1,6 @@
|
|||||||
#!/bin/zsh
|
#!/bin/zsh
|
||||||
#####################################################################
|
|
||||||
|
|
||||||
DEPENDENCIES+=()
|
|
||||||
REQUIRED_ENV+=()
|
|
||||||
|
|
||||||
use ssh --group remote
|
use ssh --group remote
|
||||||
|
|
||||||
CHECK_ENVIRONMENT
|
CHECK_ENVIRONMENT
|
||||||
|
|
||||||
#####################################################################
|
|
||||||
|
|
||||||
REMOTE_ARGS=(-Y) REMOTE__LOGIN $@
|
REMOTE_ARGS=(-Y) REMOTE__LOGIN $@
|
||||||
|
@ -1,13 +1,9 @@
|
|||||||
#!/bin/zsh
|
#!/bin/zsh
|
||||||
|
|
||||||
#####################################################################
|
|
||||||
|
|
||||||
DEPENDENCIES+=(
|
DEPENDENCIES+=(
|
||||||
tmux
|
tmux
|
||||||
hostnamectl
|
hostnamectl
|
||||||
scwrypts # must be on path
|
scwrypts # must be on path
|
||||||
)
|
)
|
||||||
REQUIRED_ENV+=()
|
|
||||||
|
|
||||||
CHECK_ENVIRONMENT
|
CHECK_ENVIRONMENT
|
||||||
|
|
||||||
|
@ -1,12 +1,5 @@
|
|||||||
#!/bin/zsh
|
#!/bin/zsh
|
||||||
|
|
||||||
#####################################################################
|
|
||||||
|
|
||||||
DEPENDENCIES+=()
|
|
||||||
REQUIRED_ENV+=()
|
|
||||||
|
|
||||||
CHECK_ENVIRONMENT
|
CHECK_ENVIRONMENT
|
||||||
|
|
||||||
#####################################################################
|
#####################################################################
|
||||||
|
|
||||||
[[ $TERM =~ tmux ]] && FAIL 69 "\n Cannot run tmux-omni within a tmux session!\n "
|
[[ $TERM =~ tmux ]] && FAIL 69 "\n Cannot run tmux-omni within a tmux session!\n "
|
||||||
|
Loading…
Reference in New Issue
Block a user