Skip to content

Commit

Permalink
new way of doing dircolors
Browse files Browse the repository at this point in the history
  • Loading branch information
majnemer committed Aug 28, 2009
1 parent 93231dd commit 9b748e8
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 178 deletions.
21 changes: 17 additions & 4 deletions commonsh/10_alias
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
#! /bin/sh
# colors
for dircolors in gdircolors dircolors ; do
if ( command -v $dircolors >/dev/null 2>&1) ; then
[ -f "${HOME}/.$dircolors" ] && eval `$dircolors -b "${HOME}/.$dircolors"` && break
[ -f /etc/DIR_COLORS ] && eval `$dircolors -b /etc/DIR_COLORS` && break
eval `$dircolors -b` && break
if ( command -v $dircolors >/dev/null 2>&1 ) ; then
dircolor_text=''
if [ -f "${HOME}/.dir_colors" ] ; then
dircolor_text=`cat "${HOME}/.dir_colors"`
eval `$dircolors -b "${HOME}/.dir_colors"`
elif [ -f /etc/DIR_COLORS ] ; then
dircolor_text=`cat /etc/DIR_COLORS`
eval `$dircolors -b /etc/DIR_COLORS`
fi

if ( $dircolors --version 2>/dev/null | grep GNU >/dev/null 2>&1 ) ; then
dircolor_text="${dircolor_text}\nSTICKY_OTHER_WRITABLE 01;04;34;40"
dircolor_text="${dircolor_text}\nOTHER_WRITABLE 01;34;40"
fi

eval `echo "${dircolor_text}" | $dircolors -b -`
break
fi
done

Expand Down
File renamed without changes.
172 changes: 0 additions & 172 deletions dircolors

This file was deleted.

3 changes: 1 addition & 2 deletions install.pl
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@
my %links = (
screenrc => '.screenrc',
toprc => '.toprc',
dircolors => '.dircolors',
gdircolors => '.gdircolors',
dir_colors => '.dir_colors',
lessfilter => '.lessfilter',

vim => '.vim',
Expand Down

0 comments on commit 9b748e8

Please sign in to comment.