t script change workspace variable

This commit is contained in:
thek4n 2024-11-05 17:29:17 +03:00
parent f657e8be74
commit 7a86d25fb4
2 changed files with 5 additions and 5 deletions

View File

@ -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 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 mp4='vlc'
alias -s mp3='audacious' alias -s mp3='audacious'

View File

@ -8,7 +8,7 @@ set -o nounset
readonly EXIT_SUCCESS=0 readonly EXIT_SUCCESS=0
readonly NOTES_DIR_BASE="${HOME}/.t" 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')" TAB="$(printf -- '\t')"
readonly TAB readonly TAB
@ -34,8 +34,8 @@ cmd_help() {
NAMESPACES NAMESPACES
t namespaces # show namespaces t namespaces # show namespaces
NS=work t a fix bug 211 # add note in workspace 'work' ns=work t a fix bug 211 # add note in workspace 'work'
NS=work t # show notes in workspace 'work'" ns=work t # show notes in workspace 'work'"
} }
@ -61,6 +61,8 @@ show_notes_with_indexes() {
note_lines="$(wc -l < "${note}")" note_lines="$(wc -l < "${note}")"
if [ "${note_lines}" -gt 70 ]; then if [ "${note_lines}" -gt 70 ]; then
note_lines="..." note_lines="..."
elif [ "${note_lines}" -eq 0 ]; then
note_lines="-"
fi fi
printf -- '[%d]\t%s\t(%s)\n' "${index}" "$(basename -- "${note}")" "${note_lines}" printf -- '[%d]\t%s\t(%s)\n' "${index}" "$(basename -- "${note}")" "${note_lines}"