forked from extern/nix-config
sxhkd: Don't hardcode top_padding for polybar
Since launch.sh calculates all the bar values for us (as well as bspwm settings), we can simply store the top_padding value in the user's cache directory, then reference that number within sxhkd. This way, if the top_padding value is changed through launch.sh, editing sxhkdrc manually isn't needed, and the config file doesn't need to be reloaded.
This commit is contained in:
parent
14fa7d6c52
commit
59dc5d1b3a
@ -43,6 +43,9 @@ offset-y = ${POLYBAR_OFFSET_XY:-0}
|
||||
border-size = ${POLYBAR_BORDER_SIZE:-0}
|
||||
EOL
|
||||
|
||||
# Save the top_padding amount for use by other scripts
|
||||
echo $BSPWM_TOP_PADDING > $HOME/.cache/polybar/bspwm_top_padding
|
||||
|
||||
# Wait until there are no more polybar instances running
|
||||
while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done
|
||||
|
||||
|
@ -21,7 +21,7 @@ super + {_,shift} + backslash
|
||||
super + o
|
||||
(xdotool search --class --onlyvisible "Polybar" && \
|
||||
(xdo hide -N "Polybar" && bspc config top_padding 0)) || \
|
||||
(xdo show -N "Polybar" && bspc config top_padding 80)
|
||||
(xdo show -N "Polybar" && bspc config top_padding $(cat ~/.cache/polybar/bspwm_top_padding))
|
||||
|
||||
# Change the wal color scheme
|
||||
alt + m
|
||||
|
Loading…
Reference in New Issue
Block a user