From e3341005a74c93a39388cbbac812e56b4016c412 Mon Sep 17 00:00:00 2001 From: Sophie Schiller Date: Wed, 24 May 2023 23:32:40 +0200 Subject: [PATCH 1/5] the original one --- .tmux.conf | 99 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 .tmux.conf diff --git a/.tmux.conf b/.tmux.conf new file mode 100644 index 0000000..14d8b90 --- /dev/null +++ b/.tmux.conf @@ -0,0 +1,99 @@ +# https://github.com/seebi/tmux-colors-solarized/blob/master/tmuxcolors-256.conf +set-option -g status-style bg=colour235,fg=colour136 + +# set window split +bind-key v split-window -h +bind-key b split-window + +# default window title colors +set-window-option -g window-status-style fg=colour39,bg=default,dim + +# active window title colors +set-window-option -g window-status-current-style fg=colour235,bg=colour113,bright + +# pane border +set-option -g pane-border-style fg=colour235 #base02 +set-option -g pane-active-border-style fg=colour240 #base01 + +# message text +set-option -g message-style bg=colour235 #base02 +set-option -g message-style fg=colour166 #orange + +# pane number display +set-option -g display-panes-active-colour colour33 #blue +set-option -g display-panes-colour colour166 #orange +# clock +set-window-option -g clock-mode-colour green #green + + +set -g status-interval 10 +set -g status-justify left # center align window list +set -g status-left-length 14 +set -g status-right-length 140 +#set -g status-left '#[default]〘 ' +set -g status-left '#[fg=green,bright]#(uname -r | cut -c 1-8)#[default]〘' +set -g status-right "〙🔋 #(upower -i /org/freedesktop/UPower/devices/battery_BAT1 | grep time | awk '{print $4, $5}' | sed 's/hours/h/; s/minutes/m/; s/,/\./') #[fg=red,bg=default]⇑#(uptime -p |sed 's/\ week/w/; s/\ days/d/; s/\ day/d/; s/\ hours/h/; s/\ minutes/m/; s/\ minute/m/; s/,//g; s/up//') #[fg=green,bg=default]⎋ #(cat /proc/loadavg | awk '{print $1,$2,$3}') #[fg=blue]⌚ %Y-%m-%d #[fg=white,bg=default]⌚ %H:%M #[fg=green]⚼ #H" + +# C-b is not acceptable -- Vim uses it +set-option -g prefix C-a +bind-key C-a last-window + +# Start numbering at 1 +set -g base-index 1 + +# Allows for faster key repetition +set -s escape-time 0 + +# Rather than constraining window size to the maximum size of any client +# connected to the *session*, constrain window size to the maximum size of any +# client connected to *that window*. Much more reasonable. +setw -g aggressive-resize on + +# Allows us to use C-a a to send commands to a TMUX session inside +# another TMUX session +bind-key a send-prefix + +# Activity monitoring +setw -g monitor-activity on +set -g visual-activity on + +# Vi copypaste mode +set-window-option -g mode-keys vi +#bind-key -t vi-copy 'v' begin-selection +#bind-key -t vi-copy 'y' copy-selection + + +# set to main-horizontal, 60% height for main pane +bind m set-window-option main-pane-height 60\; select-layout main-horizontal + +bind-key C command-prompt -p "Name of new window: " "new-window -n '%%'" + +# reload config +bind r source-file ~/.tmux.conf \; display-message "Config reloaded..." + +# auto window rename +set-window-option -g automatic-rename + +# color +set -g default-terminal "tmux-256color" + +# status bar +#set-option -g status-utf8 on + +# https://github.com/edkolev/dots/blob/master/tmux.conf +# Updates for tmux 1.9's current pane splitting paths. + +# from powerline +run-shell "tmux set-environment -g TMUX_VERSION_MAJOR $(tmux -V | cut -d' ' -f2 | cut -d'.' -f1 | sed 's/[^0-9]*//g')" +run-shell "tmux set-environment -g TMUX_VERSION_MINOR $(tmux -V | cut -d' ' -f2 | cut -d'.' -f2 | sed 's/[^0-9]*//g')" + +# rm mouse mode fail +if-shell '\( #{$TMUX_VERSION_MAJOR} -eq 2 -a #{$TMUX_VERSION_MINOR} -ge 1\) -o #{$TMUX_VERSION_MAJOR} -gt 2' 'set -g mouse off' +if-shell '\( #{$TMUX_VERSION_MAJOR} -eq 2 -a #{$TMUX_VERSION_MINOR} -lt 1\) -o #{$TMUX_VERSION_MAJOR} -le 1' 'set -g mode-mouse off' + +# fix pane_current_path on new window and splits +if-shell "#{$TMUX_VERSION_MAJOR} -gt 1 -o \( #{$TMUX_VERSION_MAJOR} -eq 1 -a #{$TMUX_VERSION_MINOR} -ge 8 \)" 'unbind c; bind c new-window -c "#{pane_current_path}"' +if-shell "#{$TMUX_VERSION_MAJOR} -gt 1 -o \( #{$TMUX_VERSION_MAJOR} -eq 1 -a #{$TMUX_VERSION_MINOR} -ge 8 \)" "unbind '\"'; bind '\"' split-window -v -c '#{pane_current_path}'" +if-shell "#{$TMUX_VERSION_MAJOR} -gt 1 -o \( #{$TMUX_VERSION_MAJOR} -eq 1 -a #{$TMUX_VERSION_MINOR} -ge 8 \)" 'unbind v; bind v split-window -h -c "#{pane_current_path}"' +if-shell "#{$TMUX_VERSION_MAJOR} -gt 1 -o \( #{$TMUX_VERSION_MAJOR} -eq 1 -a #{$TMUX_VERSION_MINOR} -ge 8 \)" 'unbind %; bind % split-window -h -c "#{pane_current_path}"' + From eb61cfe62ec07ed72dd51aff242dd3a201ef5866 Mon Sep 17 00:00:00 2001 From: Sophie Schiller Date: Wed, 24 May 2023 23:53:12 +0200 Subject: [PATCH 2/5] wip --- .tmux.conf | 104 ++++++++++++-------------- powerline-theme.tmux | 171 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 219 insertions(+), 56 deletions(-) create mode 100644 powerline-theme.tmux diff --git a/.tmux.conf b/.tmux.conf index 14d8b90..1544ffd 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -1,39 +1,4 @@ -# https://github.com/seebi/tmux-colors-solarized/blob/master/tmuxcolors-256.conf -set-option -g status-style bg=colour235,fg=colour136 - -# set window split -bind-key v split-window -h -bind-key b split-window - -# default window title colors -set-window-option -g window-status-style fg=colour39,bg=default,dim - -# active window title colors -set-window-option -g window-status-current-style fg=colour235,bg=colour113,bright - -# pane border -set-option -g pane-border-style fg=colour235 #base02 -set-option -g pane-active-border-style fg=colour240 #base01 - -# message text -set-option -g message-style bg=colour235 #base02 -set-option -g message-style fg=colour166 #orange - -# pane number display -set-option -g display-panes-active-colour colour33 #blue -set-option -g display-panes-colour colour166 #orange -# clock -set-window-option -g clock-mode-colour green #green - - -set -g status-interval 10 -set -g status-justify left # center align window list -set -g status-left-length 14 -set -g status-right-length 140 -#set -g status-left '#[default]〘 ' -set -g status-left '#[fg=green,bright]#(uname -r | cut -c 1-8)#[default]〘' -set -g status-right "〙🔋 #(upower -i /org/freedesktop/UPower/devices/battery_BAT1 | grep time | awk '{print $4, $5}' | sed 's/hours/h/; s/minutes/m/; s/,/\./') #[fg=red,bg=default]⇑#(uptime -p |sed 's/\ week/w/; s/\ days/d/; s/\ day/d/; s/\ hours/h/; s/\ minutes/m/; s/\ minute/m/; s/,//g; s/up//') #[fg=green,bg=default]⎋ #(cat /proc/loadavg | awk '{print $1,$2,$3}') #[fg=blue]⌚ %Y-%m-%d #[fg=white,bg=default]⌚ %H:%M #[fg=green]⚼ #H" - +### keybindings # C-b is not acceptable -- Vim uses it set-option -g prefix C-a bind-key C-a last-window @@ -59,8 +24,6 @@ set -g visual-activity on # Vi copypaste mode set-window-option -g mode-keys vi -#bind-key -t vi-copy 'v' begin-selection -#bind-key -t vi-copy 'y' copy-selection # set to main-horizontal, 60% height for main pane @@ -71,29 +34,58 @@ bind-key C command-prompt -p "Name of new window: " "new-window -n '%%'" # reload config bind r source-file ~/.tmux.conf \; display-message "Config reloaded..." +# set window split +bind-key v split-window -h +bind-key b split-window + # auto window rename set-window-option -g automatic-rename -# color -set -g default-terminal "tmux-256color" +#################################### +# new theme -# status bar -#set-option -g status-utf8 on -# https://github.com/edkolev/dots/blob/master/tmux.conf -# Updates for tmux 1.9's current pane splitting paths. +set-window-option -g status-style bg=colour236,fg=white -# from powerline -run-shell "tmux set-environment -g TMUX_VERSION_MAJOR $(tmux -V | cut -d' ' -f2 | cut -d'.' -f1 | sed 's/[^0-9]*//g')" -run-shell "tmux set-environment -g TMUX_VERSION_MINOR $(tmux -V | cut -d' ' -f2 | cut -d'.' -f2 | sed 's/[^0-9]*//g')" -# rm mouse mode fail -if-shell '\( #{$TMUX_VERSION_MAJOR} -eq 2 -a #{$TMUX_VERSION_MINOR} -ge 1\) -o #{$TMUX_VERSION_MAJOR} -gt 2' 'set -g mouse off' -if-shell '\( #{$TMUX_VERSION_MAJOR} -eq 2 -a #{$TMUX_VERSION_MINOR} -lt 1\) -o #{$TMUX_VERSION_MAJOR} -le 1' 'set -g mode-mouse off' - -# fix pane_current_path on new window and splits -if-shell "#{$TMUX_VERSION_MAJOR} -gt 1 -o \( #{$TMUX_VERSION_MAJOR} -eq 1 -a #{$TMUX_VERSION_MINOR} -ge 8 \)" 'unbind c; bind c new-window -c "#{pane_current_path}"' -if-shell "#{$TMUX_VERSION_MAJOR} -gt 1 -o \( #{$TMUX_VERSION_MAJOR} -eq 1 -a #{$TMUX_VERSION_MINOR} -ge 8 \)" "unbind '\"'; bind '\"' split-window -v -c '#{pane_current_path}'" -if-shell "#{$TMUX_VERSION_MAJOR} -gt 1 -o \( #{$TMUX_VERSION_MAJOR} -eq 1 -a #{$TMUX_VERSION_MINOR} -ge 8 \)" 'unbind v; bind v split-window -h -c "#{pane_current_path}"' -if-shell "#{$TMUX_VERSION_MAJOR} -gt 1 -o \( #{$TMUX_VERSION_MAJOR} -eq 1 -a #{$TMUX_VERSION_MINOR} -ge 8 \)" 'unbind %; bind % split-window -h -c "#{pane_current_path}"' +################################### +# old theme +# ### colors +# set -g default-terminal "tmux-256color" +# set -ag terminal-overrides ",xterm-256color:RGB" +# +# set-option -g status-style bg=colour235,fg=colour136 +# +# # default window title colors +# set-window-option -g window-status-style fg=colour39,bg=default,dim +# +# # active window title colors +# set-window-option -g window-status-current-style fg=colour235,bg=colour113,bright +# +# # pane border +# set-option -g pane-border-style fg=colour235 #base02 +# set-option -g pane-active-border-style fg=colour240 #base01 +# +# # message text +# set-option -g message-style bg=colour235 #base02 +# set-option -g message-style fg=colour166 #orange +# +# # pane number display +# set-option -g display-panes-active-colour colour33 #blue +# set-option -g display-panes-colour colour166 #orange +# # clock +# set-window-option -g clock-mode-colour green #green +# +# +# ### status +# # status bar +# #set-option -g status-utf8 on +# set -g status-interval 10 +# set -g status-justify left # center align window list +# set -g status-left-length 14 +# set -g status-right-length 140 +# #set -g status-left '#[default]〘 ' +# set -g status-left '#[fg=green,bright]#(uname -r | cut -c 1-8)#[default]〘' +# set -g status-right "〙🔋 #(upower -i /org/freedesktop/UPower/devices/battery_BAT1 | grep time | awk '{print $4, $5}' | sed 's/hours/h/; s/minutes/m/; s/,/\./') #[fg=red,bg=default]⇑#(uptime -p |sed 's/\ week/w/; s/\ days/d/; s/\ day/d/; s/\ hours/h/; s/\ minutes/m/; s/\ minute/m/; s/,//g; s/up//') #[fg=green,bg=default]⎋ #(cat /proc/loadavg | awk '{print $1,$2,$3}') #[fg=blue]⌚ %Y-%m-%d #[fg=white,bg=default]⌚ %H:%M #[fg=green]⚼ #H" +# diff --git a/powerline-theme.tmux b/powerline-theme.tmux new file mode 100644 index 0000000..cc90f16 --- /dev/null +++ b/powerline-theme.tmux @@ -0,0 +1,171 @@ +#!/bin/sh + +# +# Powerline symbols +# + +: ${TMUX_POWERLINE_SYMBOLS:=unicode} + +case "$TMUX_POWERLINE_SYMBOLS" in + powerline ) + # Powerline glyphs at U+E000-U+F8FF range ("Private Use Area") + # These are the code points used in the new universal Powerline + tmux_powerline_symbol_right_full="" + tmux_powerline_symbol_right_thin="" + tmux_powerline_symbol_left_full="" + tmux_powerline_symbol_left_thin="" + ;; + vim-powerline ) + # Powerline glyphs at U+2B60-U+2BFF range ("Miscellaneous Symbols and Arrows") + # These are the code points used in Lokaltog/vim-powerline + tmux_powerline_symbol_right_full="⮀" + tmux_powerline_symbol_right_thin="⮁" + tmux_powerline_symbol_left_full="⮂" + tmux_powerline_symbol_left_thin="⮃" + ;; + unicode ) + # Unicode glyphs which don't require patched font + tmux_powerline_symbol_right_full="" + tmux_powerline_symbol_right_thin="│" + tmux_powerline_symbol_left_full="" + tmux_powerline_symbol_left_thin="│" + ;; + ascii ) + # ASCII glyphs which don't require patched font or Unicode support + tmux_powerline_symbol_right_full="" + tmux_powerline_symbol_right_thin="|" + tmux_powerline_symbol_left_full="" + tmux_powerline_symbol_left_thin="|" + ;; + none | * ) + # No symbols. + tmux_powerline_symbol_right_full="" + tmux_powerline_symbol_right_thin="" + tmux_powerline_symbol_left_full="" + tmux_powerline_symbol_left_thin="" +esac + +# +# Show flag if terminal reports support for fewer than 8 colors +# +# Current: * +# Previous: - +# Activity/Silence: # +# Bell: ! +# Content: + +# + +enable_flag() +{ + tmux_powerline_flag="#F" +} + +disable_flag() +{ + tmux_powerline_flag="" +} + +# Support `tput Co` too? +colors="$(tput colors)" + +if [ "${TMUX_POWERLINE_FLAG}" = "on" ]; then + # Force enable flag + enable_flag +elif [ "${TMUX_POWERLINE_FLAG}" = "off" ]; then + # Force disable flag + disable_flag +else + # Dynamically enable flag + if [ "$colors" -lt 8 ]; then + # Fewer than n colors supported + enable_flag + else + disable_flag + fi +fi + +# +# Status bar style +# + +tmux set-window-option -g status-style bg=colour236,fg=white + +# +# Status bar left side +# + +# Show session name? +if [ "${TMUX_POWERLINE_SHOW_SESSION_NAME}" = "on" ]; then + tmux set-window-option -g status-left "#[bg=colour240,fg=white] #S #[fg=colour236,reverse]${tmux_powerline_symbol_right_full}" + tmux set-window-option -g status-left-length 40 +else + tmux set-window-option -g status-left "" + #tmux set-window-option -g status-left-length 40 +fi + +# +# Status bar right side +# + +tmux set-window-option -g status-right "#[fg=colour244]#S:#I:#P #[fg=colour240]${tmux_powerline_symbol_left_full}#[fg=colour231,bg=colour240] #H #[fg=colour252]${tmux_powerline_symbol_left_full}#[fg=black,bg=colour252,nobold] %b %d %a #[bold]%H:%M " +tmux set-window-option -g status-right-length 80 + +# +# Status bar window currently active +# + +if [ "${TMUX_POWERLINE_COMPACT_CURRENT}" = "on" ]; then + tmux set-window-option -g window-status-current-format "#[fg=colour236]${tmux_powerline_symbol_right_full}#[default,fg=colour231,bold] #I${tmux_powerline_flag} #[default,fg=colour236,reverse]${tmux_powerline_symbol_right_full}" +else + tmux set-window-option -g window-status-current-format "#[fg=colour236]${tmux_powerline_symbol_right_full}#[default,bold] #I${tmux_powerline_flag} #[fg=colour123,reverse]${tmux_powerline_symbol_right_full}#[default]#[bg=colour123] #W #[fg=colour236,reverse]${tmux_powerline_symbol_right_full}" +fi + +# colour33 is green +tmux set-window-option -g window-status-current-style none,bg=colour33,fg=black + +# +# Status bar window in background (not active) +# + +if [ "${TMUX_POWERLINE_COMPACT_OTHER}" = "on" ]; then + tmux set-window-option -g window-status-format "#[fg=colour236,nounderscore]${tmux_powerline_symbol_right_full}#[default,bold,nounderscore] #I${tmux_powerline_flag} #[fg=colour236,reverse]${tmux_powerline_symbol_right_full}" +else + tmux set-window-option -g window-status-format "#[fg=colour236,nounderscore]${tmux_powerline_symbol_right_full}#[default,bold,nounderscore] #I${tmux_powerline_flag} #[fg=colour240,reverse]${tmux_powerline_symbol_right_full}#[default]#[bg=colour240]#[nounderscore] #[default]#[fg=colour231,bg=colour240]#W#[nounderscore] #[fg=colour236,reverse]${tmux_powerline_symbol_right_full}" +fi + +# Black on green +tmux set-window-option -g window-status-style none,bg=colour76,fg=black + +# Black on white +#tmux set-window-option -g window-status-style bg=colour231,fg=black + +# Green more alike non-256color +#tmux set-window-option -g window-status-style bg=colour40 + +# +# Status bar window last active (Tmux 1.8+) +# + +tmux set-window-option -g window-status-last-style none,bg=cyan,fg=black + +# +# Status bar window with activity/silence (monitor-activity, monitor-silence) +# + +# colour127 is pink +tmux set-window-option -g window-status-activity-style bold,bg=colour127,fg=black + +# +# Status bar window with bell triggered +# + +# red is urgent +tmux set-window-option -g window-status-bell-style bold,bg=red,fg=black + +# +# Status bar window with content found (monitor-content) (Tmux <2.0) +# + +#tmux set-window-option -g window-status-content-attr bold #,underscore +#tmux set-window-option -g window-status-content-bg colour226 # Yellow because search highlighting usually is +#tmux set-window-option -g window-status-content-fg black From bb24e7600f8a77ae4c2e9f83baea752faa5449ac Mon Sep 17 00:00:00 2001 From: Sophie Schiller Date: Thu, 25 May 2023 00:37:22 +0200 Subject: [PATCH 3/5] update theme --- .tmux.conf | 87 ++++++++++++++++++++++++-------------------- powerline-theme.tmux | 41 +++------------------ 2 files changed, 53 insertions(+), 75 deletions(-) diff --git a/.tmux.conf b/.tmux.conf index 1544ffd..5dea012 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -41,51 +41,58 @@ bind-key b split-window # auto window rename set-window-option -g automatic-rename +set -g status-interval 2 + #################################### # new theme set-window-option -g status-style bg=colour236,fg=white +# left +set-window-option -g status-left "#[bg=colour240,fg=white] #S #[fg=colour236,reverse]" +set-window-option -g status-left-length 40 +# right +set-window-option -g status-right "#[fg=black,bg=colour76] #(upower -i /org/freedesktop/UPower/devices/battery_BAT1 | grep time | awk '{print $4, $5}' | sed 's/hours/h/; s/minutes/m/; s/,/\./') #[bg=colour236,fg=white] #(tmux-mem-cpu-load --colors --interval 2) #[fg=colour252]#[fg=black,bg=colour252,nobold] %Y-%m-%d #[bold]%H:%M #[fg=colour231,bg=colour240] #H " +set-window-option -g status-right-length 80 +# Status bar window currently active +set-window-option -g window-status-current-format "#[fg=colour236]#[default,bold] #I #[fg=colour123,reverse]#[default]#[bg=colour123] #W #[fg=colour236,reverse]" +# colour33 is green +set-window-option -g window-status-current-style none,bg=colour33,fg=black +# Status bar window in background (not active) +set-window-option -g window-status-format "#[fg=colour236,nounderscore]#[default,bold,nounderscore] #I #[fg=colour240,reverse]#[default]#[bg=colour240]#[nounderscore] #[default]#[fg=colour231,bg=colour240]#W#[nounderscore] #[fg=colour236,reverse]" +# Black on green +set-window-option -g window-status-style none,bg=colour76,fg=black -################################### -# old theme -# ### colors -# set -g default-terminal "tmux-256color" -# set -ag terminal-overrides ",xterm-256color:RGB" -# -# set-option -g status-style bg=colour235,fg=colour136 -# -# # default window title colors -# set-window-option -g window-status-style fg=colour39,bg=default,dim -# -# # active window title colors -# set-window-option -g window-status-current-style fg=colour235,bg=colour113,bright -# -# # pane border -# set-option -g pane-border-style fg=colour235 #base02 -# set-option -g pane-active-border-style fg=colour240 #base01 -# -# # message text -# set-option -g message-style bg=colour235 #base02 -# set-option -g message-style fg=colour166 #orange -# -# # pane number display -# set-option -g display-panes-active-colour colour33 #blue -# set-option -g display-panes-colour colour166 #orange -# # clock -# set-window-option -g clock-mode-colour green #green -# -# -# ### status -# # status bar -# #set-option -g status-utf8 on -# set -g status-interval 10 -# set -g status-justify left # center align window list -# set -g status-left-length 14 -# set -g status-right-length 140 -# #set -g status-left '#[default]〘 ' -# set -g status-left '#[fg=green,bright]#(uname -r | cut -c 1-8)#[default]〘' -# set -g status-right "〙🔋 #(upower -i /org/freedesktop/UPower/devices/battery_BAT1 | grep time | awk '{print $4, $5}' | sed 's/hours/h/; s/minutes/m/; s/,/\./') #[fg=red,bg=default]⇑#(uptime -p |sed 's/\ week/w/; s/\ days/d/; s/\ day/d/; s/\ hours/h/; s/\ minutes/m/; s/\ minute/m/; s/,//g; s/up//') #[fg=green,bg=default]⎋ #(cat /proc/loadavg | awk '{print $1,$2,$3}') #[fg=blue]⌚ %Y-%m-%d #[fg=white,bg=default]⌚ %H:%M #[fg=green]⚼ #H" -# +# +# Status bar window last active (Tmux 1.8+) +# + +set-window-option -g window-status-last-style none,bg=cyan,fg=black + +# +# Status bar window with activity/silence (monitor-activity, monitor-silence) +# + +# colour127 is pink +set-window-option -g window-status-activity-style bold,bg=colour127,fg=black + +# +# Status bar window with bell triggered +# + +# red is urgent +set-window-option -g window-status-bell-style bold,bg=red,fg=black + +###### +# notes + +# battery status +#(upower -i /org/freedesktop/UPower/devices/battery_BAT1 | grep time | awk '{print $4, $5}' | sed 's/hours/h/; s/minutes/m/; s/,/\./') + +# uptime +#(uptime -p |sed 's/\ week/w/; s/\ days/d/; s/\ day/d/; s/\ hours/h/; s/\ minutes/m/; s/\ minute/m/; s/,//g; s/up//') + +# load +#(cat /proc/loadavg | awk '{print $1,$2,$3}') diff --git a/powerline-theme.tmux b/powerline-theme.tmux index cc90f16..20d3406 100644 --- a/powerline-theme.tmux +++ b/powerline-theme.tmux @@ -7,22 +7,6 @@ : ${TMUX_POWERLINE_SYMBOLS:=unicode} case "$TMUX_POWERLINE_SYMBOLS" in - powerline ) - # Powerline glyphs at U+E000-U+F8FF range ("Private Use Area") - # These are the code points used in the new universal Powerline - tmux_powerline_symbol_right_full="" - tmux_powerline_symbol_right_thin="" - tmux_powerline_symbol_left_full="" - tmux_powerline_symbol_left_thin="" - ;; - vim-powerline ) - # Powerline glyphs at U+2B60-U+2BFF range ("Miscellaneous Symbols and Arrows") - # These are the code points used in Lokaltog/vim-powerline - tmux_powerline_symbol_right_full="⮀" - tmux_powerline_symbol_right_thin="⮁" - tmux_powerline_symbol_left_full="⮂" - tmux_powerline_symbol_left_thin="⮃" - ;; unicode ) # Unicode glyphs which don't require patched font tmux_powerline_symbol_right_full="" @@ -30,19 +14,6 @@ case "$TMUX_POWERLINE_SYMBOLS" in tmux_powerline_symbol_left_full="" tmux_powerline_symbol_left_thin="│" ;; - ascii ) - # ASCII glyphs which don't require patched font or Unicode support - tmux_powerline_symbol_right_full="" - tmux_powerline_symbol_right_thin="|" - tmux_powerline_symbol_left_full="" - tmux_powerline_symbol_left_thin="|" - ;; - none | * ) - # No symbols. - tmux_powerline_symbol_right_full="" - tmux_powerline_symbol_right_thin="" - tmux_powerline_symbol_left_full="" - tmux_powerline_symbol_left_thin="" esac # @@ -96,7 +67,7 @@ tmux set-window-option -g status-style bg=colour236,fg=white # Show session name? if [ "${TMUX_POWERLINE_SHOW_SESSION_NAME}" = "on" ]; then - tmux set-window-option -g status-left "#[bg=colour240,fg=white] #S #[fg=colour236,reverse]${tmux_powerline_symbol_right_full}" + tmux set-window-option -g status-left "#[bg=colour240,fg=white] #S #[fg=colour236,reverse]" tmux set-window-option -g status-left-length 40 else tmux set-window-option -g status-left "" @@ -107,7 +78,7 @@ fi # Status bar right side # -tmux set-window-option -g status-right "#[fg=colour244]#S:#I:#P #[fg=colour240]${tmux_powerline_symbol_left_full}#[fg=colour231,bg=colour240] #H #[fg=colour252]${tmux_powerline_symbol_left_full}#[fg=black,bg=colour252,nobold] %b %d %a #[bold]%H:%M " +tmux set-window-option -g status-right "#[fg=colour244]#S:#I:#P #[fg=colour240]#[fg=colour231,bg=colour240] #H #[fg=colour252]#[fg=black,bg=colour252,nobold] %b %d %a #[bold]%H:%M " tmux set-window-option -g status-right-length 80 # @@ -115,9 +86,9 @@ tmux set-window-option -g status-right-length 80 # if [ "${TMUX_POWERLINE_COMPACT_CURRENT}" = "on" ]; then - tmux set-window-option -g window-status-current-format "#[fg=colour236]${tmux_powerline_symbol_right_full}#[default,fg=colour231,bold] #I${tmux_powerline_flag} #[default,fg=colour236,reverse]${tmux_powerline_symbol_right_full}" + tmux set-window-option -g window-status-current-format "#[fg=colour236]#[default,fg=colour231,bold] #I #[default,fg=colour236,reverse]" else - tmux set-window-option -g window-status-current-format "#[fg=colour236]${tmux_powerline_symbol_right_full}#[default,bold] #I${tmux_powerline_flag} #[fg=colour123,reverse]${tmux_powerline_symbol_right_full}#[default]#[bg=colour123] #W #[fg=colour236,reverse]${tmux_powerline_symbol_right_full}" + tmux set-window-option -g window-status-current-format "#[fg=colour236]#[default,bold] #I #[fg=colour123,reverse]#[default]#[bg=colour123] #W #[fg=colour236,reverse]" fi # colour33 is green @@ -128,9 +99,9 @@ tmux set-window-option -g window-status-current-style none,bg=colour33,fg=black # if [ "${TMUX_POWERLINE_COMPACT_OTHER}" = "on" ]; then - tmux set-window-option -g window-status-format "#[fg=colour236,nounderscore]${tmux_powerline_symbol_right_full}#[default,bold,nounderscore] #I${tmux_powerline_flag} #[fg=colour236,reverse]${tmux_powerline_symbol_right_full}" + tmux set-window-option -g window-status-format "#[fg=colour236,nounderscore]#[default,bold,nounderscore] #I #[fg=colour236,reverse]" else - tmux set-window-option -g window-status-format "#[fg=colour236,nounderscore]${tmux_powerline_symbol_right_full}#[default,bold,nounderscore] #I${tmux_powerline_flag} #[fg=colour240,reverse]${tmux_powerline_symbol_right_full}#[default]#[bg=colour240]#[nounderscore] #[default]#[fg=colour231,bg=colour240]#W#[nounderscore] #[fg=colour236,reverse]${tmux_powerline_symbol_right_full}" + tmux set-window-option -g window-status-format "#[fg=colour236,nounderscore]#[default,bold,nounderscore] #I #[fg=colour240,reverse]#[default]#[bg=colour240]#[nounderscore] #[default]#[fg=colour231,bg=colour240]#W#[nounderscore] #[fg=colour236,reverse]" fi # Black on green From 16b4ce21ea957efe403f6a6255a6a9b47d5163f1 Mon Sep 17 00:00:00 2001 From: Sophie Schiller Date: Thu, 25 May 2023 00:58:36 +0200 Subject: [PATCH 4/5] that's it for now! --- .tmux.conf | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.tmux.conf b/.tmux.conf index 5dea012..1f965fc 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -52,8 +52,8 @@ set-window-option -g status-style bg=colour236,fg=white set-window-option -g status-left "#[bg=colour240,fg=white] #S #[fg=colour236,reverse]" set-window-option -g status-left-length 40 # right -set-window-option -g status-right "#[fg=black,bg=colour76] #(upower -i /org/freedesktop/UPower/devices/battery_BAT1 | grep time | awk '{print $4, $5}' | sed 's/hours/h/; s/minutes/m/; s/,/\./') #[bg=colour236,fg=white] #(tmux-mem-cpu-load --colors --interval 2) #[fg=colour252]#[fg=black,bg=colour252,nobold] %Y-%m-%d #[bold]%H:%M #[fg=colour231,bg=colour240] #H " -set-window-option -g status-right-length 80 +set-window-option -g status-right "#[fg=black,bg=colour208]#(uptime -p |sed 's/\ week/w/; s/\ day/d/; s/\ hour/h/; s/\ minute/m/; s/s//g; s/,//g; s/up//') #[bg=colour236,fg=white] #(tmux-mem-cpu-load --colors --interval 2) #[fg=colour252]#[fg=black,bg=colour252,nobold] %Y-%m-%d #[bold]%H:%M #[fg=colour231,bg=colour240] #H " +set-window-option -g status-right-length 100 # Status bar window currently active set-window-option -g window-status-current-format "#[fg=colour236]#[default,bold] #I #[fg=colour123,reverse]#[default]#[bg=colour123] #W #[fg=colour236,reverse]" # colour33 is green @@ -90,9 +90,5 @@ set-window-option -g window-status-bell-style bold,bg=red,fg=black # battery status #(upower -i /org/freedesktop/UPower/devices/battery_BAT1 | grep time | awk '{print $4, $5}' | sed 's/hours/h/; s/minutes/m/; s/,/\./') -# uptime -#(uptime -p |sed 's/\ week/w/; s/\ days/d/; s/\ day/d/; s/\ hours/h/; s/\ minutes/m/; s/\ minute/m/; s/,//g; s/up//') - # load #(cat /proc/loadavg | awk '{print $1,$2,$3}') - From 7b77f3bc3b9f5e7a18412949418a0761c5399818 Mon Sep 17 00:00:00 2001 From: Sophie Schiller Date: Sat, 27 May 2023 16:55:07 +0200 Subject: [PATCH 5/5] further refinement --- .tmux.conf | 45 ++++------- powerline-theme.tmux | 142 --------------------------------- tmux.conf-without-dependencies | 83 +++++++++++++++++++ 3 files changed, 100 insertions(+), 170 deletions(-) delete mode 100644 powerline-theme.tmux create mode 100644 tmux.conf-without-dependencies diff --git a/.tmux.conf b/.tmux.conf index 1f965fc..b9b8ced 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -45,8 +45,6 @@ set -g status-interval 2 #################################### # new theme - - set-window-option -g status-style bg=colour236,fg=white # left set-window-option -g status-left "#[bg=colour240,fg=white] #S #[fg=colour236,reverse]" @@ -54,41 +52,32 @@ set-window-option -g status-left-length 40 # right set-window-option -g status-right "#[fg=black,bg=colour208]#(uptime -p |sed 's/\ week/w/; s/\ day/d/; s/\ hour/h/; s/\ minute/m/; s/s//g; s/,//g; s/up//') #[bg=colour236,fg=white] #(tmux-mem-cpu-load --colors --interval 2) #[fg=colour252]#[fg=black,bg=colour252,nobold] %Y-%m-%d #[bold]%H:%M #[fg=colour231,bg=colour240] #H " set-window-option -g status-right-length 100 + # Status bar window currently active -set-window-option -g window-status-current-format "#[fg=colour236]#[default,bold] #I #[fg=colour123,reverse]#[default]#[bg=colour123] #W #[fg=colour236,reverse]" -# colour33 is green -set-window-option -g window-status-current-style none,bg=colour33,fg=black +set-window-option -g window-status-current-format " #I #[default]#[fg=black,bg=colour123,nobold] #W #[fg=colour236,reverse]" + # Status bar window in background (not active) -set-window-option -g window-status-format "#[fg=colour236,nounderscore]#[default,bold,nounderscore] #I #[fg=colour240,reverse]#[default]#[bg=colour240]#[nounderscore] #[default]#[fg=colour231,bg=colour240]#W#[nounderscore] #[fg=colour236,reverse]" +set-window-option -g window-status-format " #I #[default]#[fg=colour231,bg=colour240,nobold] #W #[fg=colour236,reverse]" +# normal windows # Black on green -set-window-option -g window-status-style none,bg=colour76,fg=black +set-window-option -g window-status-style none,bg=colour76,fg=black,nobold + +# current window +# +set-window-option -g window-status-current-style none,bg=colour33,fg=black,bold # -# Status bar window last active (Tmux 1.8+) -# - -set-window-option -g window-status-last-style none,bg=cyan,fg=black +# last active +# cyan +set-window-option -g window-status-last-style none,bg=cyan,fg=black,bold # -# Status bar window with activity/silence (monitor-activity, monitor-silence) -# - -# colour127 is pink -set-window-option -g window-status-activity-style bold,bg=colour127,fg=black +# activity/silence (monitor-activity, monitor-silence) +# pink +set-window-option -g window-status-activity-style bold,bg=colour127,fg=white # -# Status bar window with bell triggered -# - +# bell triggered # red is urgent set-window-option -g window-status-bell-style bold,bg=red,fg=black - -###### -# notes - -# battery status -#(upower -i /org/freedesktop/UPower/devices/battery_BAT1 | grep time | awk '{print $4, $5}' | sed 's/hours/h/; s/minutes/m/; s/,/\./') - -# load -#(cat /proc/loadavg | awk '{print $1,$2,$3}') diff --git a/powerline-theme.tmux b/powerline-theme.tmux deleted file mode 100644 index 20d3406..0000000 --- a/powerline-theme.tmux +++ /dev/null @@ -1,142 +0,0 @@ -#!/bin/sh - -# -# Powerline symbols -# - -: ${TMUX_POWERLINE_SYMBOLS:=unicode} - -case "$TMUX_POWERLINE_SYMBOLS" in - unicode ) - # Unicode glyphs which don't require patched font - tmux_powerline_symbol_right_full="" - tmux_powerline_symbol_right_thin="│" - tmux_powerline_symbol_left_full="" - tmux_powerline_symbol_left_thin="│" - ;; -esac - -# -# Show flag if terminal reports support for fewer than 8 colors -# -# Current: * -# Previous: - -# Activity/Silence: # -# Bell: ! -# Content: + -# - -enable_flag() -{ - tmux_powerline_flag="#F" -} - -disable_flag() -{ - tmux_powerline_flag="" -} - -# Support `tput Co` too? -colors="$(tput colors)" - -if [ "${TMUX_POWERLINE_FLAG}" = "on" ]; then - # Force enable flag - enable_flag -elif [ "${TMUX_POWERLINE_FLAG}" = "off" ]; then - # Force disable flag - disable_flag -else - # Dynamically enable flag - if [ "$colors" -lt 8 ]; then - # Fewer than n colors supported - enable_flag - else - disable_flag - fi -fi - -# -# Status bar style -# - -tmux set-window-option -g status-style bg=colour236,fg=white - -# -# Status bar left side -# - -# Show session name? -if [ "${TMUX_POWERLINE_SHOW_SESSION_NAME}" = "on" ]; then - tmux set-window-option -g status-left "#[bg=colour240,fg=white] #S #[fg=colour236,reverse]" - tmux set-window-option -g status-left-length 40 -else - tmux set-window-option -g status-left "" - #tmux set-window-option -g status-left-length 40 -fi - -# -# Status bar right side -# - -tmux set-window-option -g status-right "#[fg=colour244]#S:#I:#P #[fg=colour240]#[fg=colour231,bg=colour240] #H #[fg=colour252]#[fg=black,bg=colour252,nobold] %b %d %a #[bold]%H:%M " -tmux set-window-option -g status-right-length 80 - -# -# Status bar window currently active -# - -if [ "${TMUX_POWERLINE_COMPACT_CURRENT}" = "on" ]; then - tmux set-window-option -g window-status-current-format "#[fg=colour236]#[default,fg=colour231,bold] #I #[default,fg=colour236,reverse]" -else - tmux set-window-option -g window-status-current-format "#[fg=colour236]#[default,bold] #I #[fg=colour123,reverse]#[default]#[bg=colour123] #W #[fg=colour236,reverse]" -fi - -# colour33 is green -tmux set-window-option -g window-status-current-style none,bg=colour33,fg=black - -# -# Status bar window in background (not active) -# - -if [ "${TMUX_POWERLINE_COMPACT_OTHER}" = "on" ]; then - tmux set-window-option -g window-status-format "#[fg=colour236,nounderscore]#[default,bold,nounderscore] #I #[fg=colour236,reverse]" -else - tmux set-window-option -g window-status-format "#[fg=colour236,nounderscore]#[default,bold,nounderscore] #I #[fg=colour240,reverse]#[default]#[bg=colour240]#[nounderscore] #[default]#[fg=colour231,bg=colour240]#W#[nounderscore] #[fg=colour236,reverse]" -fi - -# Black on green -tmux set-window-option -g window-status-style none,bg=colour76,fg=black - -# Black on white -#tmux set-window-option -g window-status-style bg=colour231,fg=black - -# Green more alike non-256color -#tmux set-window-option -g window-status-style bg=colour40 - -# -# Status bar window last active (Tmux 1.8+) -# - -tmux set-window-option -g window-status-last-style none,bg=cyan,fg=black - -# -# Status bar window with activity/silence (monitor-activity, monitor-silence) -# - -# colour127 is pink -tmux set-window-option -g window-status-activity-style bold,bg=colour127,fg=black - -# -# Status bar window with bell triggered -# - -# red is urgent -tmux set-window-option -g window-status-bell-style bold,bg=red,fg=black - -# -# Status bar window with content found (monitor-content) (Tmux <2.0) -# - -#tmux set-window-option -g window-status-content-attr bold #,underscore -#tmux set-window-option -g window-status-content-bg colour226 # Yellow because search highlighting usually is -#tmux set-window-option -g window-status-content-fg black diff --git a/tmux.conf-without-dependencies b/tmux.conf-without-dependencies new file mode 100644 index 0000000..66f1a23 --- /dev/null +++ b/tmux.conf-without-dependencies @@ -0,0 +1,83 @@ +# C-b is not acceptable -- Vim uses it +set-option -g prefix C-a +bind-key C-a last-window + +# Start numbering at 1 +set -g base-index 1 + +# Allows for faster key repetition +set -s escape-time 0 + +# Rather than constraining window size to the maximum size of any client +# connected to the *session*, constrain window size to the maximum size of any +# client connected to *that window*. Much more reasonable. +setw -g aggressive-resize on + +# Allows us to use C-a a to send commands to a TMUX session inside +# another TMUX session +bind-key a send-prefix + +# Activity monitoring +setw -g monitor-activity on +set -g visual-activity on + +# Vi copypaste mode +set-window-option -g mode-keys vi + + +# set to main-horizontal, 60% height for main pane +bind m set-window-option main-pane-height 60\; select-layout main-horizontal + +bind-key C command-prompt -p "Name of new window: " "new-window -n '%%'" + +# reload config +bind r source-file "/root/.tmux.conf_sschiller" \; display-message "Config reloaded..." + +# set window split +bind-key v split-window -h +bind-key b split-window + +# auto window rename +set-window-option -g automatic-rename + +set -g status-interval 2 + +# new theme + + +set-window-option -g status-style bg=colour236,fg=white +# left +set-window-option -g status-left "#[bg=colour240,fg=white] #S #[fg=colour236,reverse]" +set-window-option -g status-left-length 40 +# right +set-window-option -g status-right "#[fg=black,bg=colour208]#(uptime -p |sed 's/\ week/w/; s/\ day/d/; s/\ hour/h/; s/\ minute/m/; s/s//g; s/,//g; s/up//') #[bg=colour236,fg=white] #(cat /proc/loadavg | awk '{print $1,$2,$3}') #[fg=colour252]#[fg=black,bg=colour252,nobold] %Y-%m-%d #[bold]%H:%M #[fg=colour231,bg=colour240] #H " +set-window-option -g status-right-length 80 + +# Status bar window currently active +set-window-option -g window-status-current-format " #I #[default]#[fg=black,bg=colour123,nobold] #W #[fg=colour236,reverse]" + +# Status bar window in background (not active) +set-window-option -g window-status-format " #I #[default]#[fg=colour231,bg=colour240,nobold] #W #[fg=colour236,reverse]" + +# normal windows +# Black on green +set-window-option -g window-status-style none,bg=colour76,fg=black,nobold + +# current window +# +set-window-option -g window-status-current-style none,bg=colour33,fg=black,bold + +# +# last active +# cyan +set-window-option -g window-status-last-style none,bg=cyan,fg=black,bold + +# +# activity/silence (monitor-activity, monitor-silence) +# pink +set-window-option -g window-status-activity-style bold,bg=colour127,fg=white + +# +# bell triggered +# red is urgent +set-window-option -g window-status-bell-style bold,bg=red,fg=black