sway: update some things

This commit is contained in:
Konstantin Koslowski 2023-12-20 07:58:49 +01:00
parent 5c1bfb269d
commit dc5511aae9
7 changed files with 36 additions and 18 deletions

View file

@ -3,30 +3,38 @@ source $HOME/.config/sway/bin/sway_helpers
DEVICE=sysfs/backlight/intel_backlight
NOTIFY_APP="dunstify -a brightness -h string:x-dunst-stack-tag:brightness"
ICON=$HOME/.local/share/icons/Tela-circle-dark/16/panel/xfpm-brightness-lcd.svg
APP="/usr/bin/light -s $DEVICE"
APP="/usr/bin/brightnessctl"
APP_INC="$APP s 10%+"
APP_DEC="$APP s 10%-"
PRG1="●"
PRG2="◌"
function _get_br() {
$APP | grep -oE '[0-9]*%' | sed 's/%//g'
}
## main
_log BRIGHTNESS INFO args: $*
_check_app $APP
case $1 in
d*)
$APP -U 10
BR=$($APP)
$APP_DEC &> /dev/null
BR=$(_get_br)
echo $BR
$NOTIFY_APP -i $ICON "$BR" "$(getProgressString 10 "$PRG1" "$PRG2" $BR)"
;;
i*)
$APP -A 10
BR=$($APP)
$APP_INC &> /dev/null
BR=$(_get_br)
echo $BR
$NOTIFY_APP -i $ICON "$BR" "$(getProgressString 10 "$PRG1" "$PRG2" $BR)"
;;
"-h"|"--help")
echo "arguments: [decrease|increase]"
;;
*)
BR=$($APP)
BR=$($APP_BR)
$NOTIFY_APP -i $ICON "$BR" "$(getProgressString 10 "$PRG1" "$PRG2" $BR)"
;;
esac