diff --git a/env/sh/bashrc b/env/sh/bashrc index 647c59a..2919efb 100644 --- a/env/sh/bashrc +++ b/env/sh/bashrc @@ -84,10 +84,25 @@ if [ -t 0 ]; then if [[ -f "$BAR_PID_FILE" ]]; then stopbar fi - "$BAR_PATH/start.bash" - echo $! > "$BAR_PID_FILE" - bg - disown + "$BAR_PATH/start.bash" & + BAR_PID=$! + echo "$BAR_PID" > "$BAR_PID_FILE" + kill -CONT "$BAR_PID" + # bg + # disown + + # lower the bar's layer so fullscreen windows cover it + wid=$(xdo id -a "$BAR_WID") + tries=20 + while [ -z "$wid" -a "$tries" -gt 0 ]; do + sleep 0.1 + wid=$(xdo id -a "$BAR_WID") + tries=$((tries - 1)) + echo "WID $wid" + done + [ -n "$wid" ] && xdo above -t "$(xdo id -N Bspwm -n root | sort | head -n 1)" "$wid" + + fg } export -f startbar diff --git a/env/wm/bspwm_config b/env/wm/bspwm_config index eb4c445..c4671ea 100755 --- a/env/wm/bspwm_config +++ b/env/wm/bspwm_config @@ -23,7 +23,7 @@ bspc config window_gap "$WINDOW_GAP" MONITOR_COUNT=$(bspc query -M | wc -l | awk '{ printf $1 }') PER_MONITOR=$((10 / MONITOR_COUNT)) i=1 -for mon in $(bspc query -M); do +for mon in ${BSPWM_MONITORS}; do echo $mon echo $i max=$((i + PER_MONITOR - 1)) diff --git a/env/wm/extras/bar/start.bash b/env/wm/extras/bar/start.bash index 0e368af..140d11e 100755 --- a/env/wm/extras/bar/start.bash +++ b/env/wm/extras/bar/start.bash @@ -10,9 +10,9 @@ export BAR_RUNNING=1 function killbar() { export BAR_RUNNING=0 if [ $BAR_TOP -eq 1 ]; then - bspc config -m $(bspc query -M | head -n 1) top_padding "0" + bspc config -m ${BAR_MONITOR} top_padding "0" else - bspc config -m $(bspc query -M | head -n 1) bottom_padding "0" + bspc config -m ${BAR_MONITOR} bottom_padding "0" fi for f in $(ls "$BAR_PATH"/modules/*.pid 2>/dev/null); do # echo "KILLING MODULE PROCESS $f WITH PID $(cat "$f")" @@ -30,9 +30,9 @@ rm -f "$BAR_FIFO" mkfifo "$BAR_FIFO" if [ $BAR_TOP -eq 1 ]; then - bspc config -m $(bspc query -M | head -n 1) top_padding "$BAR_HEIGHT" + bspc config -m ${BAR_MONITOR} top_padding "$BAR_HEIGHT" else - bspc config -m $(bspc query -M | head -n 1) bottom_padding "$BAR_HEIGHT" + bspc config -m ${BAR_MONITOR} bottom_padding "$BAR_HEIGHT" fi # get width of our main monitor @@ -52,4 +52,4 @@ source "$BAR_PATH/colors.bash" cat "$BAR_FIFO" | "$BAR_PATH/formatter.bash" | \ lemonbar -a 14 $BAR_B -g "$WIDTH"x"$BAR_HEIGHT"+"$OFFSET"+"$POS_Y" -u "$BAR_BORDER_WIDTH" -f "$BAR_FONT_FAMILY" -F "$COLOR_FOREGROUND" -B"$COLOR_BACKGROUND" -n "$BAR_WID" | \ "$BAR_PATH/bar_commands.bash" - + diff --git a/env/x/xinitrc b/env/x/xinitrc index 13c2a91..12d2be9 100644 --- a/env/x/xinitrc +++ b/env/x/xinitrc @@ -24,14 +24,16 @@ if [ -d "/usr/lib/nvidia" ]; then export LD_LIBRARY_PATH=/usr/lib/nvidia fi -# fire up wm -unclutter & -sxhkd & -urxvtd & +export BSPWM_MONITORS=$(bspc query -M) if [ -f "$HOME/.xinitrc.env" ]; then source "$HOME/.xinitrc.env" fi +# fire up wm +unclutter & +sxhkd & +urxvtd & + exec bspwm diff --git a/os/arch_linux/xorg.bash b/os/arch_linux/xorg.bash index 76d92da..64b1681 100755 --- a/os/arch_linux/xorg.bash +++ b/os/arch_linux/xorg.bash @@ -1,5 +1,5 @@ #!/usr/bin/env bash sudo pacman -S xorg-xinit xorg-server xorg-xrdb --noconfirm -pacaur -S unclutter-xfixes-git gtk-theme-arc gtk-engine-murrine --noconfirm --noedit +pacaur -S unclutter-xfixes-git gtk-theme-arc gtk-engine-murrine xorg-server-devel --noconfirm --noedit diff --git a/variables.bash b/variables.bash index 8400119..5fceef0 100755 --- a/variables.bash +++ b/variables.bash @@ -8,14 +8,15 @@ export BLACKLISTED_BAR_MODULES="" export REPOSITORY_PATH="$HOME/../code/open-source" export BORDER_WIDTH=1 export WINDOW_GAP=5 -export BAR_PATH="$DOTFILES_PATH/env/wm/extras/bar" -export BAR_PID_FILE="$BAR_PATH/wm_bar.pid" source "$DOTFILES_PATH/scripts/get_x_fonts.sh" source "$DOTFILES_PATH/scripts/get_color.sh" +export BAR_PATH="$DOTFILES_PATH/env/wm/extras/bar" +export BAR_PID_FILE="$BAR_PATH/wm_bar.pid" export BAR_ON_XINIT=0 export BAR_FIFO="$BAR_PATH/wm_bar_fifo.lock" +export BAR_MONITOR=$(bspc query -M | tail -n 1) export BAR_LOG="$BAR_PATH/wm_bar.log" export BAR_TOP=0 export BAR_HEIGHT=30