diff --git a/.config/shell/functions b/.config/shell/functions index 3b8c175..22f1c9a 100644 --- a/.config/shell/functions +++ b/.config/shell/functions @@ -6,7 +6,7 @@ alias -g G="| grp" alias -g X="| xargs" alias -g X1="| xargs -n 1" alias -g XC="| xclip -selection clipboard" -alias -g L="--color=always | less" +alias -g L="--color=always | ${PAGER:-less}" fi alias info='info --vi-keys' diff --git a/.local/bin/scripts/b b/.local/bin/scripts/b index 9a5b391..51b4b43 100755 --- a/.local/bin/scripts/b +++ b/.local/bin/scripts/b @@ -12,5 +12,5 @@ case "$(file --dereference --mime "$last")" in *inode/directory*) ls -l --color=always --human-readable --group-directories-first --file-type --dereference-command-line --almost-all "$@";; *binary) ;; *) $(test -f "$last" -a ! -r "$last" && echo "sudo") bat --style header "$@" - stat -c '%A size %sB, birth: %.10w mod %.10y' "$last";; + stat --format '%A size %sB, birth: %.10w mod %.10y' "$last";; esac diff --git a/.local/bin/scripts/ex b/.local/bin/scripts/ex index 4fabf60..35f4657 100755 --- a/.local/bin/scripts/ex +++ b/.local/bin/scripts/ex @@ -12,7 +12,7 @@ for arg do *.tar) tar xf "$arg" ;; *.tbz2) tar xjf "$arg" ;; *.tgz) tar xzf "$arg" ;; - *.zip) unzip "$arg" ;; + *.zip|*.jar) unzip "$arg" ;; *.Z) uncompress "$arg";; *.7z) 7z x "$arg" ;; *.deb) ar x "$arg" ;; diff --git a/.local/bin/scripts/st-diff b/.local/bin/scripts/st-diff index 8ce6c9f..4995e16 100755 --- a/.local/bin/scripts/st-diff +++ b/.local/bin/scripts/st-diff @@ -1,7 +1,12 @@ #!/bin/sh +stats() { + stat --format '%n %A size %sB, birth: %.10w mod %.10y' "$@" +} if test "$#" -gt 0 then - dif "$(st-unarchive "$1")" "$@" + orig="$(st-unarchive "$1")" + ( stats "$orig" "$1"; dif "$orig" "$@" ) | + less --RAW-CONTROL-CHARS --quit-on-intr --quit-if-one-screen test "$?" -eq "2" && exit 1 echo "y|r to restore, n|d to delete" read reply