This repository has been archived on 2024-03-28. You can view files and clone it, but cannot push or open issues or pull requests.
dotfiles/apps/de/bspwm/config

51 lines
1.5 KiB
Plaintext
Raw Normal View History

2020-01-20 10:49:06 -06:00
#!/usr/bin/env sh
2017-02-07 16:16:45 -06:00
2020-01-20 10:49:06 -06:00
export WINDOW_GAP=0
NUM_DESKTOPS=10
DESKTOPS=$(seq "$NUM_DESKTOPS")
2017-02-07 16:16:45 -06:00
BSPWM_MONITORS=$(bspc query -M | tac)
2020-01-20 10:49:06 -06:00
MONITOR_COUNT=$(<<< "$BSPWM_MONITORS" wc -w | awk '{ printf $1 }')
2017-02-07 16:16:45 -06:00
PER_MONITOR=$((NUM_DESKTOPS / MONITOR_COUNT))
2020-01-20 10:49:06 -06:00
REVERSE_DESKTOP_ORDERING=${REVERSE_DESKTOP_ORDERING:-0}
2017-02-07 16:16:45 -06:00
2020-01-17 03:02:53 -06:00
. maybe_source_env_file bspwm
2017-02-07 16:16:45 -06:00
2020-01-17 03:02:53 -06:00
bspc config normal_border_color "$(xrdb -query | sed -ne 's/.*background:\s*//p')"
2018-11-12 15:50:01 -06:00
bspc config focused_border_color "$(xrdb -query | sed -ne 's/.*color0\?4:\s*//p')"
bspc config active_border_color "$(xrdb -query | sed -ne 's/.*color0\?4:\s*//p')"
bspc config presel_feedback_color "$(xrdb -query | sed -ne 's/.*color0\?4:\s*//p')"
bspc config border_width "$BORDER_WIDTH"
2019-05-14 10:59:09 -05:00
bspc config split_ratio 0.5
2018-11-12 15:50:01 -06:00
bspc config borderless_monocle true
bspc config gapless_monocle true
bspc config pointer_modifier "mod4"
bspc config remove_unplugged_monitors true
bspc config remove_disabled_monitors true
2020-01-17 03:02:53 -06:00
bspc config window_gap "$WINDOW_GAP"
2017-02-07 16:16:45 -06:00
bspc rule -a "*" split_dir=right
2017-02-07 16:16:45 -06:00
i=1
2020-01-20 10:49:06 -06:00
for mon in $BSPWM_MONITORS; do
2017-02-07 16:16:45 -06:00
max=$((i + PER_MONITOR - 1))
screens=
for j in $(seq $i $max); do
2020-01-20 10:49:06 -06:00
screens="${screens}${j} "
2017-02-07 16:16:45 -06:00
done
bspc monitor "$mon" -d $screens
i=$((max + 1))
done
2020-01-20 10:49:06 -06:00
if [ $REVERSE_DESKTOP_ORDERING -eq 1 ]; then
prev_mon=
for mon in ${BSPWM_MONITORS}; do
2020-01-20 10:49:06 -06:00
if [ ! -z $prev_mon ]; then
bspc monitor "$mon" --swap "$prev_mon"
fi
prev_mon="$mon"
done
fi
2020-01-17 03:02:53 -06:00
. maybe_source_env_file bspwm-after