From cd141d9f02db7bf714b25e83022ef71b29742227 Mon Sep 17 00:00:00 2001 From: CramMK Date: Fri, 20 Mar 2020 15:21:49 +0100 Subject: [PATCH] Add nord theme for tmux --- config.yaml | 4 ++ dotfiles/tmux/themes/nord.tmux | 43 +++++++++++++++ .../nord-status-content-no-patched-font.conf | 24 +++++++++ .../tmux/themes/src/nord-status-content.conf | 27 ++++++++++ dotfiles/tmux/themes/src/nord.conf | 53 +++++++++++++++++++ dotfiles/tmux/tmux | 4 +- 6 files changed, 154 insertions(+), 1 deletion(-) create mode 100755 dotfiles/tmux/themes/nord.tmux create mode 100644 dotfiles/tmux/themes/src/nord-status-content-no-patched-font.conf create mode 100644 dotfiles/tmux/themes/src/nord-status-content.conf create mode 100644 dotfiles/tmux/themes/src/nord.conf diff --git a/config.yaml b/config.yaml index e560b80..aa24a6e 100644 --- a/config.yaml +++ b/config.yaml @@ -54,6 +54,9 @@ dotfiles: f_tmux: src: tmux/tmux dst: ~/.tmux.conf + d_tmux_themes: + src: tmux/themes + dst: ~/.tmux/themes d_wallpaper: src: wallpaper dst: ~/.wallpaper @@ -114,6 +117,7 @@ profiles: tmux: dotfiles: - f_tmux + - d_tmux_themes wallpaper: dotfiles: - d_wallpaper diff --git a/dotfiles/tmux/themes/nord.tmux b/dotfiles/tmux/themes/nord.tmux new file mode 100755 index 0000000..200a562 --- /dev/null +++ b/dotfiles/tmux/themes/nord.tmux @@ -0,0 +1,43 @@ +#!/usr/bin/env bash +# Copyright (C) 2017-present Arctic Ice Studio +# Copyright (C) 2017-present Sven Greb + +# Project: Nord tmux +# Repository: https://github.com/arcticicestudio/nord-tmux +# License: MIT +# References: +# https://tmux.github.io + +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 +} + +__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 [ "$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 diff --git a/dotfiles/tmux/themes/src/nord-status-content-no-patched-font.conf b/dotfiles/tmux/themes/src/nord-status-content-no-patched-font.conf new file mode 100644 index 0000000..1b3eddf --- /dev/null +++ b/dotfiles/tmux/themes/src/nord-status-content-no-patched-font.conf @@ -0,0 +1,24 @@ +# Copyright (C) 2017-present Arctic Ice Studio +# Copyright (C) 2017-present Sven Greb + +# Project: Nord tmux +# Repository: https://github.com/arcticicestudio/nord-tmux +# License: MIT + +#+----------------+ +#+ Plugin Support + +#+----------------+ +#+--- tmux-prefix-highlight ---+ +set -g @prefix_highlight_copy_mode_attr "fg=black,bg=brightcyan" + +#+--------+ +#+ Status + +#+--------+ +#+--- Bars ---+ +set -g status-left "#[fg=black,bg=blue,bold] #S " +set -g status-right "#{prefix_highlight}#[fg=white,bg=brightblack] %Y-%m-%d #[fg=white,bg=brightblack,nobold,noitalics,nounderscore]|#[fg=white,bg=brightblack] %H:%M #[fg=cyan,bg=brightblack,nobold,noitalics,nounderscore] #[fg=black,bg=cyan,bold] #H " + +#+--- Windows ---+ +set -g window-status-format " #[fg=white,bg=brightblack]#I #[fg=white,bg=brightblack]#W #F" +set -g window-status-current-format " #[fg=black,bg=cyan]#I#[fg=black,bg=cyan,nobold,noitalics,nounderscore] #[fg=black,bg=cyan]#W #F" +set -g window-status-separator "" diff --git a/dotfiles/tmux/themes/src/nord-status-content.conf b/dotfiles/tmux/themes/src/nord-status-content.conf new file mode 100644 index 0000000..49e0442 --- /dev/null +++ b/dotfiles/tmux/themes/src/nord-status-content.conf @@ -0,0 +1,27 @@ +# Copyright (C) 2017-present Arctic Ice Studio +# Copyright (C) 2017-present Sven Greb + +# Project: Nord tmux +# Repository: https://github.com/arcticicestudio/nord-tmux +# License: MIT + +#+----------------+ +#+ Plugin Support + +#+----------------+ +#+--- tmux-prefix-highlight ---+ +set -g @prefix_highlight_output_prefix "#[fg=brightcyan]#[bg=black]#[nobold]#[noitalics]#[nounderscore]#[bg=brightcyan]#[fg=black]" +set -g @prefix_highlight_output_suffix "" +set -g @prefix_highlight_copy_mode_attr "fg=brightcyan,bg=black,bold" + +#+--------+ +#+ Status + +#+--------+ +#+--- Bars ---+ +#set -g status-left "#[fg=black,bg=blue,bold] #S#[fg=blue,bg=black,nobold,noitalics,nounderscore]" +set -g status-left "#[fg=black,bg=blue,bold] #S #[fg=blue,bg=black,nobold,noitalics,nounderscore]" +set -g status-right "#{prefix_highlight}#[fg=brightblack,bg=black,nobold,noitalics,nounderscore]#[fg=white,bg=brightblack] %Y-%m-%d #[fg=white,bg=brightblack,nobold,noitalics,nounderscore]#[fg=white,bg=brightblack] %H:%M #[fg=cyan,bg=brightblack,nobold,noitalics,nounderscore]#[fg=black,bg=cyan,bold] #H " + +#+--- Windows ---+ +set -g window-status-format "#[fg=black,bg=brightblack,nobold,noitalics,nounderscore] #[fg=white,bg=brightblack]#I #[fg=white,bg=brightblack,nobold,noitalics,nounderscore] #[fg=white,bg=brightblack]#W #F #[fg=brightblack,bg=black,nobold,noitalics,nounderscore]" +set -g window-status-current-format "#[fg=black,bg=cyan,nobold,noitalics,nounderscore] #[fg=black,bg=cyan]#I #[fg=black,bg=cyan,nobold,noitalics,nounderscore] #[fg=black,bg=cyan]#W #F #[fg=cyan,bg=black,nobold,noitalics,nounderscore]" +set -g window-status-separator "" diff --git a/dotfiles/tmux/themes/src/nord.conf b/dotfiles/tmux/themes/src/nord.conf new file mode 100644 index 0000000..f9aa12c --- /dev/null +++ b/dotfiles/tmux/themes/src/nord.conf @@ -0,0 +1,53 @@ +# Copyright (C) 2017-present Arctic Ice Studio +# Copyright (C) 2017-present Sven Greb + +# Project: Nord tmux +# Repository: https://github.com/arcticicestudio/nord-tmux +# License: MIT + +#+----------------+ +#+ Plugin Support + +#+----------------+ +#+--- tmux-prefix-highlight ---+ +set -g @prefix_highlight_fg black +set -g @prefix_highlight_bg brightcyan + +#+---------+ +#+ Options + +#+---------+ +set -g status-interval 1 +set -g status on + +#+--------+ +#+ Status + +#+--------+ +#+--- Layout ---+ +set -g status-justify left + +#+--- Colors ---+ +set -g status-bg black +set -g status-fg white +set -g status-attr none + +#+-------+ +#+ Panes + +#+-------+ +set -g pane-border-bg black +set -g pane-border-fg black +set -g pane-active-border-bg black +set -g pane-active-border-fg brightblack +set -g display-panes-colour black +set -g display-panes-active-colour brightblack + +#+------------+ +#+ Clock Mode + +#+------------+ +setw -g clock-mode-colour cyan + +#+----------+ +#+ Messages + +#+---------+ +set -g message-fg cyan +set -g message-bg brightblack +set -g message-command-fg cyan +set -g message-command-bg brightblack diff --git a/dotfiles/tmux/tmux b/dotfiles/tmux/tmux index 40bf88d..790cadd 100644 --- a/dotfiles/tmux/tmux +++ b/dotfiles/tmux/tmux @@ -4,7 +4,7 @@ set -g history-limit 10000 #some vi behaviour bind-key -r h select-pane -L -bind-key -r j select-pane -D +run-shell "~/.tmux/themes/nord-tmux/nord.tmux" bind-key -r j select-pane -D bind-key -r k select-pane -U bind-key -r l select-pane -R @@ -21,3 +21,5 @@ setw -g pane-base-index 1 set -g status-bg green set -g status-fg black set -g status-right '%Y.%m.%d %H:%M' + +run-shell "~/.tmux/themes/nord-tmux/nord.tmux"