Skip to content

Instantly share code, notes, and snippets.

@dennyhalim
Created July 13, 2009 16:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dennyhalim/146217 to your computer and use it in GitHub Desktop.
Save dennyhalim/146217 to your computer and use it in GitHub Desktop.
# (c) 2008 DennyHalim.com
# you're free to copy to copy and/or distribute this script under GPL license
# paste into your ~/.bashrc and it just works.
# it will startx / startxfce when you login at tty1
# it can also logout/shutdown after you close x.
file=/tmp/.X0-lock
#check if x is running
if [[ -e $file ]]
then
echo "Ctrl+Alt+F7 to switch to XWindow"
#only run xfce4 if login at tty1
elif [ $(tty) == /dev/tty1 ]; then
startxfce4 # use startx if you prefer so
# exit #to logout automatically after x closed
# halt #to shutdown automatically after x closed
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment