From 7a86d25fb4f6ce35932a482ae5560e0590fcbccf Mon Sep 17 00:00:00 2001 From: thek4n Date: Tue, 5 Nov 2024 17:29:17 +0300 Subject: [PATCH] t script change workspace variable --- home/user/.config/zsh/aliases | 2 -- home/user/.local/bin/t | 8 +++++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/home/user/.config/zsh/aliases b/home/user/.config/zsh/aliases index c0c48ff..58a7efc 100644 --- a/home/user/.config/zsh/aliases +++ b/home/user/.config/zsh/aliases @@ -173,8 +173,6 @@ alias -g RED='2> >(while read line; do printf "\033[0;31m${line}\033[0m\n"; done alias -g BEEP='&& beep -f 800 -l 250 -n -f 1000 -l 500 || beep -f 800 -l 250 -n -f 500 -l 500' -alias -g NSW='NS=work' - alias -s mp4='vlc' alias -s mp3='audacious' diff --git a/home/user/.local/bin/t b/home/user/.local/bin/t index 5e2d098..aef5ed8 100755 --- a/home/user/.local/bin/t +++ b/home/user/.local/bin/t @@ -8,7 +8,7 @@ set -o nounset readonly EXIT_SUCCESS=0 readonly NOTES_DIR_BASE="${HOME}/.t" -readonly NOTES_DIR="${NOTES_DIR_BASE}/${NS:-default}" +readonly NOTES_DIR="${NOTES_DIR_BASE}/${ns:-default}" TAB="$(printf -- '\t')" readonly TAB @@ -34,8 +34,8 @@ cmd_help() { NAMESPACES t namespaces # show namespaces - NS=work t a fix bug 211 # add note in workspace 'work' - NS=work t # show notes in workspace 'work'" + ns=work t a fix bug 211 # add note in workspace 'work' + ns=work t # show notes in workspace 'work'" } @@ -61,6 +61,8 @@ show_notes_with_indexes() { note_lines="$(wc -l < "${note}")" if [ "${note_lines}" -gt 70 ]; then note_lines="..." + elif [ "${note_lines}" -eq 0 ]; then + note_lines="-" fi printf -- '[%d]\t%s\t(%s)\n' "${index}" "$(basename -- "${note}")" "${note_lines}"