Skip to content

Instantly share code, notes, and snippets.

@xenoterracide
Created February 17, 2010 04:01
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 xenoterracide/306270 to your computer and use it in GitHub Desktop.
Save xenoterracide/306270 to your computer and use it in GitHub Desktop.
#!/bin/bash
# see my whole file @ http://github.com/xenoterracide/dot_etc/blob/master/bashrc
# set a good defaults if we aren't using konsole
export PS1='\[\033[01;32m\]\h\[\033[01;34m\] \W $ \[\033[00m\]'
umask 0077
# set up env based on KONSOLE_PROFILE and KONSOLE_SESSION
# Test to see if the KONSOLE_PROFILE is empty
if [ ! -z ${KONSOLE_PROFILE} ]; then
# a seperator for HISTFILE if a profile is actually set.
# we don't want underscores in its name if we aren't using konsole
S="_"
if [ ${KONSOLE_PROFILE} = "shell" ];
umask 0077
elif [ ${KONSOLE_PROFILE} = "webdev" ]; then # change colors and umask for web development
PS1='\[\033[01;35m\]\h\[\033[01;34m\] \W $ \[\033[00m\]'
umask 0027
fi
fi
# set the hist file using the profile and session number
# KONSOLE_DBUS_SESSION is in form /Session/1
# so what we're doing is stripping it down to just the number at the end.
# we need unique histfiles because we'll probably have multiple instances of the same profiles open.
export HISTFILE="${HOME}/.bash_history${S}${KONSOLE_PROFILE}${S}${KONSOLE_DBUS_SESSION##*/}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment