Created
February 17, 2010 04:01
-
-
Save xenoterracide/306270 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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