Skip to content

Commit 9b748e8

Browse files
committed
new way of doing dircolors
1 parent 93231dd commit 9b748e8

File tree

4 files changed

+18
-178
lines changed

4 files changed

+18
-178
lines changed

commonsh/10_alias

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,23 @@
11
#! /bin/sh
22
# colors
33
for dircolors in gdircolors dircolors ; do
4-
if ( command -v $dircolors >/dev/null 2>&1) ; then
5-
[ -f "${HOME}/.$dircolors" ] && eval `$dircolors -b "${HOME}/.$dircolors"` && break
6-
[ -f /etc/DIR_COLORS ] && eval `$dircolors -b /etc/DIR_COLORS` && break
7-
eval `$dircolors -b` && break
4+
if ( command -v $dircolors >/dev/null 2>&1 ) ; then
5+
dircolor_text=''
6+
if [ -f "${HOME}/.dir_colors" ] ; then
7+
dircolor_text=`cat "${HOME}/.dir_colors"`
8+
eval `$dircolors -b "${HOME}/.dir_colors"`
9+
elif [ -f /etc/DIR_COLORS ] ; then
10+
dircolor_text=`cat /etc/DIR_COLORS`
11+
eval `$dircolors -b /etc/DIR_COLORS`
12+
fi
13+
14+
if ( $dircolors --version 2>/dev/null | grep GNU >/dev/null 2>&1 ) ; then
15+
dircolor_text="${dircolor_text}\nSTICKY_OTHER_WRITABLE 01;04;34;40"
16+
dircolor_text="${dircolor_text}\nOTHER_WRITABLE 01;34;40"
17+
fi
18+
19+
eval `echo "${dircolor_text}" | $dircolors -b -`
20+
break
821
fi
922
done
1023

File renamed without changes.

dircolors

Lines changed: 0 additions & 172 deletions
This file was deleted.

install.pl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@
3939
my %links = (
4040
screenrc => '.screenrc',
4141
toprc => '.toprc',
42-
dircolors => '.dircolors',
43-
gdircolors => '.gdircolors',
42+
dir_colors => '.dir_colors',
4443
lessfilter => '.lessfilter',
4544

4645
vim => '.vim',

0 commit comments

Comments
 (0)