2009-05-06 21:19:58 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2012-05-24 06:55:00 +00:00
|
|
|
XMONAD_DIR=$HOME/.xmonad
|
|
|
|
|
2011-05-17 09:19:12 +00:00
|
|
|
# if no user configuration
|
2012-05-24 06:55:00 +00:00
|
|
|
if [ ! -d $XMONAD_DIR ]; then
|
2011-12-03 05:45:18 +00:00
|
|
|
# add a desktop friendly config if possible
|
|
|
|
if [ -r /usr/share/xmonad/xmonad.hs ]; then
|
2012-05-24 06:55:00 +00:00
|
|
|
mkdir $XMONAD_DIR
|
|
|
|
cp -p /usr/share/xmonad/xmonad.hs $XMONAD_DIR
|
2011-12-03 05:45:18 +00:00
|
|
|
else
|
|
|
|
echo "xmonad-start: install xmonad-config to customize"
|
2011-05-12 09:53:28 +00:00
|
|
|
fi
|
2012-02-22 09:45:13 +00:00
|
|
|
# display the manpage
|
|
|
|
case $DESKTOP_SESSION in
|
2013-02-25 15:11:47 +00:00
|
|
|
xmonad-mate) TERM_CMD="mate-terminal -x" ;;
|
2012-02-22 09:45:13 +00:00
|
|
|
*) TERM_CMD="xterm -e" ;;
|
|
|
|
esac
|
2012-03-23 06:39:11 +00:00
|
|
|
(sleep 5; $TERM_CMD man xmonad) &
|
2012-05-24 06:55:00 +00:00
|
|
|
else
|
2012-05-29 00:49:36 +00:00
|
|
|
XMONAD_CUSTOM=$XMONAD_DIR/xmonad-$(uname -i)-linux
|
2012-05-24 06:55:00 +00:00
|
|
|
if [ -r $XMONAD_DIR/xmonad.hs -a -x $XMONAD_CUSTOM ]; then
|
2012-05-31 04:59:57 +00:00
|
|
|
if ldd $XMONAD_CUSTOM | grep -q "not found"; then
|
2012-05-29 00:49:36 +00:00
|
|
|
xmonad --recompile
|
2012-05-24 06:55:00 +00:00
|
|
|
fi
|
|
|
|
fi
|
2009-05-06 21:19:58 +00:00
|
|
|
fi
|
|
|
|
|
2013-01-30 04:01:15 +00:00
|
|
|
case $DESKTOP_SESSION in
|
2013-02-25 15:11:47 +00:00
|
|
|
xmonad-mate)
|
2013-01-30 04:01:15 +00:00
|
|
|
# hack for gnome-session not starting screensaver for xmonad, etc
|
2013-02-25 15:11:47 +00:00
|
|
|
SCREENSAVER=/usr/bin/mate-screensaver
|
|
|
|
# FIXME STILL NEEDED? [ -x "$SCREENSAVER" ] && $SCREENSAVER & ;;
|
2013-01-30 04:01:15 +00:00
|
|
|
esac
|
|
|
|
|
2012-05-24 06:55:00 +00:00
|
|
|
if [ -r $XMONAD_DIR/session ]; then
|
|
|
|
sh $XMONAD_DIR/session
|
2011-05-17 09:19:12 +00:00
|
|
|
fi
|
|
|
|
|
2013-02-25 15:11:47 +00:00
|
|
|
if [ -n "$*" ]; then
|
|
|
|
if [ -d $XMONAD_DIR -a "$(ls -t $XMONAD_DIR | head -1)" = "xmonad.hs" ]; then
|
|
|
|
xmonad --recompile
|
|
|
|
fi
|
|
|
|
xmonad &
|
|
|
|
$*
|
|
|
|
else
|
|
|
|
xmonad
|
|
|
|
fi
|