2020-05-31 18:01:57 -05:00
|
|
|
#!/bin/bash
|
2020-05-31 17:39:29 -05:00
|
|
|
#
|
|
|
|
# bspwmrc
|
|
|
|
# bspwm configuration file
|
|
|
|
#
|
|
|
|
|
2020-08-10 20:51:22 -05:00
|
|
|
## Start a hotkey daemon
|
2020-09-16 12:07:06 -05:00
|
|
|
pgrep sxhkd -u "$UID" || sxhkd &
|
2020-08-10 20:51:22 -05:00
|
|
|
|
2020-05-31 18:01:57 -05:00
|
|
|
## Monitor allocation
|
|
|
|
# Honestly pretty complex
|
|
|
|
setmon() {
|
2020-06-29 11:22:33 -05:00
|
|
|
desktops_total=10
|
2020-06-29 11:36:13 -05:00
|
|
|
desktops_primary=8
|
2020-05-31 18:01:57 -05:00
|
|
|
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
|
|
|
|
|
2020-05-31 17:39:29 -05:00
|
|
|
## 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
|
2020-07-08 01:15:15 -05:00
|
|
|
bspc config focus_follows_pointer true
|
2020-05-31 17:39:29 -05:00
|
|
|
bspc config pointer_follows_monitor true
|
|
|
|
bspc config pointer_modifier mod1
|
|
|
|
bspc config pointer_action1 move #LMB
|
|
|
|
bspc config pointer_action2 resize_corner #RMB
|
|
|
|
|
2020-10-04 18:41:30 -05:00
|
|
|
# ewmh behavior
|
|
|
|
bspc config ignore_ewmh_focus true # Fuck you, Discord
|
|
|
|
|
2020-05-31 17:39:29 -05:00
|
|
|
## 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
|
2020-05-31 17:39:29 -05:00
|
|
|
# Colors
|
2020-09-23 02:21:17 -05:00
|
|
|
case $THEME in
|
|
|
|
light)
|
2020-12-20 05:16:50 -06:00
|
|
|
bspc config normal_border_color "#f2e5bc" #Unfocused
|
|
|
|
bspc config active_border_color "#8ec07c" #Focused, but current monitor isn't
|
|
|
|
bspc config focused_border_color "#83a598" #Focused completely
|
|
|
|
bspc config presel_feedback_color "#ebdbb2" #???
|
2020-09-23 02:21:17 -05:00
|
|
|
;;
|
|
|
|
*)
|
2020-12-20 05:16:50 -06:00
|
|
|
bspc config normal_border_color "#32302f" #Unfocused
|
|
|
|
bspc config active_border_color "#8ec07c" #Focused, but current monitor isn't
|
|
|
|
bspc config focused_border_color "#83a598" #Focused completely
|
|
|
|
bspc config presel_feedback_color "#ebdbb2" #???
|
2020-09-23 02:21:17 -05:00
|
|
|
;;
|
|
|
|
esac
|
2020-05-31 17:39:29 -05:00
|
|
|
|
|
|
|
## Rules
|
|
|
|
bspc rule -r '*'
|
2020-10-04 18:31:14 -05:00
|
|
|
case $HOSTNAME in
|
2020-12-09 20:14:20 -06:00
|
|
|
dsk-cstm-0*)
|
2020-10-04 18:31:14 -05:00
|
|
|
# Big boy gets pseudotiled Firefox
|
|
|
|
bspc rule -a Firefox state=pseudo_tiled rectangle=1920x1080+0+0
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
;;
|
|
|
|
esac
|
2020-07-08 01:12:37 -05:00
|
|
|
bspc rule -a Steam desktop=7
|
2020-10-04 18:41:30 -05:00
|
|
|
bspc rule -a KeePassXC desktop=8
|
2020-07-08 01:12:37 -05:00
|
|
|
bspc rule -a slack desktop=9
|
2020-06-29 11:36:13 -05:00
|
|
|
bspc rule -a Riot desktop=9
|
2020-08-10 21:02:37 -05:00
|
|
|
bspc rule -a Element desktop=9
|
2020-06-29 11:36:13 -05:00
|
|
|
bspc rule -a discord desktop=9
|
|
|
|
bspc rule -a spotify desktop=10
|
|
|
|
bspc rule -a cantata desktop=10
|
2020-05-31 17:39:29 -05:00
|
|
|
bspc rule -a 'Minecraft 1.7.10' state=fullscreen
|
2020-10-07 19:43:57 -05:00
|
|
|
bspc rule -a 'NieR:Automata' state=fullscreen
|
2020-05-31 17:39:29 -05:00
|
|
|
# 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
|