Skip to content

Commit e48c2c1

Browse files
committed
customizing tmux-powerline UI*
*note that this assumes changes I made to `tmux-powerline` locally will be accepted upstream: see [here](erikw/tmux-powerline#362). also added TODO to fix mode_indicator color scheme
1 parent 8fab5d3 commit e48c2c1

File tree

3 files changed

+25
-16
lines changed

3 files changed

+25
-16
lines changed

tmux/tmux-powerline/config.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ fi
2929

3030
# The theme to use.
3131
export TMUX_POWERLINE_THEME="izzy-default"
32-
# TODO shouldn't assume that dotfiles/ dir lives in ~/code/
3332
# Overlay directory to look for themes. There you can put your own themes outside the repo. Fallback will still be the "themes" directory in the repo.
3433
export TMUX_POWERLINE_DIR_USER_THEMES="${XDG_CONFIG_HOME:-$HOME/.config}/tmux-powerline/themes"
3534
# Overlay directory to look for segments. There you can put your own segments outside the repo. Fallback will still be the "segments" directory in the repo.
@@ -52,6 +51,9 @@ fi
5251
# The maximum length of the right status bar.
5352
export TMUX_POWERLINE_STATUS_RIGHT_LENGTH="90"
5453

54+
# The separator to use between windows on the status bar.
55+
export TMUX_POWERLINE_WINDOW_STATUS_SEPARATOR=""
56+
5557
# Uncomment these if you want to enable tmux bindings for muting (hiding) one of the status bars.
5658
# E.g. this example binding would mute the left status bar when pressing <prefix> followed by Ctrl-[
5759
#export TMUX_POWERLINE_MUTE_LEFT_KEYBINDING="C-["

tmux/tmux-powerline/themes/izzy-default.sh

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,15 @@ else
1212
TMUX_POWERLINE_SEPARATOR_RIGHT_THIN=""
1313
fi
1414

15-
TMUX_POWERLINE_DEFAULT_BACKGROUND_COLOR=${TMUX_POWERLINE_DEFAULT_BACKGROUND_COLOR:-'0'}
16-
TMUX_POWERLINE_DEFAULT_FOREGROUND_COLOR=${TMUX_POWERLINE_DEFAULT_FOREGROUND_COLOR:-'255'}
15+
# See Color formatting section below for details on what colors can be used here.
16+
TMUX_POWERLINE_DEFAULT_BACKGROUND_COLOR=${TMUX_POWERLINE_DEFAULT_BACKGROUND_COLOR:-'235'}
17+
TMUX_POWERLINE_DEFAULT_FOREGROUND_COLOR=${TMUX_POWERLINE_DEFAULT_FOREGROUND_COLOR:-'136'}
1718

1819
TMUX_POWERLINE_DEFAULT_LEFTSIDE_SEPARATOR=${TMUX_POWERLINE_DEFAULT_LEFTSIDE_SEPARATOR:-$TMUX_POWERLINE_SEPARATOR_RIGHT_BOLD}
1920
TMUX_POWERLINE_DEFAULT_RIGHTSIDE_SEPARATOR=${TMUX_POWERLINE_DEFAULT_RIGHTSIDE_SEPARATOR:-$TMUX_POWERLINE_SEPARATOR_LEFT_BOLD}
2021

21-
# See man tmux.conf for additional formatting options for the status line.
22-
# The `format regular` and `format inverse` functions are provided as conveniences
22+
# See `man tmux` for additional formatting options for the status line.
23+
# The `format regular` and `format inverse` functions are provided as conveniences.
2324

2425
if [ -z $TMUX_POWERLINE_WINDOW_STATUS_CURRENT ]; then
2526
TMUX_POWERLINE_WINDOW_STATUS_CURRENT=(
@@ -50,10 +51,12 @@ fi
5051

5152
# Format: segment_name background_color foreground_color [non_default_separator] [separator_background_color] [separator_foreground_color] [spacing_disable] [separator_disable]
5253
#
53-
# * background_color and foreground_color. Formats:
54-
# * Named colors (chech man page of tmux for complete list) e.g. black, red, green, yellow, blue, magenta, cyan, white
55-
# * a hexadecimal RGB string e.g. #ffffff
56-
# * 'default' for the defalt tmux color.
54+
# * background_color and foreground_color. Color formatting (see `man tmux` for complete list):
55+
# * Named colors, e.g. black, red, green, yellow, blue, magenta, cyan, white
56+
# * Hexadecimal RGB string e.g. #ffffff
57+
# * 'default' for the default tmux color.
58+
# * 'terminal' for the terminal's default background/foreground color
59+
# * The numbers 0-255 for the 256-color palette. Run `tmux-powerline/color-palette.sh` to see the colors.
5760
# * non_default_separator - specify an alternative character for this segment's separator
5861
# * separator_background_color - specify a unique background color for the separator
5962
# * separator_foreground_color - specify a unique foreground color for the separator
@@ -77,8 +80,10 @@ fi
7780

7881
if [ -z $TMUX_POWERLINE_LEFT_STATUS_SEGMENTS ]; then
7982
TMUX_POWERLINE_LEFT_STATUS_SEGMENTS=(
80-
"tmux_session_info 235 136 ${TMUX_POWERLINE_SEPARATOR_RIGHT_THIN}" \
81-
"hostname 235 136" \
83+
"tmux_session_info ${TMUX_POWERLINE_DEFAULT_BACKGROUND_COLOR} ${TMUX_POWERLINE_DEFAULT_FOREGROUND_COLOR} ${TMUX_POWERLINE_SEPARATOR_RIGHT_THIN}" \
84+
"hostname ${TMUX_POWERLINE_DEFAULT_BACKGROUND_COLOR} ${TMUX_POWERLINE_DEFAULT_FOREGROUND_COLOR} ${TMUX_POWERLINE_SEPARATOR_RIGHT_THIN}" \
85+
# TODO hack on this so that background isn't blue
86+
"mode_indicator ${TMUX_POWERLINE_DEFAULT_BACKGROUND_COLOR} ${TMUX_POWERLINE_DEFAULT_FOREGROUND_COLOR} ${TMUX_POWERLINE_SEPARATOR_RIGHT_THIN}" \
8287
#"ifstat 30 255" \
8388
#"ifstat_sys 30 255" \
8489
#"lan_ip 24 255 ${TMUX_POWERLINE_SEPARATOR_RIGHT_THIN}" \
@@ -105,9 +110,9 @@ if [ -z $TMUX_POWERLINE_RIGHT_STATUS_SEGMENTS ]; then
105110
# "weather 37 255" \
106111
#"rainbarf 0 ${TMUX_POWERLINE_DEFAULT_FOREGROUND_COLOR}" \
107112
#"xkb_layout 125 117" \
108-
"date_day 235 136" \
109-
"date 235 136 ${TMUX_POWERLINE_SEPARATOR_LEFT_THIN}" \
110-
"time 235 136 ${TMUX_POWERLINE_SEPARATOR_LEFT_THIN}" \
113+
"date_day ${TMUX_POWERLINE_DEFAULT_BACKGROUND_COLOR} ${TMUX_POWERLINE_DEFAULT_FOREGROUND_COLOR} ${TMUX_POWERLINE_SEPARATOR_LEFT_THIN}" \
114+
"date ${TMUX_POWERLINE_DEFAULT_BACKGROUND_COLOR} ${TMUX_POWERLINE_DEFAULT_FOREGROUND_COLOR} ${TMUX_POWERLINE_SEPARATOR_LEFT_THIN}" \
115+
"time ${TMUX_POWERLINE_DEFAULT_BACKGROUND_COLOR} ${TMUX_POWERLINE_DEFAULT_FOREGROUND_COLOR} ${TMUX_POWERLINE_SEPARATOR_LEFT_THIN}" \
111116
#"utc_time 235 136 ${TMUX_POWERLINE_SEPARATOR_LEFT_THIN}" \
112117
)
113118
fi

tmux/tmux.conf

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,12 @@ set -g @plugin 'tmux-plugins/tpm'
110110
# `confirm-before` usage for these shortcuts.
111111
set -g @plugin 'tmux-plugins/tmux-resurrect'
112112

113+
# No longer using this plugin since UI is being customized through
114+
# tmux-powerline.
113115
# https://github.com/seebi/tmux-colors-solarized
114-
set -g @plugin 'seebi/tmux-colors-solarized'
116+
# set -g @plugin 'seebi/tmux-colors-solarized'
115117
# different themes are '256', 'dark', 'light', 'base16'
116-
set -g @colors-solarized 'dark'
118+
# set -g @colors-solarized 'dark'
117119

118120
# tmux-powerline: https://github.com/erikw/tmux-powerline
119121
# note that powerline's config is in a separate file, `./tmux-powerlinerc`,

0 commit comments

Comments
 (0)