config/shell: adjust to debian

This commit is contained in:
xeruf 2021-09-21 20:51:19 +00:00
parent 156ff8784d
commit 5834f62a55
5 changed files with 7 additions and 6 deletions

View File

@ -1,6 +1,7 @@
which apt >/dev/null || return 0
which fd >/dev/null || alias fd='fdfind'
which bat >/dev/null || alias bat='batcat'
addalternative() {
sudo update-alternatives --install /usr/bin/$1 $1 "$(which "$1$2")" 1

View File

@ -14,7 +14,7 @@ tput setaf 4 && $elevate file -E "$last" | ( grep -v --color=never 'directory$'
case "$($elevate file --dereference --mime "$last")" in
*inode/directory*) tput sgr0 && $(test -x "$last" || echo "sudo") ls -l --color=always --human-readable --group-directories-first --file-type --dereference-command-line --all "$@" | less -XF;;
*binary) ;;
*) $elevate bat --style header --force-colorization "$@" | less -XF
*) $elevate bat --style header --color always "$@" | less -XF
tput setaf 3 && $elevate stat --format '%A size %sB, birth: %.10w mod %.10y' "$last"
;;
esac

View File

@ -4,8 +4,8 @@ alias dedup='awk '"'"'!a[$0]++'"'"
listconf() {
{ cat "$conf_cache";
fd --hidden --type file --size -1m --max-depth 1 . ~;
find "${XDG_CONFIG_HOME:-$HOME/.config}" /etc /var/lib/postgres -maxdepth 4 -follow -type f -readable -exec grep -lI '' {} + 2>/dev/null; } | dedup
$(which fd || echo fdfind) --hidden --type file --size -1m --max-depth 1 . ~;
find "${XDG_CONFIG_HOME:-$HOME/.config}" /etc /var/lib/postgres /var/lib/pleroma -maxdepth 4 -follow -type f -readable -exec grep -lI '' {} + 2>/dev/null; } | dedup
}
conf_cache_dir="${XDG_CACHE_HOME:-$HOME/.cache}/edconf"

View File

@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
set -o pipefail
upCount=$(git rev-list --count HEAD...@{push} 2>/dev/null)
count=$(expr ${upCount:-0} + 3 \& ${upCount:-0} \> 3 \| 6)

View File

@ -46,7 +46,7 @@ export CONFIG_SHELLS="$XDG_CONFIG_HOME/shell"
# environment
which nvim >/dev/null && export EDITOR='nvim' || export EDITOR='vim'
export LESS='--RAW-CONTROL-CHARS --ignore-case --incsearch --LONG-PROMPT --jump-target=5'
export LESS="--RAW-CONTROL-CHARS --ignore-case --LONG-PROMPT --jump-target=5 $(test $(less --version | head -1 | cut -f2 -d' ') -ge 590 && echo --incsearch)"
export IGNOREDIRS="-x dev -x .sync -x .stfolder -x .git -x .gradle -x .idea -x out -x *build -x dist_newstyle -x generated -x cache -x node_modules"
# red stderr
test -f "/usr/lib/libstderred.so" && export LD_PRELOAD="/usr/lib/libstderred.so${LD_PRELOAD:+:$LD_PRELOAD}"