From aaa66d4e152709392d7a8723fdf5d7d250d7743f Mon Sep 17 00:00:00 2001 From: Peglah Date: Fri, 12 Jan 2024 13:55:06 +0100 Subject: [PATCH] Evaluate XDG_CONFIG_HOME according to XDG Base Directory Specification --- sensible.tmux | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/sensible.tmux b/sensible.tmux index 66db3c1..65da5f9 100755 --- a/sensible.tmux +++ b/sensible.tmux @@ -68,10 +68,16 @@ get_tmux_config() { local tmux_config_xdg="${XDG_CONFIG_HOME:-$HOME/.config}/tmux/tmux.conf" local tmux_config="$HOME/.tmux.conf" - if [ -f "${tmux_config_xdg}" ]; then - echo "${tmux_config_xdg}" + if [ -n "${XDG_CONFIG_HOME}" ]; then + if [ -f "${tmux_config_xdg}" ]; then + echo "${tmux_config_xdg}" + fi else - echo ${tmux_config} + if [ -f "${tmux_config}" ]; then + echo "${tmux_config}" + else + echo "$HOME/.config/tmux/tmux.conf" + fi fi }