Skip to content

a5ob7r/tmux-cz

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

67 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tmux CZ

A tmux theme inspired by CZ2128 Delta

tmux statusline with tmux-cz

Requirements

A Tmux with the 256 colours feature.

Almost all Tmux probably fill the requirement, so we don't need to do extra something.

If a problem is happened, please try the following command to run Tmux or equivalent configurations to it.

tmux -2

Installation

Installation with Tmux Plugin Manager (recommended)

  1. Add plugin to the list of TPM plugins in .tmux.conf

    set -g @plugin 'a5ob7r/tmux-cz'
  2. Type prefix + I to fetch the plugin and source it.

Manual Installation

  1. Clone repository to local.

    git clone https://github.com/a5ob7r/tmux-cz.git ~/clone/path
  2. Add this line to ~/.tmux.conf

    run-shell ~/clone/path/tmux-cz.tmux
  3. Reload ~/.tmux.conf

    tmux source-file ~/.tmux.conf

Options

This theme provides some low-level options, which are not user-friendly and are probably hard for users to configure them.

Please see Configurations section at first instead of this section.

Colours

@TMUX_CZ_STATUS_BACKGROUND_COLOUR

The colour of status line background.

The value must be one of valid colour values of Tmux. See the STYLES section in tmux(1) for details.

By default,

set -g @TMUX_CZ_STATUS_BACKGROUND_COLOUR default

Status Line Decorations

Colourful decorations in status-left / status-right.

@TMUX_CZ_STATUS_LEFT_DECORATION

A Tmux format string to construct a part of a colourful decoration in status-left.

The value must be a valid format string of Tmux.

See FORMATS in tmux(1) for details.

By default,

set -g @TMUX_CZ_STATUS_LEFT_DECORATION '#[reverse] #[noreverse]'

@TMUX_CZ_STATUS_RIGHT_DECORATION

A Tmux format string to construct a part of a colourful decoration in status-right.

The value must be a valid format string of Tmux.

See FORMATS in tmux(1) for details.

By default,

set -g @TMUX_CZ_STATUS_RIGHT_DECORATION '#[reverse] #[noreverse]'

Status Line Separators

Status line element separators in status-left / status-right / window-status / window-status-current. They are inserted between two components which have different background colours.

@TMUX_CZ_LEFT_SEPARATOR

By default,

set -g @TMUX_CZ_LEFT_SEPARATOR ''

@TMUX_CZ_RIGHT_SEPARATOR

By default,

set -g @TMUX_CZ_RIGHT_SEPARATOR ''

Status Line Sub Separators

Status line element sub separators in status-left / status-right / window-status / window-status-current. They are inserted between two components which have the same background colour.

@TMUX_CZ_LEFT_SUBSEPARATOR

By default,

set -g @TMUX_CZ_LEFT_SUBSEPARATOR '|'

@TMUX_CZ_RIGHT_SUBSEPARATOR

By default,

set -g @TMUX_CZ_RIGHT_SUBSEPARATOR '|'

Status Line Elements

These options define elements for each status line components as a virtual array user option of Tmux.

Tmux doesn't support to define user options with an array type. Instead, this theme treats a collection of plain user options as an array user option using a variable name format convention. The format is @PREFIX_NAME_INDEX, a head of @ is a prefix to define Tmux user options. This theme treats PREFIX_NAME as a variable name of an array, and INDEX is an index of an array. The order of elements of an array is the alphabetical order of INDEXs, which is depends on the output of the show-options sub-command of Tmux. The valid PREFIX and valid NAMEs are below, but this theme treats any character sequences without spaces ( ) as a valid INDEX.

  • PREFIX
    • TMUX_CZ
  • NAME
    • WINDOW_STATUS_MAIN_ELEMENT
    • WINDOW_STATUS_SUB_ELEMENT
    • WINDOW_STATUS_CURRENT_MAIN_ELEMENT
    • WINDOW_STATUS_CURRENT_SUB_ELEMENT
    • STATUS_LEFT_ELEMENT
    • STATUS_RIGHT_ELEMENT

If a variable name is @TMUX_CZ_WINDOW_STATUS_MAIN_ELEMENT_0, PREFIX is TMUX_CZ, NAME is WINDOW_STATUS_MAIN_ELEMENT and INDEX is 0.

The special format @PREFIX_NAME_ with any value, which is no INDEX, means the empty array.

@TMUX_CZ_WINDOW_STATUS_MAIN_ELEMENT_*

Format strings to represent elements in the right hand side in window-status.

The value must be a valid format string of Tmux.

See FORMATS in tmux(1) for details.

By default,

set -g @TMUX_CZ_WINDOW_STATUS_MAIN_ELEMENT_0 ' #{window_name} '

@TMUX_CZ_WINDOW_STATUS_SUB_ELEMENT_*

Format strings to represent elements in the left hand side in window-status.

The value must be a valid format string of Tmux.

See FORMATS in tmux(1) for details.

By default,

set -g @TMUX_CZ_WINDOW_STATUS_SUB_ELEMENT_0 ' #{window_index}#{window_flags} '

@TMUX_CZ_WINDOW_STATUS_CURRENT_MAIN_ELEMENT_*

Format strings to represent elements in the right hand side in window-status-current.

The value must be a valid format string of Tmux.

See FORMATS in tmux(1) for details.

By default,

set -g @TMUX_CZ_WINDOW_STATUS_CURRENT_MAIN_ELEMENT_0 ' #{window_name} '

@TMUX_CZ_WINDOW_STATUS_CURRENT_SUB_ELEMENT_*

Format strings to represent elements in the left hand side in window-status-current.

The value must be a valid format string of Tmux.

See FORMATS in tmux(1) for details.

By default,

set -g @TMUX_CZ_WINDOW_STATUS_CURRENT_SUB_ELEMENT_0 ' #{window_index}#{window_flags} '

@TMUX_CZ_STATUS_LEFT_ELEMENT_*

Format strings to represent elements in status-left.

The value must be a valid format string of Tmux or one of constants of this theme.

See FORMATS in tmux(1) for details of format strings.

All of constants are below.

  • TMUX_CZ_STATUS_LEFT_DECORATION
    • The colourful decoration in status-left.

By default,

set -g @TMUX_CZ_STATUS_LEFT_ELEMENT_0 TMUX_CZ_STATUS_LEFT_DECORATION
set -g @TMUX_CZ_STATUS_LEFT_ELEMENT_1 ' #H [#S] '

@TMUX_CZ_STATUS_RIGHT_ELEMENT_*

Format strings to represent elements in status-right.

The value must be a valid format string of Tmux or one of constants of this theme.

See FORMATS in tmux(1) for details of format strings.

All of constants are below.

  • TMUX_CZ_STATUS_RIGHT_DECORATION
    • The colourful decoration in status-right.

By default,

set -g @TMUX_CZ_STATUS_RIGHT_ELEMENT_0 ' %H:%M '
set -g @TMUX_CZ_STATUS_RIGHT_ELEMENT_1 ' %Y-%m-%d(%a) '
set -g @TMUX_CZ_STATUS_RIGHT_ELEMENT_2 TMUX_CZ_STATUS_RIGHT_DECORATION

Configurations

This section provides some configuration examples.

Decorations with Powerline Font

tmux statusline with tmux-cz using powerline font

To decorate this theme with Powerline Font,

set -g @TMUX_CZ_STATUS_LEFT_DECORATION 
set -g @TMUX_CZ_STATUS_RIGHT_DECORATION 
set -g @TMUX_CZ_LEFT_SEPARATOR 
set -g @TMUX_CZ_RIGHT_SEPARATOR 
set -g @TMUX_CZ_LEFT_SUBSEPARATOR 
set -g @TMUX_CZ_RIGHT_SUBSEPARATOR 

# OR

set -g @TMUX_CZ_STATUS_LEFT_DECORATION ''
set -g @TMUX_CZ_STATUS_RIGHT_DECORATION ''
set -g @TMUX_CZ_LEFT_SEPARATOR ''
set -g @TMUX_CZ_RIGHT_SEPARATOR ''
set -g @TMUX_CZ_LEFT_SUBSEPARATOR ''
set -g @TMUX_CZ_RIGHT_SUBSEPARATOR ''

Add elements to status line components

To add foo to the status-left component,

set -g @TMUX_CZ_STATUS_LEFT_ELEMENT_1 TMUX_CZ_STATUS_LEFT_DECORATION
set -g @TMUX_CZ_STATUS_LEFT_ELEMENT_2 ' #H [#S] '
set -g @TMUX_CZ_STATUS_LEFT_ELEMENT_3 ' foo '

Or add an element using tmux-battery,

set -g @TMUX_CZ_STATUS_RIGHT_ELEMENT_0 ' #{battery_icon} #{battery_percentage} '
set -g @TMUX_CZ_STATUS_RIGHT_ELEMENT_1 ' %H:%M '
set -g @TMUX_CZ_STATUS_RIGHT_ELEMENT_2 ' %Y-%m-%d(%a) '
set -g @TMUX_CZ_STATUS_RIGHT_ELEMENT_3 TMUX_CZ_STATUS_RIGHT_DECORATION

Remove elements from status line components

To remove the host name element,

set -g @TMUX_CZ_STATUS_LEFT_ELEMENT_0 TMUX_CZ_STATUS_LEFT_DECORATION

Or to remove the right decoration element,

set -g @TMUX_CZ_STATUS_RIGHT_ELEMENT_0 ' %H:%M '
set -g @TMUX_CZ_STATUS_RIGHT_ELEMENT_1 ' %Y-%m-%d(%a) '

Hide status line components

To hide each status line components completely,

# To hide status-left.
set -g @TMUX_CZ_STATUS_LEFT_ELEMENT_ ''

# To hide a main area of window-status-format.
set -g @TMUX_CZ_WINDOW_STATUS_MAIN_ELEMENT_ ''

About

A tmux theme inspired CZ

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages