bar on startup detect padding stuff

This commit is contained in:
Daniel Flanagan 2016-11-28 14:02:46 -06:00
parent 24eb6c3e77
commit 01d1eb8d24
5 changed files with 23 additions and 2 deletions

13
env/wm/bspwm_config vendored
View file

@ -20,6 +20,19 @@ bspc config gapless_monocle true
bspc config window_gap "$WINDOW_GAP" bspc config window_gap "$WINDOW_GAP"
if [ "$BAR_ON_XINIT" -eq 1 ]; then
if [ -z "$BAR_MONITOR" -o "$BAR_MONITOR" -eq 0 ]; then
source "$DOTFILES_PATH/scripts/monitors.sh"
BAR_MONITOR="$LAST_BSPWM_MONITOR"
fi
if [ $BAR_TOP -eq 1 ]; then
bspc config -m ${BAR_MONITOR} top_padding "$BAR_HEIGHT"
else
bspc config -m ${BAR_MONITOR} bottom_padding "$BAR_HEIGHT"
fi
fi
echo "${BSPWM_MONITORS}" echo "${BSPWM_MONITORS}"
BSPWM_MONITORS=$(bspc query -M | tac) BSPWM_MONITORS=$(bspc query -M | tac)

1
env/wm/bspwmrc vendored
View file

@ -10,4 +10,3 @@ bspc wm -o
urxvtd & urxvtd &
sxhkd & sxhkd &

View file

@ -29,6 +29,11 @@ trap killbar INT TERM QUIT EXIT
rm -f "$BAR_FIFO" rm -f "$BAR_FIFO"
mkfifo "$BAR_FIFO" mkfifo "$BAR_FIFO"
if [ -z "$BAR_MONITOR" -o "$BAR_MONITOR" -eq 0 ]; then
source "$DOTFILES_PATH/scripts/monitors.sh"
BAR_MONITOR="$LAST_BSPWM_MONITOR"
fi
if [ $BAR_TOP -eq 1 ]; then if [ $BAR_TOP -eq 1 ]; then
bspc config -m ${BAR_MONITOR} top_padding "$BAR_HEIGHT" bspc config -m ${BAR_MONITOR} top_padding "$BAR_HEIGHT"
else else

4
scripts/monitors.sh Normal file
View file

@ -0,0 +1,4 @@
#!/usr/bin/env sh
export LAST_BSPWM_MONITOR=$(bspc query -M | tail -n 1)
export FIRST_BSPWM_MONITOR=$(bspc query -M | head -n 1)

View file

@ -16,7 +16,7 @@ export BAR_PATH="$DOTFILES_PATH/env/wm/extras/bar"
export BAR_PID_FILE="$BAR_PATH/wm_bar.pid" export BAR_PID_FILE="$BAR_PATH/wm_bar.pid"
export BAR_ON_XINIT=1 export BAR_ON_XINIT=1
export BAR_FIFO="$BAR_PATH/wm_bar_fifo.lock" export BAR_FIFO="$BAR_PATH/wm_bar_fifo.lock"
export BAR_MONITOR=$(bspc query -M | tail -n 1) export BAR_MONITOR=0 # detect monitor automatically
export BAR_LOG="$BAR_PATH/wm_bar.log" export BAR_LOG="$BAR_PATH/wm_bar.log"
export BAR_TOP=0 export BAR_TOP=0
export BAR_HEIGHT=30 export BAR_HEIGHT=30