diff options
author | aktersnurra <grydholm@kth.se> | 2021-02-11 21:40:56 +0100 |
---|---|---|
committer | aktersnurra <grydholm@kth.se> | 2021-02-11 21:40:56 +0100 |
commit | 5e8681f8e9db4614e4512d0ecff910d6e0a629a3 (patch) | |
tree | 9fb7708cf0fbd89b06e55bccecd791bf8eb4ffbb /.config/tmux/.tmux.conf | |
parent | b12967a20478efdcf11da722fbf440626abbfa8f (diff) |
updates
Diffstat (limited to '.config/tmux/.tmux.conf')
-rw-r--r-- | .config/tmux/.tmux.conf | 52 |
1 files changed, 42 insertions, 10 deletions
diff --git a/.config/tmux/.tmux.conf b/.config/tmux/.tmux.conf index 2c25fb0..41070f7 100644 --- a/.config/tmux/.tmux.conf +++ b/.config/tmux/.tmux.conf @@ -56,13 +56,45 @@ set -sg escape-time 0 # Reload tmux config bind r source-file ~/.config/tmux/.tmux.conf -# THEME -set -g status-bg black -set -g status-fg white -set -g window-status-current-bg white -set -g window-status-current-fg black -set -g window-status-current-attr bold -set -g status-interval 60 -set -g status-left-length 30 -set -g status-left '#[fg=green](#S) #(whoami)' -set -g status-right '#[fg=yellow]#(cut -d " " -f 1-3 /proc/loadavg)#[default] #[fg=white]%H:%M#[default]' + +# Nord Theme +NORD_TMUX_COLOR_THEME_FILE=src/nord.conf +NORD_TMUX_VERSION=0.3.0 +NORD_TMUX_STATUS_CONTENT_FILE="src/nord-status-content.conf" +NORD_TMUX_STATUS_CONTENT_NO_PATCHED_FONT_FILE="src/nord-status-content-no-patched-font.conf" +NORD_TMUX_STATUS_CONTENT_OPTION="@nord_tmux_show_status_content" +NORD_TMUX_NO_PATCHED_FONT_OPTION="@nord_tmux_no_patched_font" +_current_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +__cleanup() { + unset -v NORD_TMUX_COLOR_THEME_FILE NORD_TMUX_VERSION + unset -v NORD_TMUX_STATUS_CONTENT_FILE NORD_TMUX_STATUS_CONTENT_NO_PATCHED_FONT_FILE + unset -v NORD_TMUX_STATUS_CONTENT_OPTION NORD_TMUX_NO_PATCHED_FONT_OPTION + unset -v _current_dir + unset -f __load __cleanup + tmux set-environment -gu NORD_TMUX_STATUS_TIME_FORMAT +} + +__load() { + tmux source-file "$_current_dir/$NORD_TMUX_COLOR_THEME_FILE" + + local status_content=$(tmux show-option -gqv "$NORD_TMUX_STATUS_CONTENT_OPTION") + local no_patched_font=$(tmux show-option -gqv "$NORD_TMUX_NO_PATCHED_FONT_OPTION") + + if [ "$(tmux show-option -gqv "clock-mode-style")" == '12' ]; then + tmux set-environment -g NORD_TMUX_STATUS_TIME_FORMAT "%I:%M %p" + else + tmux set-environment -g NORD_TMUX_STATUS_TIME_FORMAT "%H:%M" + fi + + if [ "$status_content" != "0" ]; then + if [ "$no_patched_font" != "1" ]; then + tmux source-file "$_current_dir/$NORD_TMUX_STATUS_CONTENT_FILE" + else + tmux source-file "$_current_dir/$NORD_TMUX_STATUS_CONTENT_NO_PATCHED_FONT_FILE" + fi + fi +} + +__load +__cleanup |