diff --git a/.config/shell/functions b/.config/shell/functions index 365af5d..3a49724 100644 --- a/.config/shell/functions +++ b/.config/shell/functions @@ -139,6 +139,7 @@ alias tw='timew' twsm() { timew summary $(date --date="Monday $1 week ago" -I) to tomorrow :ids ${@:2} } alias twtest='( cp -r "$TIMEWARRIORDB" /tmp/tw-bak && TIMEWARRIORDB=/tmp/timewarriordb-test/$(date +%s) && mkdir -p "$TIMEWARRIORDB"/data && :> "$TIMEWARRIORDB"/timewarrior.cfg && $SHELL )' +alias expr='noglob expr' alias lst='( last; last -f /var/log/wtmp.1 ) | grep -v "pts/" | tac | less +G' alias lar='last | tac' diff --git a/.local/bin/scripts/bak b/.local/bin/scripts/bak index 24ddead..2e1119d 100755 --- a/.local/bin/scripts/bak +++ b/.local/bin/scripts/bak @@ -1,3 +1,10 @@ #!/bin/sh suffix="${2:-bak}" -test -e "$1.$suffix" && ((test -e "$1" && mv -v "$1" /tmp); mv -vn "$1.$suffix" "$1") || mv -vn "$1" "$1.$suffix" +orig="${1%%.$suffix}" +echo $orig +if test -e "$orig.$suffix" +then + test -e "$orig" && mv -v "$orig" /tmp + mv -vn "$orig.$suffix" "$orig" +else mv -vn "$1" "$1.$suffix" +fi diff --git a/.local/bin/scripts/st b/.local/bin/scripts/st index bc0e111..6dc843f 100755 --- a/.local/bin/scripts/st +++ b/.local/bin/scripts/st @@ -5,8 +5,11 @@ if test -f "$subscript" then shift && $subscript "$@" else apikey=$(grep apikey $XDG_CONFIG_HOME/syncthing/config.xml | cut -d '>' -f2 | cut -d '<' -f1) + parseargs() { + echo hi + } case "$1" in - (browse|need) + (browse|completion|file|ignores|need|status) for arg in "${@:2}" do case "$arg" in ([0-9]) depth=$arg;; (*) path="$arg";; esac done