bar layer control, env bspwm monitor control wip
This commit is contained in:
parent
f83ceebcf6
commit
f6c4b2c4d4
23
env/sh/bashrc
vendored
23
env/sh/bashrc
vendored
|
@ -84,10 +84,25 @@ if [ -t 0 ]; then
|
||||||
if [[ -f "$BAR_PID_FILE" ]]; then
|
if [[ -f "$BAR_PID_FILE" ]]; then
|
||||||
stopbar
|
stopbar
|
||||||
fi
|
fi
|
||||||
"$BAR_PATH/start.bash"
|
"$BAR_PATH/start.bash" &
|
||||||
echo $! > "$BAR_PID_FILE"
|
BAR_PID=$!
|
||||||
bg
|
echo "$BAR_PID" > "$BAR_PID_FILE"
|
||||||
disown
|
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
|
export -f startbar
|
||||||
|
|
||||||
|
|
2
env/wm/bspwm_config
vendored
2
env/wm/bspwm_config
vendored
|
@ -23,7 +23,7 @@ bspc config window_gap "$WINDOW_GAP"
|
||||||
MONITOR_COUNT=$(bspc query -M | wc -l | awk '{ printf $1 }')
|
MONITOR_COUNT=$(bspc query -M | wc -l | awk '{ printf $1 }')
|
||||||
PER_MONITOR=$((10 / MONITOR_COUNT))
|
PER_MONITOR=$((10 / MONITOR_COUNT))
|
||||||
i=1
|
i=1
|
||||||
for mon in $(bspc query -M); do
|
for mon in ${BSPWM_MONITORS}; do
|
||||||
echo $mon
|
echo $mon
|
||||||
echo $i
|
echo $i
|
||||||
max=$((i + PER_MONITOR - 1))
|
max=$((i + PER_MONITOR - 1))
|
||||||
|
|
8
env/wm/extras/bar/start.bash
vendored
8
env/wm/extras/bar/start.bash
vendored
|
@ -10,9 +10,9 @@ export BAR_RUNNING=1
|
||||||
function killbar() {
|
function killbar() {
|
||||||
export BAR_RUNNING=0
|
export BAR_RUNNING=0
|
||||||
if [ $BAR_TOP -eq 1 ]; then
|
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
|
else
|
||||||
bspc config -m $(bspc query -M | head -n 1) bottom_padding "0"
|
bspc config -m ${BAR_MONITOR} bottom_padding "0"
|
||||||
fi
|
fi
|
||||||
for f in $(ls "$BAR_PATH"/modules/*.pid 2>/dev/null); do
|
for f in $(ls "$BAR_PATH"/modules/*.pid 2>/dev/null); do
|
||||||
# echo "KILLING MODULE PROCESS $f WITH PID $(cat "$f")"
|
# echo "KILLING MODULE PROCESS $f WITH PID $(cat "$f")"
|
||||||
|
@ -30,9 +30,9 @@ rm -f "$BAR_FIFO"
|
||||||
mkfifo "$BAR_FIFO"
|
mkfifo "$BAR_FIFO"
|
||||||
|
|
||||||
if [ $BAR_TOP -eq 1 ]; then
|
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
|
else
|
||||||
bspc config -m $(bspc query -M | head -n 1) bottom_padding "$BAR_HEIGHT"
|
bspc config -m ${BAR_MONITOR} bottom_padding "$BAR_HEIGHT"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# get width of our main monitor
|
# get width of our main monitor
|
||||||
|
|
10
env/x/xinitrc
vendored
10
env/x/xinitrc
vendored
|
@ -24,14 +24,16 @@ if [ -d "/usr/lib/nvidia" ]; then
|
||||||
export LD_LIBRARY_PATH=/usr/lib/nvidia
|
export LD_LIBRARY_PATH=/usr/lib/nvidia
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# fire up wm
|
export BSPWM_MONITORS=$(bspc query -M)
|
||||||
unclutter &
|
|
||||||
sxhkd &
|
|
||||||
urxvtd &
|
|
||||||
|
|
||||||
if [ -f "$HOME/.xinitrc.env" ]; then
|
if [ -f "$HOME/.xinitrc.env" ]; then
|
||||||
source "$HOME/.xinitrc.env"
|
source "$HOME/.xinitrc.env"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# fire up wm
|
||||||
|
unclutter &
|
||||||
|
sxhkd &
|
||||||
|
urxvtd &
|
||||||
|
|
||||||
exec bspwm
|
exec bspwm
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
sudo pacman -S xorg-xinit xorg-server xorg-xrdb --noconfirm
|
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
|
||||||
|
|
||||||
|
|
|
@ -8,14 +8,15 @@ export BLACKLISTED_BAR_MODULES=""
|
||||||
export REPOSITORY_PATH="$HOME/../code/open-source"
|
export REPOSITORY_PATH="$HOME/../code/open-source"
|
||||||
export BORDER_WIDTH=1
|
export BORDER_WIDTH=1
|
||||||
export WINDOW_GAP=5
|
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_x_fonts.sh"
|
||||||
source "$DOTFILES_PATH/scripts/get_color.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_ON_XINIT=0
|
||||||
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_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
|
||||||
|
|
Reference in a new issue