From 751f421d59849e8940a29702e4a04b5c08342211 Mon Sep 17 00:00:00 2001 From: xeruf <27jf@pm.me> Date: Tue, 4 Oct 2022 09:24:23 +0200 Subject: [PATCH] config/shell: slight adjustments --- .config/shell/functions | 2 +- .local/bin/scripts/help | 2 +- .local/bin/scripts/netkeeper | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.config/shell/functions b/.config/shell/functions index 8f5aeb0..3deb7d2 100644 --- a/.config/shell/functions +++ b/.config/shell/functions @@ -102,7 +102,7 @@ pathadd() { # ZSH completion and stuff {{{1 alias rs="reset && source $HOME/.zshenv && exec $SHELL" -alias hist='print -z $(history | grep -v "killm " | tac | fzf --tiebreak=index --bind='"'"'del:execute(sed "\;$(echo {4..})$d" -i.bak $HISTFILE)'"'"' | sed "s|^ \+||" | cut -d" " -f5-)' +alias hist='print -z $(history | grep -v -e "killm " -e "netkeeper " | tac | fzf --tiebreak=index --bind='"'"'del:execute(sed "\;$(echo {4..})$d" -i.bak $HISTFILE)'"'"' | sed "s|^ \+||" | cut -d" " -f5-)' alias es='edit-shell' alias ec='edit-config' diff --git a/.local/bin/scripts/help b/.local/bin/scripts/help index 1722e7d..7c5ccff 100755 --- a/.local/bin/scripts/help +++ b/.local/bin/scripts/help @@ -40,7 +40,7 @@ case "$cmd" in showinfo zsh $(test "$last" != zsh && echo "$last") || LESS="$LESS +/^ *$last *\\[" man zshall;; (*) showinfo "$@" || man "$@" || return=$? - if test "$return" -gt 0 && which "$cmd" >/dev/null + if test "${return:-0}" -gt 0 && which "$cmd" >/dev/null then { unbuffer "$@" --help || { test $? == 1 && "$@" -help; } || { test $? == 1 && "$@" -h; }; } 2>&1 | $paginate return=$? fi;; diff --git a/.local/bin/scripts/netkeeper b/.local/bin/scripts/netkeeper index 1d090c6..ade9442 100755 --- a/.local/bin/scripts/netkeeper +++ b/.local/bin/scripts/netkeeper @@ -7,6 +7,6 @@ if test -e "$JOURNAL"; then done jrnl intentions "$intention" sudo nft flush chain inet filter outall - sudo nft add rule inet filter outall meta hour "$(date +%H:%M)"-"$(date +%H:%M --date="${1:-5}min")" accept + sudo nft add rule inet filter outall meta hour "$(date +%H:%M)"-"$(date +%H:%M --date="${1:-10}min")" accept #expr \( "$1" \> 40 \) \* 10 \| "$1" fi