#!/usr/bin/env bash

# case $HOSTNAME in
#   kuro)  export LAN=eno1   ;;
#   shiro) export LAN=wlp3s0 ;;
# esac
polybar &
export MONITOR=$(xrandr -q | grep primary | cut -d' ' -f1)
export MONITORS=( $(xrandr -q | grep ' connected' | cut -d' ' -f1) )
MONITOR=${MONITOR:-${MONITORS[0]}}

bspc subscribe all > ~/bspc-report.log &
# Only have workspaces for primary monitor
for monitor in $MONITORS; do
  bspc monitor $monitor -d 0
done
bspc monitor $MONITOR -d {1,2,3,4,5}

bspc config remove_disabled_monitors true
bspc config remove_unplugged_monitors true


# Rules
bspc rule -r '*'

bspc rule -a Pinentry state=floating center=on
bspc rule -a Emacs split_ratio=0.28 state=tiled
bspc rule -a Firefox split_ratio=0.32
bspc rule -a feh state=fullscreen
bspc rule -a 'Emacs:org*' state=floating
bspc rule -a 'Emacs:scratch' state=floating
bspc rule -a 'Emacs:emacs-everywhere' state=floating sticky=on
bspc rule -a '*:scratch' state=floating sticky=on border=off rectangle=1000x460+480+620

#
# for file in $XDG_CONFIG_HOME/bspwm/rc.d/*; do
#   source "$file"
# done
