├── .github └── workflows │ ├── semantic-release.yaml │ └── shellcheck.yml ├── .releaserc ├── CHANGELOG.md ├── README.md ├── assets ├── tokyo-night-active.png └── tokyo-night.png ├── src ├── palletes │ ├── day.sh │ ├── moon.sh │ ├── night.sh │ └── storm.sh ├── plugin │ ├── battery.sh │ ├── datetime.sh │ ├── homebrew.sh │ ├── playerctl.sh │ ├── spt.sh │ ├── weather.sh │ └── yay.sh ├── theme.sh └── utils.sh └── tmux-tokyo-night.tmux /.github/workflows/semantic-release.yaml: -------------------------------------------------------------------------------- 1 | name: semantic-release 2 | on: 3 | push: 4 | branches: 5 | - main 6 | workflow_dispatch: 7 | jobs: 8 | release: 9 | name: Release 10 | runs-on: ubuntu-latest 11 | steps: 12 | - name: Checkout 13 | uses: actions/checkout@v2 14 | with: 15 | fetch-depth: 0 16 | - name: Setup Node.js 17 | uses: actions/setup-node@v1 18 | with: 19 | node-version: "20" 20 | - name: Install dependencies 21 | run: npm install semantic-release @semantic-release/commit-analyzer @semantic-release/release-notes-generator @semantic-release/changelog @semantic-release/github @semantic-release/git 22 | - name: Release 23 | env: 24 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 25 | run: GITHUB_TOKEN=${GITHUB_TOKEN} npx semantic-release 26 | -------------------------------------------------------------------------------- /.github/workflows/shellcheck.yml: -------------------------------------------------------------------------------- 1 | --- 2 | on: 3 | push: 4 | branches: 5 | - main 6 | pull_request: 7 | types: [opened, synchronize] 8 | 9 | name: "Trigger: Push action" 10 | 11 | jobs: 12 | shellcheck: 13 | name: Shellcheck 14 | runs-on: ubuntu-latest 15 | steps: 16 | - uses: actions/checkout@v3 17 | - name: Run ShellCheck 18 | uses: ludeeus/action-shellcheck@master 19 | with: 20 | check_together: "yes" 21 | -------------------------------------------------------------------------------- /.releaserc: -------------------------------------------------------------------------------- 1 | { 2 | "branches": ["main"], 3 | "plugins": [ 4 | "@semantic-release/commit-analyzer", 5 | "@semantic-release/release-notes-generator", 6 | [ 7 | "@semantic-release/changelog", 8 | { 9 | "changelogFile": "CHANGELOG.md" 10 | } 11 | ], 12 | [ 13 | "@semantic-release/git", 14 | { 15 | "assets": ["CHANGELOG.md"] 16 | } 17 | ], 18 | ["@semantic-release/github", { 19 | "successComment": false, 20 | "failComment": false, 21 | }] 22 | ] 23 | } 24 | 25 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # [1.10.0](https://github.com/fabioluciano/tmux-tokyo-night/compare/v1.9.0...v1.10.0) (2024-11-29) 2 | 3 | 4 | ### Features 5 | 6 | * **weather:** add support for overriding IP-based location ([8f2421a](https://github.com/fabioluciano/tmux-tokyo-night/commit/8f2421acb443ce1ab206d1d090fecb7a59efeffd)) 7 | 8 | # [1.9.0](https://github.com/fabioluciano/tmux-tokyo-night/compare/v1.8.1...v1.9.0) (2024-10-29) 9 | 10 | 11 | ### Features 12 | 13 | * Allow customizing the window title string ([e064b37](https://github.com/fabioluciano/tmux-tokyo-night/commit/e064b37f00c6b5cd3754c6da1d4f7fbff11c225b)) 14 | 15 | ## [1.8.1](https://github.com/fabioluciano/tmux-tokyo-night/compare/v1.8.0...v1.8.1) (2024-10-24) 16 | 17 | 18 | ### Bug Fixes 19 | 20 | * extra space after active window name ([29a086e](https://github.com/fabioluciano/tmux-tokyo-night/commit/29a086e354fb9e99fef60058cab9a112818a6dd4)) 21 | * Forgot transparent and left_separator_inverse ([a0228fe](https://github.com/fabioluciano/tmux-tokyo-night/commit/a0228fec97267dbf395862787a3bb981b44a3dc3)) 22 | * removing theme_enable_icons ([c053ee2](https://github.com/fabioluciano/tmux-tokyo-night/commit/c053ee2562cfdecbadca59fde6d62f15194c1602)) 23 | * run shellcheck on pull_requests ([31d10c0](https://github.com/fabioluciano/tmux-tokyo-night/commit/31d10c065af23fee3bd1f59cf27cc24b3429e13f)) 24 | * shellcheck warnings ([8d706a9](https://github.com/fabioluciano/tmux-tokyo-night/commit/8d706a9631e88f5aba35f41ce7c3c71e22ca2833)) 25 | * shellcheck warnings about unused vars ([6a340c8](https://github.com/fabioluciano/tmux-tokyo-night/commit/6a340c80148eee0a1d7af78ac38376971d2bb73f)) 26 | * **shellcheck:** run files together to fix SC1091 ([df678f1](https://github.com/fabioluciano/tmux-tokyo-night/commit/df678f107726f1463667b5e2f5290bae13ff87fd)) 27 | 28 | # [1.8.0](https://github.com/fabioluciano/tmux-tokyo-night/compare/v1.7.1...v1.8.0) (2024-10-01) 29 | 30 | 31 | ### Features 32 | 33 | * fix [#37](https://github.com/fabioluciano/tmux-tokyo-night/issues/37) transparency support ([3be2aa2](https://github.com/fabioluciano/tmux-tokyo-night/commit/3be2aa280242941947d31a0386764e7f78b734bd)) 34 | 35 | ## [1.7.1](https://github.com/fabioluciano/tmux-tokyo-night/compare/v1.7.0...v1.7.1) (2024-09-11) 36 | 37 | 38 | ### Bug Fixes 39 | 40 | * add battery to list of plugins in table ([bc4d532](https://github.com/fabioluciano/tmux-tokyo-night/commit/bc4d5321a60c160844f85fb6a9c48f6d7c628f89)) 41 | * **battery:** Colors / icons not updating ([106bc2b](https://github.com/fabioluciano/tmux-tokyo-night/commit/106bc2bd33cd99ffdf042df2f5aff8448550fea6)) 42 | * **battery:** remove space after battery icon ([1d7ca1f](https://github.com/fabioluciano/tmux-tokyo-night/commit/1d7ca1fbdf63e427b998b7dbc7d4ac8bcdbf44a6)) 43 | * removing unused line ([8e51ec2](https://github.com/fabioluciano/tmux-tokyo-night/commit/8e51ec211cf6286997db5acfe3ba594492020bfe)) 44 | 45 | # [1.7.0](https://github.com/fabioluciano/tmux-tokyo-night/compare/v1.6.0...v1.7.0) (2024-08-06) 46 | 47 | 48 | ### Features 49 | 50 | * added additional icons customization options ([0b686ee](https://github.com/fabioluciano/tmux-tokyo-night/commit/0b686ee22f02ae1ac437b06a1bf8241861b3c07b)) 51 | 52 | # [1.6.0](https://github.com/fabioluciano/tmux-tokyo-night/compare/v1.5.2...v1.6.0) (2024-07-29) 53 | 54 | 55 | ### Features 56 | 57 | * add synchronized panes indicator ([ecde261](https://github.com/fabioluciano/tmux-tokyo-night/commit/ecde2617a5eece581d9f78e07e53e36eea5980da)) 58 | 59 | ## [1.5.2](https://github.com/fabioluciano/tmux-tokyo-night/compare/v1.5.1...v1.5.2) (2024-06-04) 60 | 61 | 62 | ### Bug Fixes 63 | 64 | * typos ([c698679](https://github.com/fabioluciano/tmux-tokyo-night/commit/c6986790a5a48d4d04da9f5c03919a70b1eb58fd)) 65 | 66 | ## [1.5.1](https://github.com/fabioluciano/tmux-tokyo-night/compare/v1.5.0...v1.5.1) (2024-06-03) 67 | 68 | 69 | ### Bug Fixes 70 | 71 | * yay and homebrew signals when there is no packages to update ([bf7b935](https://github.com/fabioluciano/tmux-tokyo-night/commit/bf7b935a4458b4ab2700255bb237661eff48c28f)) 72 | 73 | # [1.5.0](https://github.com/fabioluciano/tmux-tokyo-night/compare/v1.4.1...v1.5.0) (2024-06-02) 74 | 75 | 76 | ### Features 77 | 78 | * add yay plugin ([6209478](https://github.com/fabioluciano/tmux-tokyo-night/commit/6209478e2df93d957e647a5c028ffaf2dc1c53c2)) 79 | 80 | ## [1.4.1](https://github.com/fabioluciano/tmux-tokyo-night/compare/v1.4.0...v1.4.1) (2024-06-01) 81 | 82 | 83 | ### Bug Fixes 84 | 85 | * fixing typo ([5fa4885](https://github.com/fabioluciano/tmux-tokyo-night/commit/5fa4885bbf28bb743e54f46f0e999846d162d2b7)) 86 | 87 | # [1.4.0](https://github.com/fabioluciano/tmux-tokyo-night/compare/v1.3.0...v1.4.0) (2024-06-01) 88 | 89 | 90 | ### Features 91 | 92 | * add homebrew plugin ([31d411c](https://github.com/fabioluciano/tmux-tokyo-night/commit/31d411c4c4d5a131142906f2d9bdf768e81b46f7)) 93 | 94 | # [1.3.0](https://github.com/fabioluciano/tmux-tokyo-night/compare/v1.2.1...v1.3.0) (2024-05-31) 95 | 96 | 97 | ### Features 98 | 99 | * adding the option to customize the session icon ([1f768eb](https://github.com/fabioluciano/tmux-tokyo-night/commit/1f768eb941840b778b8c2b68f1d3abfdfbed9fc3)) 100 | 101 | ## [1.2.1](https://github.com/fabioluciano/tmux-tokyo-night/compare/v1.2.0...v1.2.1) (2024-05-31) 102 | 103 | 104 | ### Bug Fixes 105 | 106 | * fixing [@theme-plugins](https://github.com/theme-plugins) parameter for [@theme](https://github.com/theme)_plugins ([d8b0253](https://github.com/fabioluciano/tmux-tokyo-night/commit/d8b0253288c4b101eddeaf4c879de3c9ee65184d)) 107 | 108 | # [1.2.0](https://github.com/fabioluciano/tmux-tokyo-night/compare/v1.1.0...v1.2.0) (2024-05-31) 109 | 110 | 111 | ### Features 112 | 113 | * **spt-plugin:** add spotify-tui plugin ([377248d](https://github.com/fabioluciano/tmux-tokyo-night/commit/377248de5784ba7da3a6c912a8005d4bdc403acb)) 114 | 115 | # [1.1.0](https://github.com/fabioluciano/tmux-tokyo-night/compare/v1.0.0...v1.1.0) (2024-05-30) 116 | 117 | 118 | ### Features 119 | 120 | * **weather-plugin:** check for jq first ([e80576b](https://github.com/fabioluciano/tmux-tokyo-night/commit/e80576b2d771b2a134f75820d3852ce3de2651a8)) 121 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
2 |

Tokyo Night Tmux Theme

3 | 4 |

A Tokyo Night tmux theme directly inspired from Tokyo Night vim theme

5 | 6 | --- 7 | 8 | **[
 Features 
][features]** 9 | **[
 Screenshots 
][screenshots]** 10 | **[
 Install 
][install]** 11 | **[
 Available Configurations 
][available-configurations]** 12 | **[
 Plugins 
][plugins]** 13 | 14 | --- 15 | 16 |
17 | 18 | ## Features 19 | 20 | - [Transparency support](#Transparency-examples) 21 | 22 | ## Plugins 23 | 24 | - **Datetime** - Show datetime; 25 | - **Weather** - Show weather; 26 | - **Playerctl** - Show playerctl; 27 | - **Spt** - Show Spotify; 28 | - **Homebrew** - Show Homebrew; 29 | - **yay** - Show yay; 30 | - **battery** - Show battery; 31 | 32 | ## Screenshots 33 | 34 | ### Tokyo Night - Default Variation 35 | 36 | | Inactive | Active | 37 | | -------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | 38 | | ![Tokyo Night tmux theme - Default Variation](./assets/tokyo-night.png "Tokyo Night tmux theme - Default Variation") | ![Tokyo Night tmux theme - Default Variation](./assets/tokyo-night-active.png "Tokyo Night tmux theme - Default Variation") | 39 | 40 | ## Install 41 | 42 | Add plugin to the list of `TPM` plugins in `.tmux.conf`: 43 | 44 | ``` 45 | set -g @plugin 'fabioluciano/tmux-tokyo-night' 46 | ``` 47 | 48 | Hit prefix + I to fetch the plugin and source it. You can now use the plugin. 49 | 50 | ## Available Configurations 51 | 52 | | Configuration | Description | Avaliable Options | Default | 53 | | ----------------------------------- | ----------------------------------------- | ----------------------------------------------------------------------- | ------------------ | 54 | | `@theme_variation` | The tokyo night theme variation to be use | `night`, `storm`, `moon` | `night` | 55 | | `@theme_active_pane_border_style` | | | `#737aa2` | 56 | | `@theme_inactive_pane_border_style` | | | `#292e42` | 57 | | `@theme_left_separator` | | | `` | 58 | | `@theme_right_separator` | | | `` | 59 | | `@theme_window_with_activity_style` | | | `italics` | 60 | | `@theme_status_bell_style` | | | `bold` | 61 | | `@theme_plugins` | | `datetime`, `weather`, `playerctl`, `spt`, `homebrew`, `yay`, `battery` | `datetime,weather` | 62 | | `@theme_disable_plugins` | Disables plugins | `1`, `0` | `0` | 63 | 64 | ## Plugins 65 | 66 | ### Datetime 67 | 68 | > Prints informations about the current date and time. 69 | 70 | | Configuration | Description | Avaliable Options | Default | 71 | | ------------------------------------------ | ----------- | ----------------- | ------- | 72 | | `@theme_plugin_datetime_icon` | | Any character 📅 | Nerd Font 'Calendar' icon | 73 | | `@theme_plugin_datetime_accent_color` | | | | 74 | | `@theme_plugin_datetime_accent_color_icon` | | | | 75 | | `@theme_plugin_datetime_format` | | | | 76 | 77 | ### Weather 78 | 79 | > Prints informations about the current weather. It uses `jq` to parse the response. Make shure to have it; 80 | 81 | | Configuration | Description | Avaliable Options | Default | 82 | | ----------------------------------------- | ----------- | ----------------- | ------- | 83 | | `@theme_plugin_weather_icon` | | Any character 🌡️ | Font Awesome 'Cloud' icon | 84 | | `@theme_plugin_weather_accent_color` | | | | 85 | | `@theme_plugin_weather_accent_color_icon` | | | | 86 | | `@theme_plugin_weather_format` | Format for displaying weather information | `%t`, `%c`, `%h`, `%w` (temperature, condition, humidity, wind) | `%t+H:%h` | 87 | | `@theme_plugin_weather_location` | Location for weather (city/country) | `"City, Country"` | IP-based location detection | 88 | 89 | #### Example 90 | ``` 91 | set -g @theme_plugin_weather_location 'Blacksburg, United States' 92 | ``` 93 | 94 | ### Playerctl 95 | 96 | > Prints informations about the current song playing. Does not work in `MacOS`, because it uses `MPRIS`, and is only available in `Linux`. 97 | 98 | | Configuration | Description | Avaliable Options | Default | 99 | | ------------------------------------------- | ----------- | ----------------- | ------- | 100 | | `@theme_plugin_playerctl_icon` | | | | 101 | | `@theme_plugin_playerctl_accent_color` | | | | 102 | | `@theme_plugin_playerctl_accent_color_icon` | | | | 103 | | `@theme_plugin_playerctl_format` | | | | 104 | 105 | ### Battery 106 | 107 | Shows battery charging status (charging or discharging) and battery percentage. 108 | 109 | | Configuration | Description | Avaliable Options | Default | 110 | | ------------------------------------------------ | ---------------------------------- | ----------------- | -------- | 111 | | `@theme_plugin_battery_charging_icon` | Icon to display when charging | Any character |  | 112 | | `@theme_plugin_battery_discharging` | Icon to display when on battery | Any character | 󰁹 | 113 | | `@theme_plugin_battery_red_threshold` | Show in red when below this % | 0-100 | 10 | 114 | | `@theme_plugin_battery_yellow_threshold` | Show in yellow when below this % | 0-100 | 30 | 115 | | `@theme_plugin_battery_red_accent_color` | Color when < red threshold | Palette color | red | 116 | | `@theme_plugin_battery_red_accent_color_icon` | Icon color when < red threshold | Palette color | magenta2 | 117 | | `@theme_plugin_battery_yellow_accent_color` | Color when < yellow threshold | Palette color | yellow | 118 | | `@theme_plugin_battery_yellow_accent_color_icon` | Icon color when < yellow threshold | Palette color | orange | 119 | | `@theme_plugin_battery_green_accent_color` | Color when > yellow threshold | Palette color | blue7 | 120 | | `@theme_plugin_battery_green_accent_color_icon` | Icon color when > yellow threshold | Palette color | blue0 | 121 | 122 | ### Example configuration 123 | 124 | tmux.conf 125 | 126 | ```bash 127 | set -g @plugin 'tmux-plugins/tpm' 128 | 129 | set -g @plugin 'tmux-plugins/tmux-pain-control' 130 | set -g @plugin 'tmux-plugins/tmux-sensible' 131 | set -g @plugin 'tmux-plugins/tmux-logging' 132 | 133 | set -g @plugin 'fabioluciano/tmux-tokyo-night' 134 | 135 | ### Tokyo Night Theme configuration 136 | set -g @theme_variation 'moon' 137 | set -g @theme_left_separator '' 138 | set -g @theme_right_separator '' 139 | set -g @theme_plugins 'datetime,weather,playerctl,yay' 140 | 141 | run '~/.tmux/plugins/tpm/tpm' 142 | ``` 143 | 144 | ### Transparency examples 145 | 146 | Enable transparency with default separators: 147 | 148 | ```bash 149 | ### Enable transparency 150 | set -g @theme_transparent_status_bar 'true' 151 | ``` 152 | 153 | ![Screenshot 2024-09-07 at 12 41 12](https://github.com/user-attachments/assets/56287ccb-9be9-4aa5-a2ab-ec48d2b2d08a) 154 | 155 | #### 156 | 157 | Can also use custom separators: 158 | 159 | ```bash 160 | ### Enable transparency 161 | set -g @theme_left_separator '' 162 | set -g @theme_right_separator '' 163 | set -g @theme_transparent_status_bar 'true' 164 | set -g @theme_transparent_left_separator_inverse '' 165 | set -g @theme_transparent_right_separator_inverse '' 166 | 167 | ``` 168 | 169 | ![Screenshot 2024-09-07 at 12 39 35](https://github.com/user-attachments/assets/a33417b1-34e0-4212-952e-7ef1e240e943) 170 | 171 | [features]: #features 172 | [screenshots]: #screenshots 173 | [install]: #install 174 | [available-configurations]: #available-configurations 175 | [plugins]: #plugins 176 | -------------------------------------------------------------------------------- /assets/tokyo-night-active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fabioluciano/tmux-tokyo-night/54870913b2efd343da78352acd47df975331e37e/assets/tokyo-night-active.png -------------------------------------------------------------------------------- /assets/tokyo-night.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fabioluciano/tmux-tokyo-night/54870913b2efd343da78352acd47df975331e37e/assets/tokyo-night.png -------------------------------------------------------------------------------- /src/palletes/day.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | #Tokyo Night Day Pallet 4 | declare -A PALLETE=( 5 | [none]="NONE" 6 | [bg]="#1a1b26" 7 | [bg_dark]="#16161e" 8 | [bg_highlight]="#292e42" 9 | [terminal_black]="#414868" 10 | [fg]="#c0caf5" 11 | [fg_dark]="#a9b1d6" 12 | [fg_gutter]="#3b4261" 13 | [dark3]="#545c7e" 14 | [comment]="#565f89" 15 | [dark5]="#737aa2" 16 | [blue0]="#3d59a1" 17 | [blue]="#7aa2f7" 18 | [cyan]="#7dcfff" 19 | [blue1]="#2ac3de" 20 | [blue2]="#0db9d7" 21 | [blue5]="#89ddff" 22 | [blue6]="#b4f9f8" 23 | [blue7]="#394b70" 24 | [magenta]="#bb9af7" 25 | [magenta2]="#ff007c" 26 | [purple]="#9d7cd8" 27 | [orange]="#ff9e64" 28 | [yellow]="#e0af68" 29 | [green]="#9ece6a" 30 | [green1]="#73daca" 31 | [green2]="#41a6b5" 32 | [teal]="#1abc9c" 33 | [red]="#f7768e" 34 | [red1]="#db4b4b" 35 | [white]="#ffffff" 36 | ) 37 | 38 | export PALLETE 39 | -------------------------------------------------------------------------------- /src/palletes/moon.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | #Tokyo Night Moon Pallet 4 | declare -A PALLETE=( 5 | [none]="NONE" 6 | [bg_dark]="#1e2030" 7 | [bg]="#222436" 8 | [bg_highlight]="#2f334d" 9 | [terminal_black]="#444a73" 10 | [fg]="#c8d3f5" 11 | [fg_dark]="#828bb8" 12 | [fg_gutter]="#3b4261" 13 | [dark3]="#545c7e" 14 | [comment]="#7a88cf" 15 | [dark5]="#737aa2" 16 | [blue0]="#3e68d7" 17 | [blue]="#82aaff" 18 | [cyan]="#86e1fc" 19 | [blue1]="#65bcff" 20 | [blue2]="#0db9d7" 21 | [blue5]="#89ddff" 22 | [blue6]="#b4f9f8" 23 | [blue7]="#394b70" 24 | [purple]="#fca7ea" 25 | [magenta2]="#ff007c" 26 | [magenta]="#c099ff" 27 | [orange]="#ff966c" 28 | [yellow]="#ffc777" 29 | [green]="#c3e88d" 30 | [green1]="#4fd6be" 31 | [green2]="#41a6b5" 32 | [teal]="#4fd6be" 33 | [red]="#ff757f" 34 | [red1]="#c53b53" 35 | [white]="#ffffff" 36 | ) 37 | 38 | export PALLETE 39 | -------------------------------------------------------------------------------- /src/palletes/night.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | #Tokyo Night Pallet 4 | declare -A PALLETE=( 5 | [none]="NONE" 6 | [bg]="#1a1b26" 7 | [bg_dark]="#16161e" 8 | [bg_highlight]="#292e42" 9 | [terminal_black]="#414868" 10 | [fg]="#c0caf5" 11 | [fg_dark]="#a9b1d6" 12 | [fg_gutter]="#3b4261" 13 | [dark3]="#545c7e" 14 | [comment]="#565f89" 15 | [dark5]="#737aa2" 16 | [blue0]="#3d59a1" 17 | [blue]="#7aa2f7" 18 | [cyan]="#7dcfff" 19 | [blue1]="#2ac3de" 20 | [blue2]="#0db9d7" 21 | [blue5]="#89ddff" 22 | [blue6]="#b4f9f8" 23 | [blue7]="#394b70" 24 | [magenta]="#bb9af7" 25 | [magenta2]="#ff007c" 26 | [purple]="#9d7cd8" 27 | [orange]="#ff9e64" 28 | [yellow]="#e0af68" 29 | [green]="#9ece6a" 30 | [green1]="#73daca" 31 | [green2]="#41a6b5" 32 | [teal]="#1abc9c" 33 | [red]="#f7768e" 34 | [red1]="#db4b4b" 35 | [white]="#ffffff" 36 | ) 37 | 38 | export PALLETE 39 | -------------------------------------------------------------------------------- /src/palletes/storm.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | #Tokyo Night Storm Pallet 4 | declare -A PALLETE=( 5 | [none]="NONE" 6 | [bg_dark]="#1f2335" 7 | [bg]="#24283b" 8 | [bg_highlight]="#292e42" 9 | [terminal_black]="#414868" 10 | [fg]="#c0caf5" 11 | [fg_dark]="#a9b1d6" 12 | [fg_gutter]="#3b4261" 13 | [dark3]="#545c7e" 14 | [comment]="#565f89" 15 | [dark5]="#737aa2" 16 | [blue0]="#3d59a1" 17 | [blue]="#7aa2f7" 18 | [cyan]="#7dcfff" 19 | [blue1]="#2ac3de" 20 | [blue2]="#0db9d7" 21 | [blue5]="#89ddff" 22 | [blue6]="#b4f9f8" 23 | [blue7]="#394b70" 24 | [magenta]="#bb9af7" 25 | [magenta2]="#ff007c" 26 | [purple]="#9d7cd8" 27 | [orange]="#ff9e64" 28 | [yellow]="#e0af68" 29 | [green]="#9ece6a" 30 | [green1]="#73daca" 31 | [green2]="#41a6b5" 32 | [teal]="#1abc9c" 33 | [red]="#f7768e" 34 | [red1]="#db4b4b" 35 | [white]="#ffffff" 36 | ) 37 | 38 | export PALLETE 39 | -------------------------------------------------------------------------------- /src/plugin/battery.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 3 | 4 | # shellcheck source=src/utils.sh 5 | . "$ROOT_DIR/../utils.sh" 6 | 7 | # Battery querying code from https://github.com/tmux-plugins/tmux-battery 8 | # 9 | # Copyright (C) 2014 Bruno Sutic 10 | # 11 | # Permission is hereby granted, free of charge, to any person obtaining a copy of this software 12 | # and associated documentation files (the "Software"), to deal in the Software without restriction, 13 | # including without limitation the rights to use, copy, modify, merge, publish, distribute, 14 | # sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is 15 | # furnished to do so, subject to the following conditions: 16 | # 17 | # The above copyright notice and this permission notice shall be included in all copies or 18 | # substantial portions of the Software. 19 | # 20 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT 21 | # NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 23 | # DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 25 | 26 | s_osx() { 27 | [ "$(uname)" == "Darwin" ] 28 | } 29 | 30 | is_chrome() { 31 | chrome="/sys/class/chromeos/cros_ec" 32 | if [ -d "$chrome" ]; then 33 | return 0 34 | else 35 | return 1 36 | fi 37 | } 38 | 39 | is_wsl() { 40 | if [ ! -f /proc/version ]; then 41 | return 1 42 | fi 43 | 44 | version=$(/dev/null 2>&1 55 | } 56 | 57 | battery_status() { 58 | if is_wsl; then 59 | local battery 60 | battery=$(find /sys/class/power_supply/*/status | tail -n1) 61 | awk '{print tolower($0);}' "$battery" 62 | elif command_exists "pmset"; then 63 | pmset -g batt | awk -F '; *' 'NR==2 { print $2 }' 64 | elif command_exists "acpi"; then 65 | acpi -b | awk '{gsub(/,/, ""); print tolower($3); exit}' 66 | elif command_exists "upower"; then 67 | local battery 68 | battery=$(upower -e | grep -E 'battery|DisplayDevice'| tail -n1) 69 | upower -i "$battery" | awk '/state/ {print $2}' 70 | elif command_exists "termux-battery-status"; then 71 | termux-battery-status | jq -r '.status' | awk '{printf("%s%", tolower($1))}' 72 | elif command_exists "apm"; then 73 | local battery 74 | battery=$(apm -a) 75 | if [ "$battery" -eq 0 ]; then 76 | echo "discharging" 77 | elif [ "$battery" -eq 1 ]; then 78 | echo "charging" 79 | fi 80 | fi 81 | } 82 | 83 | print_battery_percentage() { 84 | # percentage displayed in the 2nd field of the 2nd row 85 | if is_wsl; then 86 | local battery 87 | battery=$(find /sys/class/power_supply/*/capacity | tail -n1) 88 | cat "$battery" 89 | elif command_exists "pmset"; then 90 | pmset -g batt | grep -o "[0-9]\{1,3\}%" 91 | elif command_exists "acpi"; then 92 | acpi -b | grep -m 1 -Eo "[0-9]+%" 93 | elif command_exists "upower"; then 94 | # use DisplayDevice if available otherwise battery 95 | local battery 96 | battery=$(upower -e | grep -E 'battery|DisplayDevice'| tail -n1) 97 | if [ -z "$battery" ]; then 98 | return 99 | fi 100 | local percentage 101 | percentage=$(upower -i "$battery" | awk '/percentage:/ {print $2}') 102 | if [ "$percentage" ]; then 103 | echo "${percentage%.*%}" 104 | return 105 | fi 106 | local energy 107 | local energy_full 108 | energy=$(upower -i "$battery" | awk -v nrg="$energy" '/energy:/ {print nrg+$2}') 109 | energy_full=$(upower -i "$battery" | awk -v nrgfull="$energy_full" '/energy-full:/ {print nrgfull+$2}') 110 | if [ -n "$energy" ] && [ -n "$energy_full" ]; then 111 | echo "$energy" "$energy_full" | awk '{printf("%d%%", ($1/$2)*100)}' 112 | fi 113 | elif command_exists "termux-battery-status"; then 114 | termux-battery-status | jq -r '.percentage' | awk '{printf("%d%%", $1)}' 115 | elif command_exists "apm"; then 116 | apm -l 117 | fi 118 | } 119 | ################################################## 120 | 121 | 122 | # When run with no args, return place holders to create a template that we'll replace with real 123 | # values when run by tmux 124 | if [ $# -eq 0 ]; then 125 | plugin_battery_icon="_ICON_" 126 | plugin_battery_accent_color="_ACCENT_COLOR_" 127 | plugin_battery_accent_color_icon="_ACCENT_COLOR_ICON_" 128 | export plugin_battery_icon plugin_battery_accent_color plugin_battery_accent_color_icon 129 | echo "_BATTERY_" 130 | else 131 | 132 | # We have the template, replace the placeholders with real values now 133 | 134 | battery_percentage=$(print_battery_percentage) 135 | charging_status=$(battery_status) 136 | 137 | if [ "$charging_status" == "charging" ] || [ "$charging_status" == "charged" ]; then 138 | plugin_battery_icon=$(get_tmux_option "@theme_plugin_battery_charging_icon" " ") 139 | else 140 | plugin_battery_icon=$(get_tmux_option "@theme_plugin_battery_discharging_icon" "󰁹") 141 | fi 142 | 143 | battery_number="${battery_percentage//%/}" 144 | 145 | # load palette 146 | theme_variation=$(get_tmux_option "@theme_variation" "night") 147 | # shellcheck source=src/palletes/night.sh 148 | . "$ROOT_DIR/../palletes/$theme_variation.sh" 149 | 150 | if [ "$battery_number" -lt "$(get_tmux_option '@theme_plugin_battery_red_threshold' '10')" ]; then 151 | plugin_battery_accent_color=$(get_tmux_option "@theme_plugin_battery_red_accent_color" "red") 152 | plugin_battery_accent_color_icon=$(get_tmux_option "@theme_plugin_battery_red_accent_color_icon" "magenta2") 153 | elif [ "$battery_number" -lt "$(get_tmux_option '@theme_plugin_battery_yellow_threshold' '30')" ]; then 154 | plugin_battery_accent_color=$(get_tmux_option "@theme_plugin_battery_yellow_accent_color" "yellow") 155 | plugin_battery_accent_color_icon=$(get_tmux_option "@theme_plugin_battery_yellow_accent_color_icon" "orange") 156 | else 157 | plugin_battery_accent_color=$(get_tmux_option "@theme_plugin_battery_green_accent_color" "blue7") 158 | plugin_battery_accent_color_icon=$(get_tmux_option "@theme_plugin_battery_green_accent_color_icon" "blue0") 159 | fi 160 | 161 | template=$1 162 | result="${template//_ACCENT_COLOR_ICON_/${PALLETE[$plugin_battery_accent_color_icon]}}" 163 | result="${result//_ACCENT_COLOR_/${PALLETE[$plugin_battery_accent_color]}}" 164 | result="${result//_ICON_/$plugin_battery_icon}" 165 | result="${result//_BATTERY_/$battery_percentage}" 166 | 167 | echo "$result" 168 | fi 169 | -------------------------------------------------------------------------------- /src/plugin/datetime.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 3 | 4 | # shellcheck source=src/utils.sh 5 | . "$ROOT_DIR/../utils.sh" 6 | 7 | # shellcheck disable=SC2005 8 | plugin_datetime_icon=$(get_tmux_option "@theme_plugin_datetime_icon" " ") 9 | plugin_datetime_accent_color=$(get_tmux_option "@theme_plugin_datetime_accent_color" "blue7") 10 | plugin_datetime_accent_color_icon=$(get_tmux_option "@theme_plugin_datetime_accent_color_icon" "blue0") 11 | 12 | # https://man7.org/linux/man-pages/man1/date.1.html 13 | plugin_datetime_format=$(get_tmux_option "@theme_plugin_datetime_format" "%D %H:%M:%S") 14 | 15 | function load_plugin() { 16 | echo "${plugin_datetime_format}" 17 | } 18 | load_plugin 19 | 20 | export plugin_datetime_icon plugin_datetime_accent_color plugin_datetime_accent_color_icon 21 | -------------------------------------------------------------------------------- /src/plugin/homebrew.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 3 | 4 | # shellcheck source=src/utils.sh 5 | . "$ROOT_DIR/../utils.sh" 6 | 7 | # shellcheck disable=SC2005 8 | plugin_homebrew_icon=$(get_tmux_option "@theme_plugin_homebrew_icon" " ") 9 | plugin_homebrew_accent_color=$(get_tmux_option "@theme_plugin_homebrew_accent_color" "blue7") 10 | plugin_homebrew_accent_color_icon=$(get_tmux_option "@theme_plugin_homebrew_accent_color_icon" "blue0") 11 | 12 | plugin_homebrew_additional_options=$(get_tmux_option "@theme_plugin_homebrew_additional_options" "--greedy") 13 | 14 | export plugin_homebrew_icon plugin_homebrew_accent_color plugin_homebrew_accent_color_icon 15 | 16 | function load_plugin() { 17 | if ! command -v brew &>/dev/null; then 18 | exit 1 19 | fi 20 | 21 | outdated_packages=$(brew outdated "${plugin_homebrew_additional_options}" || true) 22 | outdated_packages_count=$(echo "${outdated_packages}" | wc -l | xargs) 23 | if [[ "${outdated_packages_count}" -gt 1 ]]; then 24 | echo "$outdated_packages_count outdated packages" 25 | else 26 | echo "All updated" 27 | fi 28 | } 29 | 30 | load_plugin 31 | -------------------------------------------------------------------------------- /src/plugin/playerctl.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 3 | 4 | # shellcheck source=src/utils.sh 5 | . "$ROOT_DIR/../utils.sh" 6 | 7 | # 8 | # shellcheck disable=SC2005 9 | plugin_playerctl_icon=$(get_tmux_option "@theme_plugin_playerctl_icon" "󰝚 ") 10 | plugin_playerctl_accent_color=$(get_tmux_option "@theme_plugin_playerctl_accent_color" "blue7") 11 | plugin_playerctl_accent_color_icon=$(get_tmux_option "@theme_plugin_playerctl_accent_color_icon" "blue0") 12 | 13 | plugin_playerctl_format_string=$(get_tmux_option "@theme_plugin_playerctl_format_string" "{{artist}} - {{title}}") 14 | 15 | export plugin_playerctl_icon plugin_playerctl_accent_color plugin_playerctl_accent_color_icon 16 | 17 | function load_plugin() { 18 | if ! command -v playerctl &>/dev/null; then 19 | exit 1 20 | fi 21 | 22 | if [[ $(playerctl status) == "Playing" ]]; then 23 | playerctl=$(playerctl metadata --format "$plugin_playerctl_format_string") 24 | echo "${playerctl}" 25 | else 26 | echo "Not Playing" 27 | fi 28 | } 29 | 30 | load_plugin 31 | -------------------------------------------------------------------------------- /src/plugin/spt.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 3 | 4 | # shellcheck source=src/utils.sh 5 | . "$ROOT_DIR/../utils.sh" 6 | 7 | # 8 | # shellcheck disable=SC2005 9 | plugin_spt_icon=$(get_tmux_option "@theme_plugin_spt_icon" "󰝚 ") 10 | plugin_spt_accent_color=$(get_tmux_option "@theme_plugin_spt_accent_color" "blue7") 11 | plugin_spt_accent_color_icon=$(get_tmux_option "@theme_plugin_spt_accent_color_icon" "blue0") 12 | 13 | plugin_spt_format_string=$(get_tmux_option "@theme_plugin_spt_format_string" "%a - %t") 14 | 15 | export plugin_spt_icon plugin_spt_accent_color plugin_spt_accent_color_icon 16 | 17 | function load_plugin() { 18 | if ! command -v spt &>/dev/null; then 19 | exit 1 20 | fi 21 | 22 | if spt playback --status >/dev/null; then 23 | spt=$(spt playback --format "$plugin_spt_format_string") 24 | echo "${spt}" 25 | else 26 | echo "Not Playing" 27 | fi 28 | } 29 | 30 | load_plugin 31 | -------------------------------------------------------------------------------- /src/plugin/weather.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 3 | 4 | # shellcheck source=src/utils.sh 5 | . "$ROOT_DIR/../utils.sh" 6 | 7 | # shellcheck disable=SC2005 8 | plugin_weather_icon=$(get_tmux_option "@theme_plugin_weather_icon" " ") 9 | plugin_weather_accent_color=$(get_tmux_option "@theme_plugin_weather_accent_color" "blue7") 10 | plugin_weather_accent_color_icon=$(get_tmux_option "@theme_plugin_weather_accent_color_icon" "blue0") 11 | plugin_weather_location=$(get_tmux_option "@theme_plugin_weather_location" "") 12 | 13 | export plugin_weather_icon plugin_weather_accent_color plugin_weather_accent_color_icon 14 | 15 | plugin_weather_format_string=$(get_tmux_option "@theme_plugin_weather_format" "%t+H:%h") 16 | 17 | function load_plugin() { 18 | if ! command -v jq &>/dev/null; then 19 | exit 1 20 | fi 21 | 22 | if [[ -n "$plugin_weather_location" ]]; then 23 | LOCATION="$plugin_weather_location" 24 | else 25 | LOCATION=$(curl -s http://ip-api.com/json | jq -r '"\(.city), \(.country)"' 2>/dev/null) 26 | fi 27 | 28 | WEATHER=$(curl -sL wttr.in/"${LOCATION// /%20}"\?format="${plugin_weather_format_string}" 2>/dev/null) 29 | 30 | echo "${WEATHER}" 31 | } 32 | 33 | load_plugin 34 | -------------------------------------------------------------------------------- /src/plugin/yay.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 3 | 4 | # shellcheck source=src/utils.sh 5 | . "$ROOT_DIR/../utils.sh" 6 | 7 | # shellcheck disable=SC2005 8 | plugin_yay_icon=$(get_tmux_option "@theme_plugin_yay_icon" " ") 9 | plugin_yay_accent_color=$(get_tmux_option "@theme_plugin_yay_accent_color" "blue7") 10 | plugin_yay_accent_color_icon=$(get_tmux_option "@theme_plugin_yay_accent_color_icon" "blue0") 11 | 12 | export plugin_yay_icon plugin_yay_accent_color plugin_yay_accent_color_icon 13 | 14 | function load_plugin() { 15 | if ! command -v yay &>/dev/null; then 16 | exit 1 17 | fi 18 | 19 | outdated_packages=$(yay -Qu || true) 20 | outdated_packages_count=$(echo "${outdated_packages}" | wc -l | xargs) 21 | if [[ "${outdated_packages_count}" -gt 1 ]]; then 22 | echo "$outdated_packages_count outdated packages" 23 | else 24 | echo "All updated" 25 | fi 26 | } 27 | 28 | load_plugin 29 | -------------------------------------------------------------------------------- /src/theme.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -euxo pipefail 3 | 4 | export LC_ALL=en_US.UTF-8 5 | 6 | CURRENT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 7 | # shellcheck source=src/utils.sh 8 | . "$CURRENT_DIR/utils.sh" 9 | 10 | theme_variation=$(get_tmux_option "@theme_variation" "night") 11 | theme_disable_plugins=$(get_tmux_option "@theme_disable_plugins" 0) 12 | 13 | # shellcheck source=src/palletes/night.sh 14 | . "$CURRENT_DIR/palletes/$theme_variation.sh" 15 | 16 | ### Load Options 17 | border_style_active_pane=$(get_tmux_option "@theme_active_pane_border_style" "${PALLETE['dark5']}") 18 | border_style_inactive_pane=$(get_tmux_option "@theme_inactive_pane_border_style" "${PALLETE[bg_highlight]}") 19 | right_separator=$(get_tmux_option "@theme_right_separator" "") 20 | transparent=$(get_tmux_option "@theme_transparent_status_bar" "false") 21 | 22 | if [ "$transparent" = "true" ]; then 23 | right_separator_inverse=$(get_tmux_option "@theme_transparent_right_separator_inverse" "") 24 | fi 25 | 26 | window_with_activity_style=$(get_tmux_option "@theme_window_with_activity_style" "italics") 27 | window_status_bell_style=$(get_tmux_option "@theme_status_bell_style" "bold") 28 | 29 | IFS=',' read -r -a plugins <<<"$(get_tmux_option "@theme_plugins" "datetime,weather")" 30 | 31 | tmux set-option -g status-left-length 100 32 | tmux set-option -g status-right-length 100 33 | 34 | tmux set-window-option -g window-status-activity-style "$window_with_activity_style" 35 | tmux set-window-option -g window-status-bell-style "${window_status_bell_style}" 36 | 37 | # message styling 38 | tmux set-option -g message-style "bg=${PALLETE[red]},fg=${PALLETE[bg_dark]}" 39 | 40 | # status bar 41 | status_bar_bg=${PALLETE[bg_highlight]} 42 | if [ "$transparent" = "true" ]; then 43 | status_bar_bg="default" 44 | fi 45 | tmux set-option -g status-style "bg=${status_bar_bg},fg=${PALLETE[white]}" 46 | 47 | # border color 48 | tmux set-option -g pane-active-border-style "fg=$border_style_active_pane" 49 | tmux set-option -g pane-border-style "#{?pane_synchronized,fg=$border_style_active_pane,fg=$border_style_inactive_pane}" 50 | 51 | ### Left side 52 | tmux set-option -g status-left "$(generate_left_side_string)" 53 | 54 | ### Windows list 55 | tmux set-window-option -g window-status-format "$(generate_inactive_window_string)" 56 | tmux set-window-option -g window-status-current-format "$(generate_active_window_string)" 57 | 58 | ### Right side 59 | tmux set-option -g status-right "" 60 | 61 | # Check if plugins array is empty before proceeding 62 | if [ "$theme_disable_plugins" -ne 1 ]; then 63 | last_plugin="${plugins[-1]}" 64 | is_last_plugin=0 65 | 66 | for plugin in "${plugins[@]}"; do 67 | 68 | if [ ! -f "${CURRENT_DIR}/plugin/${plugin}.sh" ]; then 69 | tmux set-option -ga status-right "${plugin}" 70 | else 71 | if [ "$plugin" == "$last_plugin" ]; then 72 | is_last_plugin=1 73 | fi 74 | 75 | plugin_script_path="${CURRENT_DIR}/plugin/${plugin}.sh" 76 | plugin_execution_string="$(${plugin_script_path})" 77 | # shellcheck source=src/plugin/datetime.sh 78 | . "$plugin_script_path" 79 | 80 | icon_var="plugin_${plugin}_icon" 81 | accent_color_var="plugin_${plugin}_accent_color" 82 | accent_color_icon_var="plugin_${plugin}_accent_color_icon" 83 | 84 | plugin_icon="${!icon_var}" 85 | accent_color="${!accent_color_var}" 86 | accent_color_icon="${!accent_color_icon_var}" 87 | 88 | # For every plugin except battery, turn accent_color and accent_color_icon into 89 | # the colors from the palette. The battery plugin uses placeholders so it can 90 | # change the color based on battery level 91 | if [ "$plugin" != "battery" ]; then 92 | accent_color="${PALLETE[$accent_color]}" 93 | accent_color_icon="${PALLETE[$accent_color_icon]}" 94 | fi 95 | 96 | separator_end="#[fg=${PALLETE[bg_highlight]},bg=${accent_color}]${right_separator}#[none]" 97 | separator_icon_start="#[fg=${accent_color_icon},bg=${PALLETE[bg_highlight]}]${right_separator}#[none]" 98 | separator_icon_end="#[fg=${accent_color},bg=${accent_color_icon}]${right_separator}#[none]" 99 | if [ "$transparent" = "true" ]; then 100 | separator_icon_start="#[fg=${accent_color_icon},bg=default]${right_separator}#[none]" 101 | separator_icon_end="#[fg=${accent_color},bg=${accent_color_icon}]${right_separator}#[none]" 102 | separator_end="#[fg=${accent_color},bg=default]${right_separator_inverse}#[none]" 103 | else 104 | separator_icon_start="#[fg=${accent_color_icon},bg=${PALLETE[bg_highlight]}]${right_separator}#[none]" 105 | separator_icon_end="#[fg=${accent_color},bg=${accent_color_icon}]${right_separator}#[none]" 106 | separator_end="#[fg=${PALLETE[bg_highlight]},bg=${accent_color}]${right_separator}#[none]" 107 | fi 108 | 109 | plugin_output_string="" 110 | 111 | # For datetime and battery, we run the plugin to get the content 112 | # For battery, the content is actually a template that will be replaced when 113 | # running the script later 114 | if [ "$plugin" == "datetime" ] || [ "$plugin" == "battery" ]; then 115 | plugin_output="#[fg=${PALLETE[white]},bg=${accent_color}]${plugin_execution_string}#[none]" 116 | else 117 | plugin_output="#[fg=${PALLETE[white]},bg=${accent_color}]#($plugin_script_path)#[none]" 118 | fi 119 | 120 | plugin_icon_output="${separator_icon_start}#[fg=${PALLETE[white]},bg=${accent_color_icon}]${plugin_icon}${separator_icon_end}" 121 | 122 | if [ ! $is_last_plugin -eq 1 ] && [ "${#plugins[@]}" -gt 1 ]; then 123 | plugin_output_string="${plugin_icon_output}${plugin_output} ${separator_end}" 124 | else 125 | plugin_output_string="${plugin_icon_output}${plugin_output} " 126 | fi 127 | 128 | # For the battery plugin, we pass $plugin_output_string as an argument to the script so 129 | # we can dynamically change the icon and accent colors 130 | if [ "$plugin" == "battery" ]; then 131 | plugin_output_string="#($plugin_script_path \"$plugin_output_string\")" 132 | fi 133 | 134 | tmux set-option -ga status-right "$plugin_output_string" 135 | fi 136 | done 137 | fi 138 | 139 | tmux set-window-option -g window-status-separator '' 140 | -------------------------------------------------------------------------------- /src/utils.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | function get_tmux_option() { 4 | local option=$1 5 | local default_value=$2 6 | local -r option_value=$(tmux show-option -gqv "$option") 7 | 8 | if [ -z "$option_value" ]; then 9 | echo "$default_value" 10 | else 11 | echo "$option_value" 12 | fi 13 | } 14 | 15 | function generate_left_side_string() { 16 | 17 | session_icon=$(get_tmux_option "@theme_session_icon" " ") 18 | left_separator=$(get_tmux_option "@theme_left_separator" "") 19 | transparent=$(get_tmux_option "@theme_transparent_status_bar" "false") 20 | 21 | if [ "$transparent" = "true" ]; then 22 | local separator_end="#[bg=default]#{?client_prefix,#[fg=${PALLETE[yellow]}],#[fg=${PALLETE[green]}]}${left_separator:?}#[none]" 23 | else 24 | local separator_end="#[bg=${PALLETE[bg_highlight]}]#{?client_prefix,#[fg=${PALLETE[yellow]}],#[fg=${PALLETE[green]}]}${left_separator:?}#[none]" 25 | fi 26 | 27 | echo "#[fg=${PALLETE[fg_gutter]},bold]#{?client_prefix,#[bg=${PALLETE[yellow]}],#[bg=${PALLETE[green]}]} ${session_icon} #S ${separator_end}" 28 | } 29 | 30 | function generate_inactive_window_string() { 31 | 32 | inactive_window_icon=$(get_tmux_option "@theme_plugin_inactive_window_icon" " ") 33 | zoomed_window_icon=$(get_tmux_option "@theme_plugin_zoomed_window_icon" " ") 34 | left_separator=$(get_tmux_option "@theme_left_separator" "") 35 | transparent=$(get_tmux_option "@theme_transparent_status_bar" "false") 36 | inactive_window_title=$(get_tmux_option "@theme_inactive_window_title" "#W ") 37 | 38 | if [ "$transparent" = "true" ]; then 39 | left_separator_inverse=$(get_tmux_option "@theme_transparent_left_separator_inverse" "") 40 | 41 | local separator_start="#[bg=default,fg=${PALLETE['dark5']}]${left_separator_inverse}#[bg=${PALLETE['dark5']},fg=${PALLETE['bg_highlight']}]" 42 | local separator_internal="#[bg=${PALLETE['dark3']},fg=${PALLETE['dark5']}]${left_separator:?}#[none]" 43 | local separator_end="#[bg=default,fg=${PALLETE['dark3']}]${left_separator:?}#[none]" 44 | else 45 | local separator_start="#[bg=${PALLETE['dark5']},fg=${PALLETE['bg_highlight']}]${left_separator:?}#[none]" 46 | local separator_internal="#[bg=${PALLETE['dark3']},fg=${PALLETE['dark5']}]${left_separator:?}#[none]" 47 | local separator_end="#[bg=${PALLETE[bg_highlight]},fg=${PALLETE['dark3']}]${left_separator:?}#[none]" 48 | fi 49 | 50 | echo "${separator_start}#[fg=${PALLETE[white]}]#I${separator_internal}#[fg=${PALLETE[white]}] #{?window_zoomed_flag,$zoomed_window_icon,$inactive_window_icon}${inactive_window_title}${separator_end}" 51 | } 52 | 53 | function generate_active_window_string() { 54 | 55 | active_window_icon=$(get_tmux_option "@theme_plugin_active_window_icon" " ") 56 | zoomed_window_icon=$(get_tmux_option "@theme_plugin_zoomed_window_icon" " ") 57 | pane_synchronized_icon=$(get_tmux_option "@theme_plugin_pane_synchronized_icon" "✵") 58 | left_separator=$(get_tmux_option "@theme_left_separator" "") 59 | transparent=$(get_tmux_option "@theme_transparent_status_bar" "false") 60 | active_window_title=$(get_tmux_option "@theme_active_window_title" "#W ") 61 | 62 | if [ "$transparent" = "true" ]; then 63 | left_separator_inverse=$(get_tmux_option "@theme_transparent_left_separator_inverse" "") 64 | 65 | separator_start="#[bg=default,fg=${PALLETE['magenta']}]${left_separator_inverse}#[bg=${PALLETE['magenta']},fg=${PALLETE['bg_highlight']}]" 66 | separator_internal="#[bg=${PALLETE['purple']},fg=${PALLETE['magenta']}]${left_separator:?}#[none]" 67 | separator_end="#[bg=default,fg=${PALLETE['purple']}]${left_separator:?}#[none]" 68 | else 69 | separator_start="#[bg=${PALLETE['magenta']},fg=${PALLETE['bg_highlight']}]${left_separator:?}#[none]" 70 | separator_internal="#[bg=${PALLETE['purple']},fg=${PALLETE['magenta']}]${left_separator:?}#[none]" 71 | separator_end="#[bg=${PALLETE[bg_highlight]},fg=${PALLETE['purple']}]${left_separator:?}#[none]" 72 | fi 73 | 74 | echo "${separator_start}#[fg=${PALLETE[white]}]#I${separator_internal}#[fg=${PALLETE[white]}] #{?window_zoomed_flag,$zoomed_window_icon,$active_window_icon}${active_window_title}#{?pane_synchronized,$pane_synchronized_icon,}${separator_end}#[none]" 75 | } 76 | -------------------------------------------------------------------------------- /tmux-tokyo-night.tmux: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | CURRENT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 4 | 5 | "${CURRENT_DIR}/src/theme.sh" 6 | --------------------------------------------------------------------------------