home/.config/bspwm/bspwmrc

92 lines
2.9 KiB
Plaintext
Raw Normal View History

#!/bin/bash
#
# bspwmrc
# bspwm configuration file
#
## Monitor allocation
# Honestly pretty complex
setmon() {
desktops_total=10
2020-06-29 11:36:13 -05:00
desktops_primary=8
desktops_secondary=$(( desktops_total - desktops_primary ))
monitor_primary="$(xrandr -q | awk '/primary/{print $1}')"
monitors_secondary=($(xrandr -q | grep ' connected' | grep -v 'primary' | awk '{print $1}'))
# Ensure we have enough for every monitor
if (( desktops_secondary < ${#monitors_secondary[@]} )); then
echo "Adding more desktops to match connected monitors"
desktops_secondary=${#monitors_secondary[@]}
desktops_total=$(( desktops_secondary + desktops_primary ))
fi
if (( ${#monitors_secondary[@]} == 0 )); then
echo "Only one monitor allocated"
layout=$(seq --separator=" " 1 $desktops_total)
echo "Setting layout $layout"
bspc monitor $monitor_primary -d $layout
else
echo "${#monitors_secondary[@]} monitors connected"
deskpermon=$(( desktops_secondary / ${#monitors_secondary[@]} ))
layout=$(seq --separator=" " 1 $desktops_primary)
echo "Setting primary layout $layout"
bspc monitor $monitor_primary -d $layout
for m in $(seq 0 $(( ${#monitors_secondary[@]} - 1 ))); do
layout=$(seq --separator=" " \
$(( 1 + m + desktops_primary )) \
${#monitors_secondary[@]} \
"$desktops_total" \
)
echo "Setting layout for ${monitors_secondary[$m]} to $layout"
bspc monitor ${monitors_secondary[$m]} -d $layout
done
fi
}
setmon
## Behavior
# Tiling behavior
bspc config split_ratio 0.50
bspc config remove_disabled_monitors false
bspc config remove_unplugged_monitors true
# Pointer behavior
bspc config click_to_focus any
bspc config focus_follows_pointer true
bspc config pointer_follows_monitor true
bspc config pointer_modifier mod1
bspc config pointer_action1 move #LMB
bspc config pointer_action2 resize_corner #RMB
## Looks
# Padding
bspc config border_width 4
bspc config window_gap 6
bspc config single_monocle false
bspc config borderless_monocle false
2020-06-02 22:06:20 -05:00
bspc config gapless_monocle false
# Colors
2020-05-31 17:40:53 -05:00
bspc config normal_border_color "#31363b" #Unfocused
bspc config active_border_color "#1abc9c" #Focused, but current monitor isn't
bspc config focused_border_color "#1d99f3" #Focused completely
bspc config presel_feedback_color "#eff0f1" #???
## Rules
bspc rule -r '*'
bspc rule -a Steam desktop=7
bspc rule -a keepassxc desktop=8
bspc rule -a slack desktop=9
2020-06-29 11:36:13 -05:00
bspc rule -a Riot desktop=9
bspc rule -a discord desktop=9
bspc rule -a spotify desktop=10
bspc rule -a cantata desktop=10
bspc rule -a 'Minecraft 1.7.10' state=fullscreen
# For fullscreen Wine
bspc rule -a explorer.exe state=fullscreen
# Plasma rules
bspc rule -a plasmashell state=floating sticky=on border=off
bspc rule -a krunner state=floating layer=above sticky=on border=off
# Widgets
bspc rule -a Conky state=floating layer=below sticky=on
bspc rule -a pavucontrol-qt state=floating layer=above sticky=on