Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Evaluate XDG_CONFIG_HOME according to XDG Base Directory Specification #68

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions sensible.tmux
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down