diff options
Diffstat (limited to 'dwm/.dwm/bar/bar.sh')
-rwxr-xr-x | dwm/.dwm/bar/bar.sh | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/dwm/.dwm/bar/bar.sh b/dwm/.dwm/bar/bar.sh index 796453c..65eb35e 100755 --- a/dwm/.dwm/bar/bar.sh +++ b/dwm/.dwm/bar/bar.sh @@ -44,8 +44,8 @@ battery() { } brightness() { - brightness="$(cat /sys/class/backlight/intel_backlight/brightness)" - brightness_max="$(cat /sys/class/backlight/intel_backlight/max_brightness)" + brightness="$(cat /sys/class/backlight/*/brightness)" + brightness_max="$(cat /sys/class/backlight/*/max_brightness)" level=$(echo "scale=2; $brightness / $brightness_max * 100" | bc) printf "^c$red^ " @@ -70,8 +70,15 @@ clock() { } volume() { - volume_status="$(pamixer --get-volume-human)" - printf "^c$blue^ 🔊 $volume_status" + pactl_output="$(pactl list sinks )" + is_mute="$(echo "$pactl_output" | grep Mute | grep -oE "yes|no")" + if [ $is_mute = "yes" ] + then + printf "^c$red^ 🔇 mute" + else + volume_status="$(echo "$pactl_output" | grep olume | grep -oE "\w+%" | head -n 1)" + printf "^c$yellow^ 🔊 %s" $volume_status + fi } keyboard() { |