#!/bin/sh

# cleanup
rm -f /tmp/panel-fifo
pkill -lf lemonbar

# report fifo for lemonbar
mkfifo /tmp/panel-fifo
bspc subscribe report > /tmp/panel-fifo &

# start bar if not running
pgrep -lf lemonbar || $HOME/.config/bspwm/lemonbar.sh &

# start hotkey daemon
sxhkd -c $HOME/.config/bspwm/sxhkdrc &

# configure bspwm
bspc monitor -d 1 2 3 4 5 6 7 8 9 10

bspc config border_width            1
bspc config window_gap              1

bspc config split_ratio             0.52
bspc config borderless_monocle      true
bspc config gapless_monocle         false
bspc config focus_follows_pointer   true

bspc config focused_border_color    "#990000"
bspc config presel_feedback_color   "#990000"

# automatic tiling
bspc config automatic_scheme        longest_side
bspc config honor_size_hints        false

# mouse can resize/move floating nodes
bspc config pointer_modifier        mod1
bspc config pointer_action1         move
bspc config pointer_action2         resize_corner

bspc rule -a Gimp       desktop='^8' state=floating follow=on
bspc rule -a Chromium   desktop='^2'
bspc rule -a mpv        state=floating
bspc rule -a Kupfer.py  focus=on
bspc rule -a Screenkey  manage=off
bspc rule -a scratchpad sticky=on state=floating rectangle=1140x551+109+117
