From 998fabe4f9b89134689dfb89d154e1cc86d6cc86 Mon Sep 17 00:00:00 2001 From: xeruf <27jf@pm.me> Date: Tue, 10 May 2022 09:25:01 +0200 Subject: [PATCH] config/shell: env adjustments --- .config/shell/functions | 3 ++- .local/bin/scripts/b | 5 ++++- .local/bin/scripts/rd | 2 +- .zshenv | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.config/shell/functions b/.config/shell/functions index 4849e07..0a135bb 100644 --- a/.config/shell/functions +++ b/.config/shell/functions @@ -35,7 +35,8 @@ if test -d "$DATA"; then d2=$(builtin cd $DATA/2* && pwd) d3=$(builtin cd $DATA/3* && pwd) d4=$(builtin cd $DATA/4* && pwd) - dd="$d4/downloads" + d5=$(builtin cd $DATA/5* && pwd) + dd="$d5/downloads" fi 2>/dev/null ulimit -c unlimited # Enable core dumps diff --git a/.local/bin/scripts/b b/.local/bin/scripts/b index 12dc2a0..a5ab434 100755 --- a/.local/bin/scripts/b +++ b/.local/bin/scripts/b @@ -49,7 +49,10 @@ for arg; do case "$arg" in (-*) flags="$flags $arg"; continue;; esac checkperm "$arg" if ! $elevate test -e "$arg" - then echo "File not found: '$arg'" 1>&2 + then if test -h "$arg" + then fileinfo "$arg" + else echo "File not found: '$arg'" 1>&2 + fi continue fi grid=$(expr $(tput cols) / \( 25 - \( $# / 2 \) \& $# \< 30 \| 5 \)) # TODO reduce grid when many PDFs diff --git a/.local/bin/scripts/rd b/.local/bin/scripts/rd index ce89e80..c75d719 100755 --- a/.local/bin/scripts/rd +++ b/.local/bin/scripts/rd @@ -11,7 +11,7 @@ do read answer test "$answer" = "y" && $elevate rm -rf "$f" && - exit + continue fi $elevate find "$f" -maxdepth $(expr 1 \& "$f" = "/" \| 5 \& $# \> 0 \| 4) -type d -empty -name .stfolder -exec rm -div {} \; diff --git a/.zshenv b/.zshenv index e673623..43b7878 100644 --- a/.zshenv +++ b/.zshenv @@ -68,7 +68,7 @@ which nvim >/dev/null && export EDITOR='nvim' || export EDITOR='vim' export LESS="--RAW-CONTROL-CHARS --ignore-case --LONG-PROMPT --jump-target=5 $(test $(less --version | head -1 | cut -f2 -d' ') -ge 590 && echo --incsearch)" # TODO put into config file and use --exclude-from export DIRS_GENERATED="-x generated -x .gradle -x cmake_build -x dist-newstyle -x node_modules -x __pycache__" -export DIRS_IGNORE_SAFE="-x .cache -x .cpan -x *Cache -x .pyenv -x .local/cache -x share/baloo -x share/cabal -x share/cargo -x share/digikam -x share/gem -x share/JetBrains -x share/tldr -x share/syncthing -x share/Steam/ubuntu* -x share/Steam/package -x share/virtualenv -x share/Zeal -x state/gradle -x state/android -x Ferdi/Partitions -x oh-my-zsh -x wine/drive_c/windows $DIRS_GENERATED" +export DIRS_IGNORE_SAFE="-x .cache -x .cpan -x *Cache -x .pyenv -x .local/cache -x share/baloo -x share/cabal -x share/cargo -x share/digikam -x share/gem -x share/JetBrains -x share/tldr -x share/syncthing -x share/Steam/ubuntu* -x share/Steam/package -x share/virtualenv -x share/Zeal -x state/gradle -x state/android -x Ferdi/Partitions -x oh-my-zsh -x wine/drive_c/windows -x vendor/cache $DIRS_GENERATED" export DIRS_IGNORE="-x .sync -x .stfolder -x *build -x .git -x .idea -x env -x out -x cache -x Partitions $DIRS_IGNORE_SAFE" # red stderr test -f "/usr/lib/libstderred.so" && export LD_PRELOAD="/usr/lib/libstderred.so${LD_PRELOAD:+:$LD_PRELOAD}"