diff --git a/local/share/dark-mode.d/tmux.sh b/local/share/dark-mode.d/tmux.sh index be91e69..4091e75 100755 --- a/local/share/dark-mode.d/tmux.sh +++ b/local/share/dark-mode.d/tmux.sh @@ -1,7 +1,10 @@ -#!/bin/bash +#!/usr/bin/env bash +CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}" +set -euo pipefail +BASE="$(dirname $0)/../../.." -ln -fs dark-mode.conf ~/.config/tmux/current-theme.conf +ln -fvs "${BASE}/config/tmux/dark-mode.conf" "${CONFIG_HOME}/tmux/current-theme.conf" if tmux list-sessions; then - tmux source ~/.tmux.conf + tmux source "${CONFIG_HOME}/tmux/tmux.conf" fi diff --git a/local/share/light-mode.d/tmux.sh b/local/share/light-mode.d/tmux.sh index 401033a..668a849 100755 --- a/local/share/light-mode.d/tmux.sh +++ b/local/share/light-mode.d/tmux.sh @@ -1,7 +1,10 @@ -#!/bin/bash +#!/usr/bin/env bash +CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}" +set -eou pipefail +BASE="$(dirname $0)/../../.." -ln -fs light-mode.conf ~/.config/tmux/current-theme.conf +ln -fvs "${BASE}/config/tmux/light-mode.conf" "${CONFIG_HOME}/tmux/current-theme.conf" if tmux list-sessions; then - tmux source ~/.tmux.conf + tmux source "${CONFIG_HOME}/tmux/tmux.conf" fi