bin: improve many sctipts, add dif & bak
This commit is contained in:
parent
d93f38bb93
commit
d6e07da75e
|
@ -11,6 +11,6 @@ test -e "$last" || exit 1
|
||||||
case "$(file --dereference --mime "$last")" in
|
case "$(file --dereference --mime "$last")" in
|
||||||
*inode/directory*) ls -l --color=always --human-readable --group-directories-first --file-type --dereference-command-line --almost-all "$@";;
|
*inode/directory*) ls -l --color=always --human-readable --group-directories-first --file-type --dereference-command-line --almost-all "$@";;
|
||||||
*binary) ;;
|
*binary) ;;
|
||||||
*) $(test -f "$last" -a ! -r "$last") bat --style header "$@";;
|
*) $(test -f "$last" -a ! -r "$last" && echo "sudo") bat --style header "$@"
|
||||||
|
stat -c '%A size %sB, birth: %.10w mod %.10y' "$last";;
|
||||||
esac
|
esac
|
||||||
stat -c 'Permissions: %A, Created: %.10w, Modified %.10y, Size: %s' "$last"
|
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
#!/bin/sh
|
||||||
|
test -f "$1.bak" && (mv "$1" /tmp && mv "$1.bak" "$1") || mv "$1" "$1.bak"
|
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/sh
|
||||||
|
# diff with pagination
|
||||||
|
diff --color=always "$@" | less --quit-if-one-screen
|
|
@ -16,7 +16,7 @@ if test -f $1 && test -r $1; then
|
||||||
*.7z) 7z x $1 ;;
|
*.7z) 7z x $1 ;;
|
||||||
*.deb) ar x $1 ;;
|
*.deb) ar x $1 ;;
|
||||||
*.tar.xz) tar xf $1 ;;
|
*.tar.xz) tar xf $1 ;;
|
||||||
*.tar.zst) unzstd $1 ;;
|
*.zst) unzstd $1 ;;
|
||||||
*) echo "'$1' cannot be extracted via ex()" ;;
|
*) echo "'$1' cannot be extracted via ex()" ;;
|
||||||
esac
|
esac
|
||||||
else
|
else
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
playlistPath="$MUSIC/Playlists"
|
playlistPath="$MUSIC/Playlists"
|
||||||
result="$(test "$1" && (find -L $playlistPath -iname "focus-$1.m3u8" | grep . || find -L $playlistPath -iname "$1.m3u*" | grep . || find -L $MUSIC -iname "*$1*") | head -1 || echo "$playlistPath/focus.m3u8" )"
|
test -z "$1" && vp "$playlistPath/focus.m3u8" ||
|
||||||
test "$result" && vp "$result"
|
(find -L $playlistPath -iname "focus-$1.m3u8" -print0 | grep --null-data . ||
|
||||||
|
find -L $playlistPath -iname "$1.m3u*" -print0 | grep --null-data . ||
|
||||||
|
find -L $MUSIC -iname "*$1*" -prune -exec find {} -size +2M -type f -not -iregex ".*.\(jpe?g\|png\)" -print0 \;) |
|
||||||
|
xargs -0 vp
|
||||||
|
|
BIN
.local/bin/tn
BIN
.local/bin/tn
Binary file not shown.
Loading…
Reference in New Issue