From 97024d9d972daec4d5281fca1af1950fce4154de Mon Sep 17 00:00:00 2001 From: xeruf <27jf@pm.me> Date: Fri, 31 Mar 2023 19:10:12 +0200 Subject: [PATCH] config/shell: texmex --- .config/shell/browse | 3 ++- .config/shell/functions | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.config/shell/browse b/.config/shell/browse index 9156759..c739bef 100644 --- a/.config/shell/browse +++ b/.config/shell/browse @@ -99,6 +99,7 @@ locate-zox() { } # Switch directory heuristically using zoxide and locate d() { + # TODO do not use expr, rather test, so there can be floats test "$1" != "-" -a ! -d "$1" -a $# -eq 1 || { cd "$@" && return; } local query="$(zoxide-list "$@")" # First find out whether there is an obvious match @@ -106,7 +107,7 @@ d() { # which is not the current directory # If not select with fzf, using locate to find extra options target="$(if test -n "$query" && - expr "$(echo "$query" | sed 's| \+\([^ ]\+\).*|\1|;q')" \> 20 \& \ + echo "$(echo "$query" | sed 's| \+\([^ ]\+\).*|\1|;q')" \> 20 \& \ $(echo "$query" | sed 'N;s|/.* \([0-9]\+\)|> 10 * \1|;q' | sed 's| */.*||') >/dev/null && [[ ! "$(echo "$query" | head -1)" =~ ".*$PWD" ]] then echo "$query" | head -1 diff --git a/.config/shell/functions b/.config/shell/functions index 5607883..4d9f558 100644 --- a/.config/shell/functions +++ b/.config/shell/functions @@ -262,7 +262,7 @@ curlh() { u() { # Line below handy for users of netkeeper - sudo nft list ruleset | grep -q outall && echo "Suspending netkeeper" >&2 | echo sysupgrade | netkeeper 30 2>/dev/null + sudo nft list ruleset | grep -q outall && echo "Suspending netkeeper" >&2 | echo 'pausing netkeeper for sysupgrade' | netkeeper 30 2>/dev/null if command -v pacman >/dev/null; then if test "$(stat /etc/pacman.d/mirrorlist --printf=%y | cut -d'-' -f1-2)" != "$(date +%Y-%m)" then @@ -429,6 +429,9 @@ npm-reinstall() { # Reconnect to ONKYO since it is buggy alias onkyo='bluetoothctl disconnect 00:09:B0:1D:DC:98 && sleep 1 && bluetoothctl connect 00:09:B0:1D:DC:98' +alias pdfcon='TEXMF="" pdfjam -o $(date +%F).pdf' +alias pdfwor='TEXMF="" pdfjam -o collections/$(date +%F)_Akkorde.pdf' + # Custom tools {{{1 sedcomment() { sed -i "s/$1/#\0/" "${@:2}"; }