101 lines
4.2 KiB
Bash
101 lines
4.2 KiB
Bash
#!/bin/sh
|
|
##############################################################################
|
|
# generates user X initialization files to start enlightenment #
|
|
#
|
|
# Copyright (C) 1999 Carsten Haitzler, Geoff Harrison and various contributors
|
|
#
|
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
# of this software and associated documentation files (the "Software"), to
|
|
# deal in the Software without restriction, including without limitation the
|
|
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
|
# sell copies of the Software, and to permit persons to whom the Software is
|
|
# furnished to do so, subject to the following conditions:
|
|
#
|
|
# The above copyright notice and this permission notice shall be included in
|
|
# all copies of the Software, its documentation and marketing & publicity
|
|
# materials, and acknowledgment shall be given in the documentation, materials
|
|
# and software packages that this Software was used.
|
|
#
|
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
# THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
##############################################################################
|
|
|
|
PATH=$PATH:"/usr/local/enlightenment/bin:/usr/enlightenment/bin:/opt/enlightenment/bin:/usr/local/bin:"$EBIN
|
|
export PATH
|
|
|
|
if [ -f $HOME"/.xsession" ] || [ -f $HOME"/.xinitrc" ] || [ -f $HOME"/.Xclients" ]; then
|
|
echo
|
|
echo "******************************* WARNING *****************************"
|
|
echo "* You already have X login startup files. They will be backed up as *"
|
|
echo "* .old files and new ones will be created. Thank you for using *"
|
|
echo " Enlightenment. *"
|
|
echo "*********************************************************************"
|
|
echo
|
|
sleep 3
|
|
#get rid of backup files
|
|
if [ -f $HOME"/.xsession.old" ]; then
|
|
rm -f $HOME"/.xsession.old"
|
|
fi
|
|
if [ -f $HOME"/.xinitrc.old" ]; then
|
|
rm -f $HOME"/.xinitrc.old"
|
|
fi
|
|
if [ -f $HOME"/.Xclients.old" ]; then
|
|
rm -f $HOME"/.Xclients.old"
|
|
fi
|
|
# rename current files
|
|
if [ -f $HOME"/.xsession" ]; then
|
|
mv $HOME"/.xsession" $HOME"/.xsession.old"
|
|
fi
|
|
if [ -f $HOME"/.xinitrc" ]; then
|
|
mv $HOME"/.xinitrc" $HOME"/.xinitrc.old"
|
|
fi
|
|
if [ -f $HOME"/.Xclients" ]; then
|
|
mv $HOME"/.Xclients" $HOME"/.Xclients.old"
|
|
fi
|
|
# get rid of symlinks
|
|
if [ -L $HOME"/.xsession" ]; then
|
|
rm -f $HOME"/.xsession"
|
|
fi
|
|
if [ -L $HOME"/.xinitrc" ]; then
|
|
rm -f $HOME"/.xinitrc"
|
|
fi
|
|
if [ -L $HOME"/.Xclients" ]; then
|
|
rm -f $HOME"/.Xclients"
|
|
fi
|
|
fi
|
|
|
|
EBIN=@ENLIGHTENMENT_BIN@
|
|
echo "... Generating login startup files ..."
|
|
echo "#!/bin/sh" >> $HOME"/.xsession"
|
|
echo "# Execute enlightenment. ALWAYS make sure this is at the end of this" >> $HOME"/.xsession"
|
|
echo "# startup file - and ALWAYS run things before it with an & at the end." >> $HOME"/.xsession"
|
|
echo "# For example:" >> $HOME"/.xsession"
|
|
echo "# xterm &" >> $HOME"/.xsession"
|
|
echo "# kpanel &" >> $HOME"/.xsession"
|
|
echo "# It is suggested to use Enlightenment's Remember dialog for having apps" >> $HOME"/.xsession"
|
|
echo "# spawned automatically on login." >> $HOME"/.xsession"
|
|
echo "exec "$EBIN"/enlightenment" >> $HOME"/.xsession"
|
|
# make executable
|
|
chmod a+r+x $HOME"/.xsession"
|
|
ln -s $HOME"/.xsession" $HOME"/.xinitrc"
|
|
ln -s $HOME"/.xsession" $HOME"/.Xclients"
|
|
echo "Done."
|
|
if [ -f $HOME"/.enlightenment" ]; then
|
|
if [ -f $HOME"/.enlightenment/.initialized" ]; then
|
|
echo "You have installed Enlightenment 0.16 or greater already and have"
|
|
echo "run it before. Everything should be fine."
|
|
else
|
|
echo "You seem to have had either an Enlightenment version earlier than"
|
|
echo "0.16.0 installed or a 0.16 development snapshot. Your .enlightenment"
|
|
echo "directory will be renamed to .enlightenment.old just in case."
|
|
mv $HOME"/.enlightenment" $HOME"/.enlightenment.old"
|
|
fi
|
|
fi
|
|
echo
|
|
echo "Now log out of X and log back in again and enlightenment should be your"
|
|
echo "window manager."
|