#! /bin/sh

## Autostart Programs
sxhkd &
xsetroot -cursor_name left_ptr
pgrep bspswallow || bspswallow &
pgrep statnot || statnot &
# polybar example &
#~/.scripts/panel.sh
if [ $(pgrep polybar) ]; then
	killall -q polybar && sleep .5 && polybar mainbar &
else
	sleep .5 && polybar mainbar &
fi
#MONITOR=DP-5 polybar example &
~/.fehbg
picom &
#lxsession &
#blueman-applet &
#nm-applet &

## Configure Monitors/Workspaces
bspc monitor DisplayPort-1 -d 1 2 3 4 5 6 7 8 9
bspc monitor DisplayPort-0 -d 1 2 3 4 5 6 7 8 9

## Theming
bspc config border_width        1
bspc config window_gap          10
bspc config top_padding         20
bspc config left_padding        0
bspc config right_padding       0
bspc config bottom_padding      0
bspc config split_ratio         0.52
bspc config borderless_monocle  true
bspc config gapless_monocle     false
# bspc config ignore_ewmh_fullscreen all
bspc config single_monocle      true

# Colors
bspc config normal_border_color     "$(xrdb -query | grep background | cut -f2)"
bspc config focused_border_color    "$(xrdb -query | grep foreground | cut -f2)"

bspc rule -a Gimp desktop='^8' state=floating follow=on
bspc rule -a Chromium desktop='^2'
bspc rule -a mplayer2 state=floating
bspc rule -a Kupfer.py focus=on
bspc rule -a Screenkey manage=off
bspc rule -a Emacs state=tiled

# Polybar Hidden When Fullscreen for Vlc, Youtube, Mpv ...
# xdo below -t $(xdo id -n root) $(xdo id -a polybar-mainbar_DisplayPort-1)
#xdo below -t $(xdo id -n root) $(xdo id -a polybar-main)

## Make Focus Follow Cursor
bspc config focus_follows_pointer true