From bff3e7d7b28488f66ae1bcd3980c6caf708dc7d6 Mon Sep 17 00:00:00 2001 From: xeruf <27jf@pm.me> Date: Mon, 16 May 2022 23:47:19 +0200 Subject: [PATCH] config/shell: bash compatibility and corrections --- .config/puddletag/puddletag.conf | 4 ++-- .config/shell/browse | 2 +- .config/shell/functions | 4 ++++ .config/user-dirs.dirs##user.janek | 2 +- .local/bin/scripts/clean | 1 + .local/bin/scripts/help | 5 +++-- 6 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.config/puddletag/puddletag.conf b/.config/puddletag/puddletag.conf index 6ff36fe..b0ef16c 100644 --- a/.config/puddletag/puddletag.conf +++ b/.config/puddletag/puddletag.conf @@ -16,7 +16,7 @@ }, "main": { "lang": "auto", - "lastfolder": "/home/janek/data/4-media/music/Mixes", + "lastfolder": "/home/janek/data/4-media/music", "maximized": false }, "playlist": { @@ -137,4 +137,4 @@ "Artist splitting" ] } -} \ No newline at end of file +} diff --git a/.config/shell/browse b/.config/shell/browse index d92d374..9c0050e 100644 --- a/.config/shell/browse +++ b/.config/shell/browse @@ -65,7 +65,7 @@ alias uloc='noglob sudo updatedb && loci' locei() { locate --all --basename "\\$1" "$@" | fselect } alias loce='noglob locei' # locate all -alias loca='noglob sudo updatedb --prunenames "" --prunefs "" --prunepaths "/var/cache" -o /var/cache/locate-all.db && loci --database /var/cache/locate-all.db' +alias loca='noglob sudo updatedb -l 0 --prunenames "" --prunefs "tmpfs sysfs debugfs" --prunepaths "/var/cache" --debug-pruning -o /var/cache/locate-all.db && loci --database /var/cache/locate-all.db' # ZOXIDE {{{1 alias c=z diff --git a/.config/shell/functions b/.config/shell/functions index 6b259df..dfcba79 100644 --- a/.config/shell/functions +++ b/.config/shell/functions @@ -156,6 +156,7 @@ alias scue='systemctl --user enable --now' alias scud='systemctl --user disable --now' # Reload or restart matching systemctl service +unalias scr 2>/dev/null scr() { echo -n "User: " systemctl --user reload-or-restart "$1" || @@ -263,6 +264,9 @@ alias mdox="xclip -o -selection clipboard | mdo | xclip -filter" alias f="fossil" alias fs="fossil status" alias fc="fossil commit -v" +fdf() { + fossil diff "$@" | diffr --colors refine-added:none:background:0x33,0x66,0x33:bold --colors added:none:background:0x33,0x44,0x33 --colors refine-removed:none:background:0x66,0x33,0x33:bold --colors removed:none:background:0x44,0x33,0x33 | less -F +} alias gdiff='git diff --word-diff=color --word-diff-regex=. --no-index' diff --git a/.config/user-dirs.dirs##user.janek b/.config/user-dirs.dirs##user.janek index adfb8c3..1c2f9c9 100644 --- a/.config/user-dirs.dirs##user.janek +++ b/.config/user-dirs.dirs##user.janek @@ -11,6 +11,6 @@ XDG_DOWNLOAD_DIR="$HOME/data/5-incubator" XDG_MUSIC_DIR="$HOME/data/4-media/music" XDG_PICTURES_DIR="$HOME/data/4-media/images" XDG_VIDEOS_DIR="$HOME/data/4-media/videos" -XDG_DOCUMENTS_DIR="$HOME/data/3-dox" +XDG_DOCUMENTS_DIR="$HOME/data/4-media/multimedia" XDG_NOTES_DIR="$HOME/data/2-box" #XDG_PUBLICSHARE_DIR="$HOME/data/3-resources/multimedia" diff --git a/.local/bin/scripts/clean b/.local/bin/scripts/clean index fda241d..7125eb3 100755 --- a/.local/bin/scripts/clean +++ b/.local/bin/scripts/clean @@ -44,6 +44,7 @@ fi highlight "d :: recursively remove development caches" if [[ $1 =~ "d" ]]; then + find -maxdepth 1 \( -name "*.aux" -o -name "*.log" -o -name "*.toc" -o -name "*.out" \) -print -delete find -name "src" -prune -o \ -type d \( -name 'cache' $(echo $DIRS_GENERATED | sed 's|-x \([^ ]\+\)|-o -name \1|g') \) \ -print -exec rm $i -r {} + -prune diff --git a/.local/bin/scripts/help b/.local/bin/scripts/help index d1c4b83..f71a0dd 100755 --- a/.local/bin/scripts/help +++ b/.local/bin/scripts/help @@ -12,7 +12,8 @@ case "$cmd" in info --vi-keys $(test "$last" != zsh && echo "--index-search=$last") zsh || LESS="$LESS +/^ *$last *\\[" man zshall;; (gh|chordpro|bat|pdfjam|reflector|topgrade|r128gain|7z|kubectl|diffr) unbuffer "$@" --help | $paginate;; - (caddy|stretchly|go|fossil) test "$cmd" = "fossil" -a $# -eq 1 && repo="$(locate -b -l 1 "fossil*.fossil")" && { fossil ui "$repo" & exit; } + (caddy|stretchly|go|fossil) test "$cmd" = "fossil" -a $# -eq 1 && repo="$(locate -b -l 1 "fossil*.fossil")" && fossil ui "$repo" && exit + # TODO view fossil ui in terminal shift "$cmd" help "$@" | $paginate;; (rails) { rails -H && rails --help; } | $paginate;; @@ -22,7 +23,7 @@ case "$cmd" in (pandoc) man pandoc; highlight "Extensions" && pandoc --list-extensions | paste -s -d' ';; (swaymsg) test $# -gt 1 && shift && man sway "$@" || man swaymsg;; (swaymsg-*) man sway "${1#swaymsg-}";; - (*) { info "$cmd" -w | grep -v "manpages" && pinfo "$@"; } || + (*) { which info >/dev/null 2>&1 && info "$cmd" -w | grep -v "manpages" && pinfo "$@"; } || man "$@" || if which "$cmd" >/dev/null then { "$@" --help || { test $? == 1 && "$@" -help; } || { test $? == 1 && "$@" -h; }; } 2>&1 | $paginate