automate/020_lsd.sh

43 lines
2.1 KiB
Bash
Executable File

#!/usr/bin/env bash
PREFIX=/tmp
NAME=lsd
PROJECT=Peltoche/lsd
RELEASE=$(curl -s https://api.github.com/repos/${PROJECT}/releases/latest | grep tarball_url | cut -d '"' -f 4 | awk -F "/" {'print $8'})
wget -c -P ${PREFIX} https://github.com/${PROJECT}/releases/download/${RELEASE}/${NAME}_${RELEASE}_amd64.deb
dpkg -i ${PREFIX}/${NAME}_${RELEASE}_amd64.deb
apt-get -f install
# Aliases
#FLAGS
# -a, --all Do not ignore entries starting with .
# --classic Enable classic mode (no colors or icons)
# --help Prints help information
# -h, --human-readable For ls compatibility purposes ONLY, currently set by default
# -F, --classify Append indicator (one of */=>@|) at the end of the file names
# -l, --long Display extended file metadata as a table
# -1, --oneline Display one entry per line
# -R, --recursive Recurse into directories
# -r, --reverse Reverse the order of the sort
# -t, --timesort Sort by time modified
# --tree Recurse into directories and present the result as a tree
# -V, --version Prints version information
#OPTIONS:
# --color <color>... When to use terminal colours [default: auto] [possible values: always, auto, never]
# --date <date>... How to display date [default: date] [possible values: date, relative]
# --depth <num> Stop recursing into directories after reaching specified depth
# --group-dirs <group-dirs>... Sort the directories then the files [default: none] [possible values: none, first, last]
# --icon <icon>... When to print the icons [default: auto] [possible values: always, auto, never]
# --icon-theme <icon-theme>... Whether to use fancy or unicode icons [default: fancy] [possible values: fancy, unicode]
mkdir -p ~/.zsh_aliases.d/
ALIAS_FILE=~/.zsh_aliases.d/003-lsd.sh
cat > ${ALIAS_FILE} <<'EOF'
if [ -x /usr/bin/lsd ]; then
alias lsd="/usr/bin/lsd"
# alias ls="lsd"
fi
EOF