From 5c899f1fe5ad5b0197cc4fd9cd7f5c6139eff122 Mon Sep 17 00:00:00 2001 From: Amin Bandali Date: Sat, 28 Feb 2015 16:34:05 -0500 Subject: [PATCH] always-up-to-date volume/icon in panel --- bspwm/.local/bin/spk-icon | 5 +++++ conky/.conkyrc | 2 +- sxhkd/.config/sxhkd/sxhkdrc | 13 +++---------- 3 files changed, 9 insertions(+), 11 deletions(-) create mode 100755 bspwm/.local/bin/spk-icon diff --git a/bspwm/.local/bin/spk-icon b/bspwm/.local/bin/spk-icon new file mode 100755 index 0000000..216fbf4 --- /dev/null +++ b/bspwm/.local/bin/spk-icon @@ -0,0 +1,5 @@ +if $(pamixer --get-mute) ; then +echo ⮝ +else +echo ⮟ +fi diff --git a/conky/.conkyrc b/conky/.conkyrc index 495f68b..d4f47ee 100644 --- a/conky/.conkyrc +++ b/conky/.conkyrc @@ -6,4 +6,4 @@ total_run_times 0 use_spacer none TEXT -S %{F\#ffcf0f38}⮠ %{F\#fffefdfb}${wireless_essid wlp3s0} %{F\#ffcf0f38}${exec cat /tmp/spkicon} %{F\#fffefdfb}${exec cat /tmp/volinfo}%% %{F\#ffcf0f38}⮏ %{F\#fffefdfb}${execi 30 cat /sys/class/power_supply/BAT0/capacity}%% (${execi 30 acpi | grep '[0-9]\{2\}:[0-9]\{2\}' -o}) %{F\#ffcf0f38}⮖ %{F\#fffefdfb}${time %H:%M} +S %{F\#ffcf0f38}⮠ %{F\#fffefdfb}${wireless_essid wlp3s0} %{F\#ffcf0f38}${exec ~/.local/bin/spk-icon} %{F\#fffefdfb}${exec pamixer --get-volume}%% %{F\#ffcf0f38}⮏ %{F\#fffefdfb}${execi 30 cat /sys/class/power_supply/BAT0/capacity}%% (${execi 30 acpi | grep '[0-9]\{2\}:[0-9]\{2\}' -o}) %{F\#ffcf0f38}⮖ %{F\#fffefdfb}${time %H:%M} diff --git a/sxhkd/.config/sxhkd/sxhkdrc b/sxhkd/.config/sxhkd/sxhkdrc index a1a9795..c8ded7b 100644 --- a/sxhkd/.config/sxhkd/sxhkdrc +++ b/sxhkd/.config/sxhkd/sxhkdrc @@ -124,17 +124,10 @@ XF86AudioNext mpc next XF86AudioRaiseVolume - pamixer --allow-boost --increase 5;\ - pamixer --get-volume > /tmp/volinfo + pamixer --allow-boost --increase 5 XF86AudioLowerVolume - pamixer --allow-boost --decrease 5;\ - pamixer --get-volume > /tmp/volinfo + pamixer --allow-boost --decrease 5 XF86AudioMute - pamixer --toggle-mute;\ - if $(pamixer --get-mute) ; then;\ - echo ⮝ > /tmp/spkicon;\ - else;\ - echo ⮟ > /tmp/spkicon;\ - fi + pamixer --toggle-mute -- 2.20.1