Skip to content

Commit

Permalink
Merge pull request #993 from infokiller/fix-tmuxp-custom-dir
Browse files Browse the repository at this point in the history
tmuxp: fix using workspace dirs other than ~/.tmuxp
  • Loading branch information
syohex committed Feb 6, 2023
2 parents 874bd4d + e936451 commit 828fe2b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/_tmuxp
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,18 @@ __tmuxp_load() {
# Can't get the options to be recognized when there are sessions that has
# a dash.

local tmuxp_dir="${HOME}/.tmuxp"
local tmuxp_xdg_dir="${XDG_CONFIG_HOME:-${HOME}/.config}"
if [[ -d "${TMUXP_CONFIGDIR-}" ]]; then
tmuxp_dir="${TMUXP_CONFIGDIR}"
elif [[ -d "${tmuxp_xdg_dir}" ]]; then
tmuxp_dir="${tmuxp_xdg_dir}"
fi
case $state in
(sessions)
local s
_alternative \
'sessions-user:user session:compadd -F line - ~/.tmuxp/*.(json|yml|yaml)(:r:t)' \
'sessions-user:user session:compadd -F line - ${tmuxp_dir}/*.(json|yml|yaml)(:r:t)' \
'sessions-other:session in current directory:_path_files -/ -g "**/.tmuxp.(yml|yaml|json)"' \
'sessions-other:session in current directory:_path_files -g "*.(yml|yaml|json)"'
;;
Expand Down

0 comments on commit 828fe2b

Please sign in to comment.