=====================================================================

--- New Scripts --------------------------

- i3 window manager scrypts (see --help for more info)
   - zsh/i3/create-local-font-override
   - zsh/i3/launch-or-show

--- New Features -------------------------

Now support `__select` syntax in environment files!
(see zsh/scwrypts/README.md for more detail)

--- Changes ------------------------------

- moved some rogue configuration files under the scwrypts config
   - ~/.vim/bundle/build.zsh >> ~/.config/scwrypts/vundle.zsh
   - ~/.config/scwrypts/config.dotfile.zsh >> ~/.config/scwrypts/dotfiles.zsh

- __FZF, __FZF_TAIL, and __FZF_HEAD now create prompt+response logs

--- Bug Fixes ----------------------------

- zsh/config/symlinks
   - don't fail when trying to symlink a directory
   - no longer fails when trying to replace a broken symlink

- scwrypts now detects environments which are symlinked

- USAGE syntax now correctly shows the position of the '--' argument
  delimiter

support __select in env files; ignore __lower_case suffix in env files; put blank line before comments in env files

added i3 scripts
This commit is contained in:
2022-08-22 16:04:03 -06:00
parent 710d42e248
commit 22dd6f8112
13 changed files with 292 additions and 20 deletions

@@ -14,6 +14,12 @@ __CHECK_ENV_VAR() {
local VALUE=$(eval echo '$'$NAME)
[ $VALUE ] && return 0
local SELECTION_VALUES=$(eval echo '$'$NAME'__select' | sed 's/,/\n/g')
[ $SELECTION_VALUES ] && {
local SELECTION=$(echo $SELECTION_VALUES | __FZF "select a value for '$NAME'")
[ $SELECTION ] && export VALUE=$SELECTION
}
[ $VALUE ] && return 0
[ $__SCWRYPT ] && {
# scwrypts exclusive (missing vars staged in env.template)

@@ -37,7 +37,7 @@ __USAGE() {
local USAGE_LINE=$(\
echo $USAGE \
| grep -i '^ *usage *:' \
| sed "s;^[^:]*:;& scwrypts -- $SCWRYPT_NAME;" \
| sed "s;^[^:]*:;& scwrypts $SCWRYPT_NAME --;" \
| sed 's/ \{2,\}/ /g; s/scwrypts -- scwrypts/scwrypts/' \
)
local THE_REST=$(echo $USAGE | grep -vi '^ *usage *:' | sed 'N;/^\n$/D;P;D;')
@@ -85,7 +85,10 @@ __FZF() {
exit 1
}
fzf -i --height=30% --layout=reverse --prompt "$1 : " ${@:2}
local SELECTION=$(fzf -i --height=30% --layout=reverse --prompt "$1 : " ${@:2})
__PROMPT "$1"
echo $SELECTION >&2
echo $SELECTION
}
__FZF_HEAD() { __FZF $@ --print-query | sed '/^$/d' | head -n1; } # prefer user input over selected
__FZF_TAIL() { __FZF $@ --print-query | sed '/^$/d' | tail -n1; } # prefer selected over user input