bspwm: Add adaptive workspace splitting

This commit is contained in:
Salt 2018-02-12 19:34:20 -06:00
parent f2ab1fb92e
commit 5ae3562a40

View File

@ -26,19 +26,24 @@ if [[ "$PATH" != "*$HOME/.local/bin" ]]; then
fi fi
## bspwm GENERAL CONFIGURATION ## bspwm GENERAL CONFIGURATION
hostname=$(hostname) monitors=$(bspc query -M | wc -l)
hosts_single=(iridium) desktops=8
for host in $hosts_single; do deskpermon=$(expr $desktops / $monitors)
if [ $hostname = $host ]; then i = 1
bspc monitor -d 1 2 3 4 5 6 7 8 for monitor in $(bspc query -M); do
fi layout="$layout $i"
i=$(expr $i + 1)
until [[ "$(expr $i % $deskpermon)" == *"0"* ]]; do
layout="$layout $i"
i=$(expr $i + 1)
done
bspc monitor $monitor -d $layout
layout=""
done done
if [ $hostname = tungsten ]; then unset layout
$HOME/.local/bin/layout/tungsten.sh unset monitors
bspc monitor -o DisplayPort-0 HDMI-0 unset desktops
bspc monitor DisplayPort-0 -d 1 2 3 4 unset deskpermon
bspc monitor HDMI-0 -d 5 6 7 8
fi
bspc config border_width 4 bspc config border_width 4
bspc config window_gap 10 bspc config window_gap 10