Hi guys,
I've been trying to segment my stuff as per XDG guidelines and zkbd insisted on packing their output in $ZDOTDIR/.zkbd which I did'nt like.
I'd like to add a -d switch to zkbd to allow the user to specify a directory of their choosing as the output dir of zkbd.
diff --git a/Doc/Zsh/contrib.yo b/Doc/Zsh/contrib.yo index c1bea6022..3be632c9f 100644 --- a/Doc/Zsh/contrib.yo +++ b/Doc/Zsh/contrib.yo @@ -192,7 +192,8 @@ The keystrokes read by tt(zkbd) are recorded as a definition for an associative array named tt(key), written to a file in the subdirectory tt(.zkbd) within either your tt(HOME) or tt(ZDOTDIR) directory. The name of the file is composed from the tt(TERM), tt(VENDOR) and tt(OSTYPE) -parameters, joined by hyphens. +parameters, joined by hyphens. This may be overridden with the option tt(-d) +if you plan to keep it elsewhere: tt(zkbd -d /path/to/zkbd). You may read this file into your tt(.zshrc) or another startup file with the `tt(source)' or `tt(.)' commands, then reference the tt(key) parameter diff --git a/Functions/Misc/zkbd b/Functions/Misc/zkbd index 1065a84f1..7b9d5b8c4 100644 --- a/Functions/Misc/zkbd +++ b/Functions/Misc/zkbd @@ -11,7 +11,9 @@ emulate -RL zsh local zkbd term key seq -zkbd=${ZDOTDIR:-$HOME}/.zkbd +zparseopts -D -F -- d:=rawdir || return 1 +[[ -n "$rawdir" ]] && zkbd="${rawdir[2]}" +[[ ! -d "$zkbd" ]] && zkbd="${ZDOTDIR:-$HOME}/.zkbd" [[ -d $zkbd ]] || mkdir $zkbd || return 1 trap 'unfunction getmbkey getseq; command rm -f $zkbd/$TERM.tmp' 0
|