From 129cfe34b27975a4d7b711a74c08b28f77b8083c Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Fri, 4 Aug 2023 22:22:54 +0300 Subject: [PATCH] add audio --- config/dwm/scripts/bar.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/config/dwm/scripts/bar.sh b/config/dwm/scripts/bar.sh index b3ed6bc6..c077a322 100755 --- a/config/dwm/scripts/bar.sh +++ b/config/dwm/scripts/bar.sh @@ -29,6 +29,15 @@ battery() { #printf "^c$blue^  $get_capacity" } +audio() { + get_vol=$(pamixer --get-volume-human) + if (get_vol == "muted") then + printf "^c$blue^ 󰝟^" + else + printf "^c$blue^ 󰕾 $get_vol" + fi +} + brightness() { printf "^c$red^  " printf "^c$red^%.0f\n" $(cat /sys/class/backlight/*/brightness) @@ -56,5 +65,5 @@ while true; do [ $interval = 0 ] || [ $(($interval % 3600)) = 0 ] interval=$((interval + 1)) - sleep 1 && xsetroot -name "$(battery) $(brightness) $(cpu) $(mem) $(clock)" + sleep 1 && xsetroot -name "$(audio) $(battery) $(brightness) $(cpu) $(mem) $(clock)" done