now using dircolors for ls coloring.

This commit is contained in:
Ivan Malison 2014-05-02 13:36:04 -07:00
parent 221c6c430a
commit b0049d6c0f
5 changed files with 12 additions and 12 deletions

View File

@ -2,12 +2,16 @@
cd `dirname $BASH_SOURCE` && source resources/bootstrapping.sh cd `dirname $BASH_SOURCE` && source resources/bootstrapping.sh
DOTFILES_DIRECTORY="$(dotfiles_abspath)/dotfiles" DOTFILES_DIRECTORY="$(dotfiles_abspath)/dotfiles"
function make_powerline_symlink() { function make_powerline_symlinks() {
# Make a powerline link if powerline is installed # Make a powerline link if powerline is installed
local powerline_location=$(pip show Powerline | grep Location | awk '{print $2}') local powerline_location=$(pip show Powerline | grep Location | awk '{print $2}')
local conf_location="/powerline/bindings/tmux/powerline.conf" local conf_location="/powerline/bindings/tmux/powerline.conf"
local link_destination="$HOME/.tmux.powerline" local link_destination="$HOME/.tmux.powerline"
sudo pip install --user git+git://github.com/Lokaltog/powerline if test -z $powerline_location;
then
sudo pip install --user git+git://github.com/Lokaltog/powerline
fi
if test -z $powerline_location; if test -z $powerline_location;
then then
rm $link_destination 2> /dev/null rm $link_destination 2> /dev/null
@ -26,13 +30,12 @@ function symlink_dotfiles() {
local link_target=$(${readlink_command} -f $filename) local link_target=$(${readlink_command} -f $filename)
echo "linking $link_destination to $link_target" echo "linking $link_destination to $link_target"
# Using only test -e doesn't work here because it will return # Using only test -e doesn't work here because it will return
# false if the destination of the symbolic link at # false if the destination of the symbolic link at does not exist.
# link_destination does not exist.
test -e $link_destination || test -L $link_destination && mv $link_destination ~/.dotfiles-backups test -e $link_destination || test -L $link_destination && mv $link_destination ~/.dotfiles-backups
ln -si $link_target $link_destination ln -si $link_target $link_destination
done done
[ -a ~/.dotfiles-backups.old ] && mv ~/.dotfiles-backups.old ~/.dotfiles-backups/.dotfiles-backups [ -a ~/.dotfiles-backups.old ] && mv ~/.dotfiles-backups.old ~/.dotfiles-backups/.dotfiles-backups
make_powerline_symlink make_powerline_symlinks
} }

2
dotfiles/dircolors Normal file
View File

@ -0,0 +1,2 @@
LINK 35;40
EXEC 01;40

View File

@ -0,0 +1,2 @@
local dircolors_file="$HOME/.dircolors"
test -r $dircolors_files && eval "$(dircolors $dircolors_file)"

View File

@ -24,8 +24,3 @@ export LESS_TERMCAP_md="$ORANGE"
# Dont clear the screen after quitting a manual page # Dont clear the screen after quitting a manual page
export MANPAGER="less -X" export MANPAGER="less -X"
export LS_COLORS='no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.ogg=01;35:*.mp3=01;35:*.wav=01;35:'
export CLI_COLORS=$LS_COLORS
export CLICOLOR=$LS_COLORS

View File

@ -97,5 +97,3 @@ PROMPT='╭─% $(print_with_color "%n" "$USERNAME_COLOR") $(separator "at") $(p
╰─$(command_line_character) ' ╰─$(command_line_character) '
PS2='(%_) ' PS2='(%_) '
RPROMPT='Last Exit Code: $?'