#! /bin/sh

bspc monitor -d I II III IV V VI VII VIII IX X

bspc config border_width         2
bspc config window_gap           5

bspc config split_ratio          0.52
bspc config borderless_monocle   true
bspc config gapless_monocle      true

# colors based on plastic scheme
bspc config normal_border_color "#21252b"
bspc config focused_border_color "#9ec400"
bspc config presel_feedback_color "#9ec400"

# some rules
# to get the name, search WM_CLASS(STRING) in xprop
# and pick the second entry
# e.g. WM_CLASS(STRING) = "zathura", "Zathura"
bspc config external_rules_command "$XDG_CONFIG_HOME/bspwm/external-rules"
bspc rule -a Gimp desktop='^8' state=floating follow=on
bspc rule -a mplayer2 state=floating
bspc rule -a Kupfer.py focus=on
bspc rule -a Screenkey manage=off
bspc rule -a Emulator state=floating
bspc rule -a Emacs state=tiled
bspc rule -a org.remmina.Remmina state=floating rectangle=3440x1370+0+0
bspc rule -a Zathura state=tiled

# function to check if a program already runs
# if not, start it
function run {
    if ! pgrep $1>/dev/null ; then
        $@&
    fi
}

#autostart stuff
xsetroot -cursor_name left_ptr 
numlockx on &
run sxhkd &
run picom &
pulseaudio --start &

if [[ $(hostname) == 'laptop' ]]; then
    feh --bg-scale /home/marc/Archiv/Bilder/Wallpaper/1920x1080/1920x1080_road_marking_evening_clouds_horizon.jpg
else
    feh --bg-scale /home/marc/Archiv/Bilder/Wallpaper/3440x1440/3440x1440_Sea_Sunset.jpg &
fi