diff --git a/scripts/.local/bin/control-brightness b/scripts/.local/bin/control-brightness index afcf83d..003218c 100755 --- a/scripts/.local/bin/control-brightness +++ b/scripts/.local/bin/control-brightness @@ -23,13 +23,15 @@ send_notification() { brightness=$(get_brightness) # Make the bar with the special character ─ (it's not dash -) # https://en.wikipedia.org/wiki/Box-drawing_character - bar=$(seq -s "─" 0 $((brightness / 5)) | sed 's/[0-9]//g' | - sed -e 's/^─/┠/' -e 's/^\(.\{20\}\)/\1┫/') + bar=$(seq -s "─" $((brightness / 5)) | sed 's/[0-9]//g') if type dunstify 1>/dev/null 2>/dev/null; then - dunstify -i "$icon" -u normal " $bar" -a "xbacklight" -h string:x-dunst-stack-tag:brightness + notcmd="dunstify -h string:x-dunst-stack-tag:brightness" else - notify-send -i "$icon" -u normal " $bar" -a "xbacklight" -h string:x-dunst-stack-tag:brightness + notcmd="notify-send -h string:x-dunst-stack-tag:brightness" fi + $notcmd -a "changeVolume" -u low -i "$icon" \ + -h int:value:"$brightness" "Brightness: $brightness% +$bar" } case $direction in diff --git a/scripts/.local/bin/control-volume b/scripts/.local/bin/control-volume index 571c45f..da10538 100755 --- a/scripts/.local/bin/control-volume +++ b/scripts/.local/bin/control-volume @@ -54,13 +54,16 @@ send_notification() { fi vol="$(get_volume)" + bar=$(seq -s "─" $((vol / 5)) | sed 's/[0-9]//g') + if [ "$vol" -eq 0 ] || [ "$(get_mute)" = "off" ]; then # Show the sound muted notification $notcmd -a "changeVolume" -u low -i audio-volume-muted "Volume muted" else # Show the volume notification $notcmd -a "changeVolume" -u low -i audio-volume-high \ - -h int:value:"$vol" "Volume: $vol%" + -h int:value:"$vol" "Volume: $vol% +$bar" fi }