#!/bin/sh
#
# fluxbox startup-script:

# Change your keymap:
xmodmap "~/.Xmodmap"

# Create the apps submenu if it's not there
[ ! -f ~/.fluxbox/xdg_menu ] && \
	[ -x /usr/bin/xdgmenumaker ] && \
	xdgmenumaker -f fluxbox --no-submenu > ~/.fluxbox/xdg_menu

# Load the last used wallpaper
if [ -x /usr/bin/feh ] && [ -x ~/.fehbg ]; then
	~/.fehbg
else
	fbsetbg -l
fi

# Only run fbxkb when there are more than 1 available layouts
setxkbmap -query | grep "^layout:" | sed "s/^layout: *//" | \
	grep -q "," && [ -x /usr/bin/fbxkb ] && fbxkb &

# Create XDG user dirs
[ -x /usr/bin/xdg-user-dirs-update ] && xdg-user-dirs-update &

# Other applications you want to run with fluxbox.
# MAKE SURE THAT APPS THAT KEEP RUNNING HAVE AN ''&'' AT THE END.
#
[ -x /usr/bin/parcellite ] && parcellite &
[ -x /usr/bin/wicd-gtk ] && wicd-gtk -t &
[ -x /usr/bin/volumeicon ] && volumeicon &
[ -x /usr/bin/batti ] && batti &
[ -x /usr/bin/salix-update-notifier ] && salix-update-notifier &
[ -x /usr/bin/xscreensaver ] && xscreensaver -nosplash &

# 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 "~/.fluxbox/log"
