diff options
author | xyz <gky44px1999@gmail.com> | 2021-10-06 11:29:41 -0700 |
---|---|---|
committer | xyz <gky44px1999@gmail.com> | 2021-10-06 11:29:41 -0700 |
commit | 10597d35e5dd2b2e6f462406f72578d9f09c1ed8 (patch) | |
tree | 1ac44e7867da2a78f5da67bffac1672caf1c39d9 | |
parent | 18ab2192de9940bc057d69b527ba288e21b33b69 (diff) |
refactor
-rw-r--r-- | .config/sxhkd/sxhkdrc | 6 | ||||
-rwxr-xr-x | .local/bin/sbar | 17 |
2 files changed, 11 insertions, 12 deletions
diff --git a/.config/sxhkd/sxhkdrc b/.config/sxhkd/sxhkdrc index 005c0fb4..b9f3afc2 100644 --- a/.config/sxhkd/sxhkdrc +++ b/.config/sxhkd/sxhkdrc @@ -9,20 +9,20 @@ alt + shift + Print XF86Audio{RaiseVolume,LowerVolume,Mute} amixer set Master {5%+,5%-,toggle};\ - kill -RTMIN+1 "$(cat ~/.cache/pidofbar)" + kill -RTMIN+1 "$(cat "$XDG_CACHE_HOME/pidofbar")" # for pulseaudio, master volume affects capture volume too? # my laptop built-in microphone capture volume is really low # so I want to keep capture volume always 100% alt + XF86AudioMute amixer set Capture toggle;\ - kill -RTMIN "$(cat ~/.cache/pidofbar)" + kill -RTMIN "$(cat "$XDG_CACHE_HOME/pidofbar")" XF86Audio{Prev,Play,Next} playerctl {previous,play-pause,next} @Caps_Lock - kill -RTMIN+3 "$(cat ~/.cache/pidofbar)" + kill -RTMIN+3 "$(cat "$XDG_CACHE_HOME/pidofbar")" alt + y mpvy -s diff --git a/.local/bin/sbar b/.local/bin/sbar index feadd805..70191372 100755 --- a/.local/bin/sbar +++ b/.local/bin/sbar @@ -3,7 +3,7 @@ # modified to fit my own need # INIT -printf '%s' "$$" > ~/.cache/pidofbar +printf '%s' "$$" > "$XDG_CACHE_HOME/pidofbar" sec=0 # MODULES @@ -48,18 +48,17 @@ display () { } # SIGNALLING -# trap "<function>;display" "RTMIN+n" -trap "update_mic;display" "RTMIN" -trap "update_vol;display" "RTMIN+1" +# trap "<function>;display" "RTMIN+n" +trap "update_mic;display" "RTMIN" +trap "update_vol;display" "RTMIN+1" # xev can't read my toggle internet keyboard key, don't know what key to use in sxhkd to send signal -trap "update_net;display" "RTMIN+2" -trap "update_cap;display" "RTMIN+3" +trap "update_net;display" "RTMIN+2" +trap "update_cap;display" "RTMIN+3" # to update it from external commands -## kill -m "$(cat ~/.cache/pidofbar)" +## kill -m "$(cat "$XDG_CACHE_HOME/pidofbar")" # where m = 34 + n -while true -do +while true; do # next line of code seems make hotkeys that send kill signals more responsive? not fully understood sleep 1 & wait && { # to update item ever n seconds with a offset of m |