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
2013-09-12 08:15:35 +00:00
INFO="Install xmonad, xmonad-mate, or xmonad-config to customize xmonad."
echo "xmonad-start: $INFO"
2011-05-12 09:53:28 +00:00
fi
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
2013-09-12 08:15:35 +00:00
# recompile if broken shared libs after an upgrade
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-09-12 08:15:35 +00:00
XMONADSTART_CACHEDIR=$HOME/.cache/xmonad-start
NO_DIALOG_FILE=$HOME/.cache/xmonad-start/no-startup-dialog
if [ -x "/usr/bin/zenity" -a ! -r "$NO_DIALOG_FILE" ]; then
2013-12-22 06:09:28 +00:00
if ! zenity --question --text="To open an terminal press: Alt-Shift-Return\n\nFor more keybindings and info see manpage: man xmonad\n\n${INFO:+$INFO\n\n}\nShow this dialog next time?"; then
2013-09-12 08:15:35 +00:00
mkdir -p $XMONADSTART_CACHEDIR
touch $NO_DIALOG_FILE
fi
fi
2013-01-30 04:01:15 +00:00
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
2017-01-17 03:56:24 +00:00
if [ -x /usr/bin/gnome-keyring-daemon ]; then
eval $(gnome-keyring-daemon --start)
export GNOME_KEYRING_SOCKET
export GNOME_KEYRING_PID
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