xmonad/xmonad-start

49 lines
1.1 KiB
Plaintext
Raw Normal View History

2009-05-06 21:19:58 +00:00
#!/bin/sh
XMONAD_DIR=$HOME/.xmonad
# if no user configuration
if [ ! -d $XMONAD_DIR ]; then
# add a desktop friendly config if possible
if [ -r /usr/share/xmonad/xmonad.hs ]; then
mkdir $XMONAD_DIR
cp -p /usr/share/xmonad/xmonad.hs $XMONAD_DIR
else
echo "xmonad-start: install xmonad-config to customize"
fi
# display the manpage
case $DESKTOP_SESSION in
xmonad-mate) TERM_CMD="mate-terminal -x" ;;
*) TERM_CMD="xterm -e" ;;
esac
(sleep 5; $TERM_CMD man xmonad) &
else
XMONAD_CUSTOM=$XMONAD_DIR/xmonad-$(uname -i)-linux
if [ -r $XMONAD_DIR/xmonad.hs -a -x $XMONAD_CUSTOM ]; then
if ldd $XMONAD_CUSTOM | grep -q "not found"; then
xmonad --recompile
fi
fi
2009-05-06 21:19:58 +00:00
fi
case $DESKTOP_SESSION in
xmonad-mate)
# hack for gnome-session not starting screensaver for xmonad, etc
SCREENSAVER=/usr/bin/mate-screensaver
# FIXME STILL NEEDED? [ -x "$SCREENSAVER" ] && $SCREENSAVER & ;;
esac
if [ -r $XMONAD_DIR/session ]; then
sh $XMONAD_DIR/session
fi
if [ -n "$*" ]; then
if [ -d $XMONAD_DIR -a "$(ls -t $XMONAD_DIR | head -1)" = "xmonad.hs" ]; then
xmonad --recompile
fi
xmonad &
$*
else
xmonad
fi