mirror of
https://github.com/Keyitdev/dotfiles.git
synced 2026-09-24 01:52:09 +00:00
18 lines
786 B
Bash
Executable File
18 lines
786 B
Bash
Executable File
#!/bin/sh
|
|
|
|
dir_icons="/usr/local/bin/icons"
|
|
vol_quiet=33
|
|
vol_loud=66
|
|
|
|
cur_vol_left=$(pactl get-sink-volume @DEFAULT_SINK@ | grep -o '[0-9]\+%' | sed -n '1p'| sed 's/%//g')
|
|
cur_vol_right=$(pactl get-sink-volume @DEFAULT_SINK@ | grep -o '[0-9]\+%' | sed -n '2p' | sed 's/%//g')
|
|
cur_vol_average=$(((cur_vol_left+cur_vol_right)/2))
|
|
|
|
if [ "$cur_vol_average" -le "$vol_quiet" ]; then
|
|
dunstify "Speakers" "Volume: $cur_vol_average%" -r 100 -i "$dir_icons"/volume.svg
|
|
elif [ "$cur_vol_average" -gt "$vol_quiet" ] && [ "$cur_vol_average" -le "$vol_loud" ]; then
|
|
dunstify "Speakers" "Volume: $cur_vol_average%" -r 100 -i "$dir_icons"/volume-1.svg
|
|
elif [ "$cur_vol_average" -gt "$vol_loud" ]; then
|
|
dunstify "Speakers" "Volume: $cur_vol_average%" -r 100 -i "$dir_icons"/volume-2.svg
|
|
fi
|