scripts: Remove bar animations from vol/brightness
Removed the ascii-art bar animations calculated for e.g. dunst notifications for the controls of brightness and volume. The dunst notifications finally have a working bar slider built into them when invoked with the correct stack option.
This commit is contained in:
parent
0b2c6c9b4b
commit
226c4b5f0d
2 changed files with 78 additions and 84 deletions
|
@ -21,17 +21,13 @@ get_brightness() {
|
|||
send_notification() {
|
||||
icon="preferences-system-brightness-lock"
|
||||
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 "─" $((brightness / 5)) | sed 's/[0-9]//g')
|
||||
if type dunstify 1>/dev/null 2>/dev/null; then
|
||||
notcmd="dunstify -h string:x-dunst-stack-tag:brightness"
|
||||
else
|
||||
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"
|
||||
-h int:value:"$brightness" "Brightness: $brightness%"
|
||||
}
|
||||
|
||||
case $direction in
|
||||
|
|
|
@ -59,7 +59,6 @@ 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
|
||||
|
@ -67,8 +66,7 @@ send_notification() {
|
|||
else
|
||||
# Show the volume notification
|
||||
$notcmd -a "changeVolume" -u low -i audio-volume-high \
|
||||
-h int:value:"$vol" "Volume: $vol%
|
||||
$bar"
|
||||
-h int:value:"$vol" "Volume: $vol%"
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue