bin: move function from volume to helpers, add notifications to brightness
This commit is contained in:
parent
b95cfc47a4
commit
8708e3f6f5
3 changed files with 33 additions and 21 deletions
|
@ -1,7 +1,11 @@
|
|||
#!/bin/bash
|
||||
source $HOME/.config/sway/bin/sway_helpers
|
||||
DEVICE=sysfs/backlight/intel_backlight
|
||||
APP=light
|
||||
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"
|
||||
PRG1="●"
|
||||
PRG2="◌"
|
||||
|
||||
## main
|
||||
_log BRIGHTNESS INFO args: $*
|
||||
|
@ -9,13 +13,20 @@ _check_app $APP
|
|||
|
||||
case $1 in
|
||||
d*)
|
||||
light -s $DEVICE -U 10
|
||||
$APP -U 10
|
||||
BR=$($APP)
|
||||
$NOTIFY_APP -i $ICON "$BR" "$(getProgressString 10 "$PRG1" "$PRG2" $BR)"
|
||||
;;
|
||||
i*)
|
||||
light -s $DEVICE -A 10
|
||||
$APP -A 10
|
||||
BR=$($APP)
|
||||
$NOTIFY_APP -i $ICON "$BR" "$(getProgressString 10 "$PRG1" "$PRG2" $BR)"
|
||||
;;
|
||||
*)
|
||||
echo "invalid argument: \"$1\""
|
||||
"-h"|"--help")
|
||||
echo "arguments: [decrease|increase]"
|
||||
;;
|
||||
*)
|
||||
BR=$($APP)
|
||||
$NOTIFY_APP -i $ICON "$BR" "$(getProgressString 10 "$PRG1" "$PRG2" $BR)"
|
||||
;;
|
||||
esac
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue