#! /bin/sh

pgrep -x sxhkd > /dev/null || sxhkd &

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

bspc config normal_border_color '#42395D'
bspc config focused_border_color '#F1568E'
bspc config border_width        3
bspc config window_gap          5

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

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 follow=on state=tiled desktop='^1'
bspc rule -a Firefox desktop='^3'

pgrep -x polybar > /dev/null || polybar example &
pgrep -x picom > /dev/null || picom &
# Set us and polytonic greek as layouts, double shift switches
setxkbmap -model pc105 -layout us,gr -variant ,polytonic -option grp:shifts_toggle

# Run picom in greyscale mode
# picom -b --backend glx --glx-fshader-win  "uniform sampler2D tex; uniform float opacity; void main() { vec4 c = texture2D(tex, gl_TexCoord[0].xy); float y = dot(c.rgb, vec3(0.2126, 0.7152, 0.0722)); gl_FragColor = opacity*vec4(y, y, y, c.a); }"

# unclutter hides the cursor after a period of inactivity
# pgrep -x unclutter > /dev/null || unclutter --timeout 10 -b

# Startup Apps I want
# pgrep -x emacs > /dev/null || emacs
# pgrep -x firefox > /dev/null || firefox
