From 4fc8d5d2da39a88c8ccf84cc80b506f37a890e1b Mon Sep 17 00:00:00 2001 From: Amin Bandali Date: Tue, 24 Jul 2018 17:13:58 -0400 Subject: [rc] add volume-info script for displaying volume in bar --- rc.org | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/rc.org b/rc.org index de4435a..e787d8b 100644 --- a/rc.org +++ b/rc.org @@ -772,6 +772,11 @@ borders_color=#3D9970 #title= #borders_color=#01FF70 +[volume] +command=volume-info +title= +borders_color=#7FDBFF + [battery] preset=BAT command=battery-percentage-time @@ -5039,6 +5044,21 @@ import gnomekeyring as gk gk.unlock_sync('Default_keyring',gk.item_get_info_sync('login',1L).get_secret()) #+end_src +** volume-info +:PROPERTIES: +:header-args+: :tangle ~/.local/bin/volume-info :shebang "#!/bin/sh" +:END: + +#+begin_src sh +cur_vol=$(pamixer --get-volume) + +if [ $(pamixer --get-mute) = true ]; then + printf 'mt \n' "$cur_vol" +else + printf '%02d \n' "$cur_vol" +fi +#+end_src + ** wp My little wallpaper changer script. -- cgit v1.2.3-60-g2f50