Add install.sh

Name the local files `.LS_COLORS` not `.dircolors`

Fixes #122
This commit is contained in:
Ryan Delaney 2020-02-10 10:58:35 -08:00
parent 4068b5e697
commit 5490a1b963
2 changed files with 30 additions and 9 deletions

View file

@ -39,18 +39,20 @@ Here's a screenshot _(font and minor color shades, of course, depend on terminal
[3]: https://aur.archlinux.org/packages/lscolors-git
# Installation
To install and use this file, put something like this in your shell resource
file:
```shell
eval $( dircolors -b $HOME/.LS_COLORS )
```
A quick way to install would be the following set of commands (assuming bash):
An installation script is provided with this repository:
```shell
wget https://raw.github.com/trapd00r/LS_COLORS/master/LS_COLORS -O $HOME/.LS_COLORS
echo 'eval $(dircolors -b $HOME/.LS_COLORS)' >> $HOME/.bashrc
. $HOME/.bashrc
$ wget https://raw.github.com/trapd00r/LS_COLORS/master/LS_COLORS -O /tmp/LS_COLORS
$ ( cd /tmp/LS_COLORS && sh /tmp/install.sh )
To enable the colors, add the following line to your shell's start-up script:
For Bourne shell (e.g. ~/.bashrc or ~/.zshrc):
. /lscolors.sh"
For C shell (e.g. ~/.cshrc):
. /lscolors.csh"
$
```
## Arch Linux

19
install.sh Executable file
View file

@ -0,0 +1,19 @@
#!/usr/bin/env sh
#
lscolors_data_dir="${XDG_DATA_HOME:-$HOME/.local/share}"
if dircolors -b LS_COLORS > lscolors.sh && dircolors -c LS_COLORS > lscolors.csh ; then
if mv -t "$lscolors_data_dir" lscolors.sh lscolors.csh ; then
cat <<EOF
To enable the colors, add the following line to your shell's start-up script:
For Bourne shell (e.g. ~/.bashrc or ~/.zshrc):
. $lscolors_data_dir/lscolors.sh"
For C shell (e.g. ~/.cshrc):
. $lscolors_data_dir/lscolors.csh
EOF
fi
fi