├── .github └── stale.yml ├── FUNDING.yml ├── LICENSE ├── README.md └── tmux-power.tmux /.github/stale.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Number of days of inactivity before an issue becomes stale 3 | daysUntilStale: 180 4 | # Number of days of inactivity before a stale issue is closed 5 | daysUntilClose: -1 6 | # Issues with these labels will never be considered stale 7 | exemptLabels: 8 | - pinned 9 | - security 10 | - bug 11 | # Label to use when marking an issue as stale 12 | staleLabel: stale 13 | # Comment to post when marking an issue as stale. Set to `false` to disable 14 | markComment: > 15 | This issue has been automatically marked as stale because it has not had 16 | recent activity. It will be closed if no further activity occurs. Thank you 17 | for your contributions. 18 | # Comment to post when closing a stale issue. Set to `false` to disable 19 | closeComment: false 20 | -------------------------------------------------------------------------------- /FUNDING.yml: -------------------------------------------------------------------------------- 1 | ko_fi: wfxr 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | https://wfxr.mit-license.org/2017 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Tmux Power 2 | 3 | Yet another powerline theme for tmux. 4 | 5 | [![TPM](https://img.shields.io/badge/tpm--support-true-blue)](https://github.com/tmux-plugins/tpm) 6 | [![Awesome](https://img.shields.io/badge/Awesome-tmux-d07cd0?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAABVklEQVRIS+3VvWpVURDF8d9CRAJapBAfwWCt+FEJthIUUcEm2NgIYiOxsrCwULCwktjYKSgYLfQF1JjCNvoMNhYRCwOO7HAiVw055yoBizvN3nBmrf8+M7PZsc2RbfY3AfRWeNMSVdUlHEzS1t6oqvt4n+TB78l/AKpqHrdwLcndXndU1WXcw50k10c1PwFV1fa3cQVzSR4PMd/IqaoLeIj2N1eTfG/f1gFVtQMLOI+zSV6NYz4COYFneIGLSdZSVbvwCMdxMsnbvzEfgRzCSyzjXAO8xlHcxMq/mI9oD+AGlhqgxjD93OVOD9TUuICdXd++/VeAVewecKKv2NPlfcHUAM1qK9FTnBmQvJjkdDfWzzE7QPOkAfZiEce2ECzhVJJPHWAfGuTwFpo365pO0NYjmEFr5Eas4SPeJfll2rqb38Z7/yaaD+0eNM3kPejt86REvSX6AamgdXkgoxLxAAAAAElFTkSuQmCC)](https://github.com/rothgar/awesome-tmux) 7 | [![License](https://img.shields.io/badge/License-MIT-brightgreen.svg)](https://wfxr.mit-license.org/2017) 8 | 9 | ![screenshot](https://raw.githubusercontent.com/wfxr/i/master/tmux-power-custom.png) 10 | 11 | ### 📥 Installation 12 | 13 | **Install manually** 14 | 15 | Clone the repo somewhere and source it in `.tmux.conf`: 16 | 17 | ```tmux 18 | run-shell "/path/to/tmux-power.tmux" 19 | ``` 20 | 21 | *NOTE: Options should be set before sourcing.* 22 | 23 | **Install using [TPM](https://github.com/tmux-plugins/tpm)** 24 | 25 | ```tmux 26 | set -g @plugin 'wfxr/tmux-power' 27 | ``` 28 | 29 | ### 🎨 Themes 30 | 31 | #### Gold (default) 32 | ```bash 33 | set -g @tmux_power_theme 'gold' 34 | ``` 35 | ![screenshot](https://raw.githubusercontent.com/wfxr/i/master/tmux-power-gold.png) 36 | 37 | #### Everforest 38 | ```bash 39 | set -g @tmux_power_theme 'everforest' 40 | ``` 41 | ![screenshot](https://raw.githubusercontent.com/wfxr/i/master/tmux-power-everforest.png) 42 | 43 | #### Moon 44 | ```bash 45 | set -g @tmux_power_theme 'moon' 46 | ``` 47 | ![screenshot](https://raw.githubusercontent.com/wfxr/i/master/tmux-power-moon.png) 48 | 49 | #### Coral 50 | ```bash 51 | set -g @tmux_power_theme 'coral' 52 | ``` 53 | ![screenshot](https://raw.githubusercontent.com/wfxr/i/master/tmux-power-coral.png) 54 | 55 | #### Snow 56 | ```bash 57 | set -g @tmux_power_theme 'snow' 58 | ``` 59 | #### Forest 60 | ```bash 61 | set -g @tmux_power_theme 'forest' 62 | ``` 63 | Violet 64 | ```bash 65 | set -g @tmux_power_theme 'violet' 66 | ``` 67 | #### Redwine 68 | ```bash 69 | set -g @tmux_power_theme 'redwine' 70 | ``` 71 | ### ⚙ Customizing 72 | 73 | You can define your favourite colors if you don't like any of above. 74 | 75 | ```tmux 76 | # You can set it to a true color in '#RRGGBB' format 77 | set -g @tmux_power_theme '#483D8B' # dark slate blue 78 | 79 | # Or you can set it to 'colorX' which honors your terminal colorscheme 80 | set -g @tmux_power_theme 'colour3' 81 | 82 | # The following colors are used as gradient colors 83 | set -g @tmux_power_g0 "#262626" 84 | set -g @tmux_power_g1 "#303030" 85 | set -g @tmux_power_g2 "#3a3a3a" 86 | set -g @tmux_power_g3 "#444444" 87 | set -g @tmux_power_g4 "#626262" 88 | ``` 89 | 90 | You can change the date and time formats using strftime: 91 | 92 | ```tmux 93 | set -g @tmux_power_date_format '%F' 94 | set -g @tmux_power_time_format '%T' 95 | ``` 96 | 97 | You can also customize the icons. As an example, 98 | the following configurations can generate the theme shown in the first screenshot: 99 | ```bash 100 | set -g @plugin 'wfxr/tmux-power' 101 | set -g @plugin 'wfxr/tmux-net-speed' 102 | set -g @tmux_power_theme 'everforest' 103 | set -g @tmux_power_date_icon ' ' 104 | set -g @tmux_power_time_icon ' ' 105 | set -g @tmux_power_user_icon ' ' 106 | set -g @tmux_power_session_icon ' ' 107 | set -g @tmux_power_right_arrow_icon '' 108 | set -g @tmux_power_left_arrow_icon '' 109 | set -g @tmux_power_upload_speed_icon '󰕒' 110 | set -g @tmux_power_download_speed_icon '󰇚' 111 | ``` 112 | 113 | The following components can be toggled on or off: 114 | 115 | ```tmux 116 | set -g @tmux_power_show_user true 117 | set -g @tmux_power_show_host true 118 | set -g @tmux_power_show_session true 119 | ``` 120 | 121 | *The default icons use glyphs from [nerd-fonts](https://github.com/ryanoasis/nerd-fonts).* 122 | 123 | ### 📦 Plugin support 124 | 125 | **[tmux-net-speed](https://github.com/wfxr/tmux-net-speed)** 126 | 127 | ```tmux 128 | set -g @tmux_power_show_upload_speed true 129 | set -g @tmux_power_show_download_speed true 130 | ``` 131 | 132 | **[tmux-prefix-highlight](https://github.com/tmux-plugins/tmux-prefix-highlight)** 133 | 134 | ```tmux 135 | # 'L' for left only, 'R' for right only and 'LR' for both 136 | set -g @tmux_power_prefix_highlight_pos 'LR' 137 | ``` 138 | 139 | **[tmux-web-reachable](https://github.com/wfxr/tmux-web-reachable)** 140 | 141 | ```tmux 142 | set -g @tmux_power_show_web_reachable true 143 | ``` 144 | 145 | ### 🔗 Other plugins 146 | 147 | You might also find these useful: 148 | 149 | - [tmux-fzf-url](https://github.com/wfxr/tmux-fzf-url) 150 | - [tmux-net-speed](https://github.com/wfxr/tmux-net-speed) 151 | - [tmux-web-reachable](https://github.com/wfxr/tmux-web-reachable) 152 | 153 | ### 📃 License 154 | 155 | [MIT](https://wfxr.mit-license.org/2017) (c) Wenxuan Zhang 156 | -------------------------------------------------------------------------------- /tmux-power.tmux: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | #=============================================================================== 3 | # Author: Wenxuan 4 | # Email: wenxuangm@gmail.com 5 | # Created: 2018-04-05 17:37 6 | #=============================================================================== 7 | 8 | # $1: option 9 | # $2: default value 10 | tmux_get() { 11 | local value 12 | value="$(tmux show -gqv "$1")" 13 | [ -n "$value" ] && echo "$value" || echo "$2" 14 | } 15 | 16 | # $1: option 17 | # $2: value 18 | tmux_set() { 19 | tmux set-option -gq "$1" "$2" 20 | } 21 | 22 | # Options 23 | rarrow=$(tmux_get '@tmux_power_right_arrow_icon' '') 24 | larrow=$(tmux_get '@tmux_power_left_arrow_icon' '') 25 | upload_speed_icon=$(tmux_get '@tmux_power_upload_speed_icon' '󰕒') 26 | download_speed_icon=$(tmux_get '@tmux_power_download_speed_icon' '󰇚') 27 | session_icon="$(tmux_get '@tmux_power_session_icon' '')" 28 | user_icon="$(tmux_get '@tmux_power_user_icon' '')" 29 | time_icon="$(tmux_get '@tmux_power_time_icon' '')" 30 | date_icon="$(tmux_get '@tmux_power_date_icon' '')" 31 | show_user="$(tmux_get @tmux_power_show_user true)" 32 | show_host="$(tmux_get @tmux_power_show_host true)" 33 | show_session="$(tmux_get @tmux_power_show_session true)" 34 | show_upload_speed="$(tmux_get @tmux_power_show_upload_speed false)" 35 | show_download_speed="$(tmux_get @tmux_power_show_download_speed false)" 36 | show_web_reachable="$(tmux_get @tmux_power_show_web_reachable false)" 37 | prefix_highlight_pos=$(tmux_get @tmux_power_prefix_highlight_pos) 38 | time_format=$(tmux_get @tmux_power_time_format '%T') 39 | date_format=$(tmux_get @tmux_power_date_format '%F') 40 | 41 | # short for Theme-Colour 42 | TC=$(tmux_get '@tmux_power_theme' 'gold') 43 | case $TC in 44 | 'gold' ) 45 | TC='#ffb86c' 46 | ;; 47 | 'redwine' ) 48 | TC='#b34a47' 49 | ;; 50 | 'moon' ) 51 | TC='#00abab' 52 | ;; 53 | 'forest' ) 54 | TC='#228b22' 55 | ;; 56 | 'violet' ) 57 | TC='#9370db' 58 | ;; 59 | 'snow' ) 60 | TC='#fffafa' 61 | ;; 62 | 'coral' ) 63 | TC='#ff7f50' 64 | ;; 65 | 'sky' ) 66 | TC='#87ceeb' 67 | ;; 68 | 'everforest' ) 69 | TC='#a7c080' 70 | ;; 71 | esac 72 | 73 | G0=$(tmux_get @tmux_power_g0 "#262626") 74 | G1=$(tmux_get @tmux_power_g1 "#303030") 75 | G2=$(tmux_get @tmux_power_g2 "#3a3a3a") 76 | G3=$(tmux_get @tmux_power_g3 "#444444") 77 | G4=$(tmux_get @tmux_power_g4 "#626262") 78 | 79 | # Status options 80 | tmux_set status-interval 1 81 | tmux_set status on 82 | 83 | # Basic status bar colors 84 | tmux_set status-bg "$G0" 85 | tmux_set status-fg "$G4" 86 | tmux_set status-attr none 87 | 88 | # tmux-prefix-highlight 89 | tmux_set @prefix_highlight_show_copy_mode 'on' 90 | tmux_set @prefix_highlight_copy_mode_attr "fg=$TC,bg=$G0,bold" 91 | tmux_set @prefix_highlight_output_prefix "#[fg=$TC]#[bg=$G0]$larrow#[bg=$TC]#[fg=$G0]" 92 | tmux_set @prefix_highlight_output_suffix "#[fg=$TC]#[bg=$G0]$rarrow" 93 | 94 | #      95 | # Left side of status bar 96 | tmux_set status-left-bg "$G0" 97 | tmux_set status-left-length 150 98 | 99 | # user@host 100 | if "$show_user" && "$show_host"; then 101 | LS="#[fg=$G0,bg=$TC,bold] $user_icon $(whoami)@#h #[fg=$TC,bg=$G2,nobold]$rarrow" 102 | elif "$show_user"; then 103 | LS="#[fg=$G0,bg=$TC,bold] $user_icon $(whoami) #[fg=$TC,bg=$G2,nobold]$rarrow" 104 | elif "$show_host"; then 105 | LS="#[fg=$G0,bg=$TC,bold] #h #[fg=$TC,bg=$G2,nobold]$rarrow" 106 | fi 107 | 108 | # session 109 | if "$show_session"; then 110 | LS="$LS#[fg=$TC,bg=$G2] $session_icon #S " 111 | fi 112 | 113 | # upload speed 114 | if "$show_upload_speed"; then 115 | LS="$LS#[fg=$G2,bg=$G1]$rarrow#[fg=$TC,bg=$G1] $upload_speed_icon #{upload_speed} #[fg=$G1,bg=$G0]$rarrow" 116 | else 117 | LS="$LS#[fg=$G2,bg=$G0]$rarrow" 118 | fi 119 | if [[ $prefix_highlight_pos == 'L' || $prefix_highlight_pos == 'LR' ]]; then 120 | LS="$LS#{prefix_highlight}" 121 | fi 122 | tmux_set status-left "$LS" 123 | 124 | # Right side of status bar 125 | tmux_set status-right-bg "$G0" 126 | tmux_set status-right-length 150 127 | RS="#[fg=$G2]$larrow#[fg=$TC,bg=$G2] $time_icon $time_format #[fg=$TC,bg=$G2]$larrow#[fg=$G0,bg=$TC] $date_icon $date_format " 128 | if "$show_download_speed"; then 129 | RS="#[fg=$G1,bg=$G0]$larrow#[fg=$TC,bg=$G1] $download_speed_icon #{download_speed} $RS" 130 | fi 131 | if "$show_web_reachable"; then 132 | RS=" #{web_reachable_status} $RS" 133 | fi 134 | if [[ $prefix_highlight_pos == 'R' || $prefix_highlight_pos == 'LR' ]]; then 135 | RS="#{prefix_highlight}$RS" 136 | fi 137 | tmux_set status-right "$RS" 138 | 139 | # Window status format 140 | tmux_set window-status-format "#[fg=$G0,bg=$G2]$rarrow#[fg=$TC,bg=$G2] #I:#W#F #[fg=$G2,bg=$G0]$rarrow" 141 | tmux_set window-status-current-format "#[fg=$G0,bg=$TC]$rarrow#[fg=$G0,bg=$TC,bold] #I:#W#F #[fg=$TC,bg=$G0,nobold]$rarrow" 142 | 143 | # Window status style 144 | tmux_set window-status-style "fg=$TC,bg=$G0,none" 145 | tmux_set window-status-last-style "fg=$TC,bg=$G0,bold" 146 | tmux_set window-status-activity-style "fg=$TC,bg=$G0,bold" 147 | 148 | # Window separator 149 | tmux_set window-status-separator "" 150 | 151 | # Pane border 152 | tmux_set pane-border-style "fg=$G3,bg=default" 153 | 154 | # Active pane border 155 | tmux_set pane-active-border-style "fg=$TC,bg=default" 156 | 157 | # Pane number indicator 158 | tmux_set display-panes-colour "$G3" 159 | tmux_set display-panes-active-colour "$TC" 160 | 161 | # Clock mode 162 | tmux_set clock-mode-colour "$TC" 163 | tmux_set clock-mode-style 24 164 | 165 | # Message 166 | tmux_set message-style "fg=$TC,bg=$G0" 167 | 168 | # Command message 169 | tmux_set message-command-style "fg=$TC,bg=$G0" 170 | 171 | # Copy mode highlight 172 | tmux_set mode-style "bg=$TC,fg=$G4" 173 | --------------------------------------------------------------------------------