Blame coreutils-colorls.csh
|
Ondrej Vasik |
5d66c4 |
#! /bin/csh -f
|
|
Tim Waugh |
093300 |
# color-ls initialization
|
|
Ondrej Vasik |
147167 |
if ( $?USER_LS_COLORS ) then
|
|
Ondrej Vasik |
147167 |
if ( "$USER_LS_COLORS" != "" ) then
|
|
Ondrej Vasik |
542128 |
#when USER_LS_COLORS defined do not override user
|
|
Ondrej Vasik |
147167 |
#specified LS_COLORS and use them
|
|
Ondrej Vasik |
6ee11a |
goto finish
|
|
Ondrej Vasik |
6ee11a |
endif
|
|
Ondrej Vasik |
5d66c4 |
endif
|
|
Ondrej Vasik |
5d66c4 |
|
|
Tim Waugh |
093300 |
alias ll 'ls -l'
|
|
Tim Waugh |
093300 |
alias l. 'ls -d .*'
|
|
Tim Waugh |
093300 |
set COLORS=/etc/DIR_COLORS
|
|
Tim Waugh |
093300 |
if ($?TERM) then
|
|
Ondrej Vasik |
542128 |
if ( -e "/etc/DIR_COLORS.$TERM" ) then
|
|
Ondrej Vasik |
6ee11a |
set COLORS="/etc/DIR_COLORS.$TERM"
|
|
Ondrej Vasik |
6ee11a |
endif
|
|
Ondrej Vasik |
5d66c4 |
endif
|
|
Ondrej Vasik |
6ee11a |
if ( -e "/etc/DIR_COLORS.256color" ) then
|
|
Ondrej Vasik |
515305 |
if ( "`tty -s && tput colors`" == "256" ) then
|
|
Ondrej Vasik |
6ee11a |
set COLORS=/etc/DIR_COLORS.256color
|
|
Ondrej Vasik |
542128 |
endif
|
|
Tim Waugh |
093300 |
endif
|
|
Ondrej Vasik |
6ee11a |
if ( -f ~/.dircolors ) set COLORS=~/.dircolors
|
|
Ondrej Vasik |
6ee11a |
if ( -f ~/.dir_colors ) set COLORS=~/.dir_colors
|
|
Tim Waugh |
093300 |
if ($?TERM) then
|
|
Ondrej Vasik |
6ee11a |
if ( -f ~/.dircolors."$TERM" ) set COLORS=~/.dircolors."$TERM"
|
|
Ondrej Vasik |
6ee11a |
if ( -f ~/.dir_colors."$TERM" ) set COLORS=~/.dir_colors."$TERM"
|
|
Ondrej Vasik |
5d66c4 |
endif
|
|
Tim Waugh |
093300 |
|
|
Ondrej Vasik |
6ee11a |
if ( ! -e "$COLORS" ) exit
|
|
Tim Waugh |
093300 |
|
|
Ondrej Vasik |
542128 |
eval "`dircolors -c $COLORS`"
|
|
Tim Waugh |
093300 |
|
|
Ondrej Vasik |
6ee11a |
if ( "$LS_COLORS" == '' ) exit
|
|
Tim Waugh |
093300 |
set color_none=`sed -n '/^COLOR.*none/Ip' < $COLORS`
|
|
Ondrej Vasik |
542128 |
if ( "$color_none" != '' ) then
|
|
Ondrej Vasik |
6ee11a |
unset color_none
|
|
Ondrej Vasik |
6ee11a |
exit
|
|
Tim Waugh |
093300 |
endif
|
|
Tim Waugh |
093300 |
unset color_none
|
|
Ondrej Vasik |
6ee11a |
|
|
Ondrej Vasik |
6ee11a |
finish:
|
|
Ondrej Vasik |
6feaf7 |
alias ll 'ls -l --color=auto'
|
|
Ondrej Vasik |
6feaf7 |
alias l. 'ls -d .* --color=auto'
|
|
Ondrej Vasik |
6feaf7 |
alias ls 'ls --color=auto'
|