Evaluate XDG_CONFIG_HOME according to XDG Base Directory Specification

This commit is contained in:
Peglah 2024-01-12 13:55:06 +01:00
parent 25cb91f42d
commit aaa66d4e15

View File

@ -68,10 +68,16 @@ get_tmux_config() {
local tmux_config_xdg="${XDG_CONFIG_HOME:-$HOME/.config}/tmux/tmux.conf" local tmux_config_xdg="${XDG_CONFIG_HOME:-$HOME/.config}/tmux/tmux.conf"
local tmux_config="$HOME/.tmux.conf" local tmux_config="$HOME/.tmux.conf"
if [ -f "${tmux_config_xdg}" ]; then if [ -n "${XDG_CONFIG_HOME}" ]; then
echo "${tmux_config_xdg}" if [ -f "${tmux_config_xdg}" ]; then
echo "${tmux_config_xdg}"
fi
else else
echo ${tmux_config} if [ -f "${tmux_config}" ]; then
echo "${tmux_config}"
else
echo "$HOME/.config/tmux/tmux.conf"
fi
fi fi
} }