🚧 Added mycd script and cdls alias
This commit is contained in:
parent
e964d4895c
commit
d448a5f263
3 changed files with 56 additions and 19 deletions
2
aliases
2
aliases
|
|
@ -1,5 +1,5 @@
|
||||||
# Custom Aliases
|
# Custom Aliases
|
||||||
alias .="cd && ls"
|
alias cdls="source mycd"
|
||||||
alias {les,less,more}="moar -wrap -no-statusbar -style friendly" # -no-linenumbers"
|
alias {les,less,more}="moar -wrap -no-statusbar -style friendly" # -no-linenumbers"
|
||||||
alias {rg,grep}="rg -i --colors 'match:fg:blue' --colors 'line:fg:blue'" # -N
|
alias {rg,grep}="rg -i --colors 'match:fg:blue' --colors 'line:fg:blue'" # -N
|
||||||
alias {drag,rdrag}="ripdrag"
|
alias {drag,rdrag}="ripdrag"
|
||||||
|
|
|
||||||
14
scripts/mycd
Executable file
14
scripts/mycd
Executable file
|
|
@ -0,0 +1,14 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# TODO: add dependency check for eza, otherwise use ls
|
||||||
|
|
||||||
|
# ls after cd
|
||||||
|
function mycd {
|
||||||
|
if [ -z "$1" ]; then
|
||||||
|
builtin cd && eza --icons
|
||||||
|
else
|
||||||
|
builtin cd "$1" && eza --icons
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
mycd "$@"
|
||||||
|
|
@ -12,8 +12,7 @@ txtyellow=${txtbld}$(tput setaf 3)
|
||||||
txtwhite=${txtbld}$(tput setaf 7)
|
txtwhite=${txtbld}$(tput setaf 7)
|
||||||
|
|
||||||
# Dependency check
|
# Dependency check
|
||||||
function dependencycheck()
|
function dependencycheck() {
|
||||||
{
|
|
||||||
numdependencies="$#"
|
numdependencies="$#"
|
||||||
dependencies=("$@")
|
dependencies=("$@")
|
||||||
missingdependencies=0
|
missingdependencies=0
|
||||||
|
|
@ -37,7 +36,8 @@ dependencycheck echo sed
|
||||||
echo "${txtgreen}xtract: a simple shell script for decompressing common file formats"
|
echo "${txtgreen}xtract: a simple shell script for decompressing common file formats"
|
||||||
|
|
||||||
# Reset output style
|
# Reset output style
|
||||||
tput bold & tput setaf 7
|
tput bold &
|
||||||
|
tput setaf 7
|
||||||
|
|
||||||
# Simply copy and paste, changing extension string and extraction method below
|
# Simply copy and paste, changing extension string and extraction method below
|
||||||
if [ "${1}" == "-tar" ]; then
|
if [ "${1}" == "-tar" ]; then
|
||||||
|
|
@ -138,3 +138,26 @@ if [[ "${1}" == "-brotli" || "${1}" == "-br" ]] ; then
|
||||||
echo ".br decompression finished!${txtwhite}"
|
echo ".br decompression finished!${txtwhite}"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
## Taken from reddit for future refactoring of this script:
|
||||||
|
# function extract()
|
||||||
|
# {
|
||||||
|
# if [ -f $1 ] ; then
|
||||||
|
# case $1 in
|
||||||
|
# *.tar.bz2) tar xvjf $1 ;;
|
||||||
|
# *.tar.gz) tar xvzf $1 ;;
|
||||||
|
# *.bz2) bunzip2 $1 ;;
|
||||||
|
# *.rar) unrar x $1 ;;
|
||||||
|
# *.gz) gunzip $1 ;;
|
||||||
|
# *.tar) tar xvf $1 ;; # NOTE: all calls to tar can be combined (will read automatically)
|
||||||
|
# *.tbz2) tar xvjf $1 ;;
|
||||||
|
# *.tgz) tar xvzf $1 ;;
|
||||||
|
# *.zip) unzip $1 ;;
|
||||||
|
# *.Z) uncompress $1 ;;
|
||||||
|
# *.7z) 7z x $1 ;;
|
||||||
|
# *) echo "'$1' cannot be extracted via >extract<" ;;
|
||||||
|
# esac
|
||||||
|
# else
|
||||||
|
# echo "'$1' is not a valid file!"
|
||||||
|
# fi
|
||||||
|
# }
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue