Evaluate XDG_CONFIG_HOME according to XDG Base Directory Specification

pull/68/head
Peglah 2024-01-12 13:55:06 +01:00
parent 25cb91f42d
commit aaa66d4e15
1 changed files with 9 additions and 3 deletions

View File

@ -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
}