#!/bin/sh
#
# fluxbox startup-script:
#
# Lines starting with a '#' are ignored.

# Debian-local change:
#   - fbautostart has been added with a quick hack to check to see if it
#     exists. If it does, we'll start it up by default.
which fbautostart > /dev/null
if [ $? -eq 0 ]; then
    fbautostart
fi

# read ~.Xresources file
xrdb ~/.Xresources &

# set ctrl_alt_bksp as session-killer
setxkbmap -option terminate:ctrl_alt_bksp &

# set startscreen
if [ -e ~/.fehbg ]; then
    sh ~/.fehbg &
else
    feh --bg-fill /usr/share/backgrounds/nakedeb.jpg &
fi

# solid color as wall
#xsetroot -solid "#000000" &

# enable URxvt deamon
urxvtd -q -f -o &

# fluxbox automenu by thuban
sleep 3s && rm -f ~/.fluxbox/automenu/* && fluxbox-automenu \
    && fluxbox-update_configs &

# authentification
/usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1 &

# monitor
sleep 7s && conky -c ~/.conkyrc &

# auto hide mouse cursor
unclutter-xfixes --timeout 1 --jitter 1 --ignore-buttons 4,5,6,7 --hide-on-touch --start-hidden &

# And last but not least we start fluxbox.
# Because it is the last app you have to run it with ''exec'' before it.
exec fluxbox

# or if you want to keep a log:
# exec fluxbox -log "/home/$USER/.fluxbox/log"
