From: Amin Bandali Date: Tue, 24 Jul 2018 21:13:58 +0000 (-0400) Subject: [rc] add volume-info script for displaying volume in bar X-Git-Url: https://git.shemshak.org/~bandali/configs/commitdiff_plain/4fc8d5d2da39a88c8ccf84cc80b506f37a890e1b?ds=sidebyside [rc] add volume-info script for displaying volume in bar --- 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.