From 6d1c617fc4a691f3123e905b698395ebcc71e56b Mon Sep 17 00:00:00 2001 From: Dmitry Voronin Date: Wed, 6 Mar 2024 20:52:06 +0300 Subject: [PATCH] Tmux : Customize status bar. --- module/common/Environment.nix | 3 +++ module/common/Nvim.nix | 2 +- module/common/bash/module/Util.sh | 5 +++++ module/common/nvim/key/Colorscheme.lua | 1 + module/common/nvim/plugin/Lualine.lua | 2 +- module/common/tmux/tmux.conf | 22 +++++++++++++++------- 6 files changed, 26 insertions(+), 9 deletions(-) diff --git a/module/common/Environment.nix b/module/common/Environment.nix index e9306709..72505d33 100644 --- a/module/common/Environment.nix +++ b/module/common/Environment.nix @@ -14,5 +14,8 @@ # Nix. NIX_CURRENT_SYSTEM = "${pkgs.stdenv.system}"; + + # Shell. + TERM = "screen-256color"; }; } diff --git a/module/common/Nvim.nix b/module/common/Nvim.nix index 16d81d09..e665d0fa 100644 --- a/module/common/Nvim.nix +++ b/module/common/Nvim.nix @@ -41,13 +41,13 @@ in { lua dofile("${nvimSrc}/plugin/Filetree.lua") lua dofile("${nvimSrc}/plugin/lsp/Rust.lua") lua dofile("${nvimSrc}/plugin/lsp/Tex.lua") + lua dofile("${nvimSrc}/plugin/Gruvbox.lua") lua dofile("${nvimSrc}/plugin/Bufferline.lua") lua dofile("${nvimSrc}/plugin/Lualine.lua") lua dofile("${nvimSrc}/plugin/Autoclose.lua") lua dofile("${nvimSrc}/plugin/Gitsigns.lua") lua dofile("${nvimSrc}/plugin/Trouble.lua") lua dofile("${nvimSrc}/plugin/Tokyonight.lua") - lua dofile("${nvimSrc}/plugin/Gruvbox.lua") lua dofile("${nvimSrc}/plugin/Closebuffers.lua") lua dofile("${nvimSrc}/plugin/Telescope.lua") lua dofile("${nvimSrc}/plugin/Todo.lua") diff --git a/module/common/bash/module/Util.sh b/module/common/bash/module/Util.sh index 3b8bea71..4c6cedd7 100644 --- a/module/common/bash/module/Util.sh +++ b/module/common/bash/module/Util.sh @@ -126,3 +126,8 @@ function _is_tmux() { function _is_root() { [[ "${UID}" = 0 ]] } + +# Ring a bell. +function _bell() { + echo -e '\a' +} diff --git a/module/common/nvim/key/Colorscheme.lua b/module/common/nvim/key/Colorscheme.lua index 0ad99fd4..374fe32d 100644 --- a/module/common/nvim/key/Colorscheme.lua +++ b/module/common/nvim/key/Colorscheme.lua @@ -15,6 +15,7 @@ function toggle_light() elseif vim.o.background == "dark" then vim.o.background = "light" end + -- require("lualine").setup() end rekey_normal("[", "lua toggle_contrast()") diff --git a/module/common/nvim/plugin/Lualine.lua b/module/common/nvim/plugin/Lualine.lua index 3029c4bb..f845498e 100644 --- a/module/common/nvim/plugin/Lualine.lua +++ b/module/common/nvim/plugin/Lualine.lua @@ -1,6 +1,6 @@ require("lualine").setup { options = { - -- theme = "ayu_mirage", + theme = "gruvbox", icons_enabled = true, component_separators = { left = "", right = ""}, section_separators = { left = "", right = ""}, diff --git a/module/common/tmux/tmux.conf b/module/common/tmux/tmux.conf index 162c9eba..4fc5e072 100644 --- a/module/common/tmux/tmux.conf +++ b/module/common/tmux/tmux.conf @@ -65,18 +65,21 @@ set -g status-position bottom set -g status-justify left set -g status-style 'bg=color236 fg=color230' -set -g status-left ' #[bold]#H-#S #(count=$(tmux list-clients -t #S | wc -l); [ ${count} -gt 1 ] && echo "(${count}) ")' +set -g status-left '#[bold,bg=color143,fg=color236] #H-#S #(count=$(tmux list-clients -t #S | wc -l); [ ${count} -gt 1 ] && echo "(${count}) ")#[bg=color236,fg=color143]' set -g status-left-length 50 -set -g status-right ' #(head -c -1 /sys/class/power_supply/BAT*/capacity 2> /dev/null && echo -n "% ")#[fg=color144,bg=color236] %Y-%m-%d #[bg=color144,fg=color236,bold] %H:%M ' +set -g status-right ' #(head -c -1 /sys/class/power_supply/BAT*/capacity 2> /dev/null && echo -n "% ")#[fg=color187,bg=color236] %Y-%m-%d #[fg=color143]#[bg=color143,fg=color236,bold] %H:%M ' set -g status-right-length 50 -setw -g window-status-current-style 'fg=color236 bg=color184 bold' -setw -g window-status-current-format ' #[fg=color236]#W#[fg=color236]#F ' +set-window-option -g window-status-separator '' -setw -g window-status-style 'fg=color236 bg=color144' -setw -g window-status-format ' #[fg=color236]#W#[fg=color236] ' +setw -g window-status-current-style 'fg=color187 bg=color236 bold italics' +setw -g window-status-current-format ' #W ' -setw -g window-status-bell-style 'fg=color236 bg=color144 bold' +setw -g window-status-style 'fg=color187 bg=color236' +setw -g window-status-format ' #W ' + +set-window-option -g visual-bell off +setw -g window-status-bell-style 'bold blink' # Create new window. bind -n M-Escape new-window -c "#{pane_current_path}" @@ -93,3 +96,8 @@ bind -n M-q previous-window # Move window. bind -n M-E swap-window -t +1\; select-window -t +1 bind -n M-Q swap-window -t -1\; select-window -t -1 + +# Env. +set-option -g default-terminal "tmux-256color" +set-option -g focus-events on +set-option -sa terminal-features 'RGB'