diff options
Diffstat (limited to 'dwm/.dwm/bar')
-rwxr-xr-x | dwm/.dwm/bar/bar.sh | 15 | ||||
-rwxr-xr-x | dwm/.dwm/bar/themes/dracula | 1 |
2 files changed, 12 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() { diff --git a/dwm/.dwm/bar/themes/dracula b/dwm/.dwm/bar/themes/dracula index ea2b4f4..6f7a699 100755 --- a/dwm/.dwm/bar/themes/dracula +++ b/dwm/.dwm/bar/themes/dracula @@ -9,3 +9,4 @@ grey=#282a36 blue=#d6acff red=#ff5555 darkblue=#bd93f9 +yellow=#f1fa8c |