Skip to content

Commit

Permalink
Merge pull request #14 from 2KAbhishek/more-themes
Browse files Browse the repository at this point in the history
Add more themes
  • Loading branch information
2KAbhishek authored Apr 3, 2024
2 parents 54f87ee + 05d62b0 commit 85a7cca
Show file tree
Hide file tree
Showing 16 changed files with 141 additions and 98 deletions.
189 changes: 98 additions & 91 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,76 +36,103 @@ tmux2k is a highly customizable framework designed to enhance your tmux status b

### 🎨 Available Themes:

- default (`set @tmux2k-theme 'default'`)
![default](./images/default.png)
- default icons only (`set @tmux2k-icons-only true`)
![default-icons](./images/default-icons.png)
- default no powerline (`set @tmux2k-show-powerline false`)
![default-no-powerline](./images/default-no-powerline.png)
- catppuccin
![catppuccin](./images/catppuccin.png)
![catppuccin-icons](./images/catppuccin-icons.png)
- gruvbox
![gruvbox](./images/gruvbox.png)
![gruvbox-icons](./images/gruvbox-icons.png)
- onedark
![onedark](./images/onedark.png)
![onedark-icons](./images/onedark-icons.png)
- default ![default](./images/default.png)
- default icons ![default-icons](./images/default-icons.png)
- catppuccin ![catppuccin](./images/catppuccin.png)
- catppuccin icons ![catppuccin-icons](./images/catppuccin-icons.png)
- gruvbox ![gruvbox](./images/gruvbox.png)
- gruvbox icons ![gruvbox-icons](./images/gruvbox-icons.png)
- monokai ![monokai](./images/monokai.png)
- monokai icons ![monokai-icons](./images/monokai-icons.png)
- onedark ![onedark](./images/onedark.png)
- onedark icons ![onedark-icons](./images/onedark-icons.png)
- duo ![duo](./images/duo.png)
- duo icons ![duo-icons](./images/duo-icons.png)
- duo blue ![duo-blue](./images/duo-blue.png)
- default no powerline ![default-no-powerline](./images/default-no-powerline.png)

To use themes:

### 🧩 Available Plugins

- `battery`: Show battery stats and percentage
- `git`: Show Git branch and status information
- `cpu`: Show CPU usage information
- `gpu`: Show GPU usage information
- `ram`: Show RAM usage information
- `network`: Show network status and statistics
- `bandwidth`: Show network bandwidth usage
- `ping`: Show network ping statistics
- `time`: Show current time and date
- `weather`: Show weather information
- `wimdow`: tmux window list
```bash
# use a theme
set -g @tmux2k-theme 'onedark'

### 🪆 Add New Plugins
# to show icons only
set -g @tmux2k-icons-only true

To add a new plugin, add a script to the [scripts](./scripts) folder that prints something to the console.
# to customize duo bg and fg
set -g @tmux2k-duo-fg "#1688f0" # this will get you duo blue shown above
set -g @tmux2k-duo-bg "#000000" # this will set the bg for duo theme

> The plugin name and script file name must match e.g: plugin named `foo` should have a file called `scripts/foo.sh`
# to set powerline symbols
set -g @tmux2k-right-sep  # alternate right status bar sep
set -g @tmux2k-win-right-sep  # alternate window right sep

## ⚡ Setup
# to not show powerline
set -g @tmux2k-show-powerline false

### ⚙️ Requirements
# set start icon, accpets: `session`, 'window`, or any string
set -g @tmux2k-start-icon ""
```

Before you begin, ensure you have met the following requirements:
#### 🖌️ Customize Theme Colors

- You have installed the latest version of `tmux`.
- bash 5.2 or newer, mac users can install it using `brew install bash`
- [tpm](https://github.com/tmux-plugins/tpm) for managing `tmux` plugins.
- A [patched nerd font](https://www.nerdfonts.com/) for `powerline` and glyphs support.
##### Available Colors:

### 💻 Installation
- `text`: Default text color. Default: `#282a36`
- `bg_main`: Background color for main sections. Default: `#15152a`
- `bg_alt`: Background color for alternate sections. Default: `#45455a`
- `black`: Black color. Default: `#0a0a0f`
- `white`: White color. Default: `#d5d5da`
- `red`: Red color. Default: `#ff001f`
- `light_red`: Light red color. Default: `#ff0055`
- `green`: Green color. Default: `#3dd50a`
- `light_green`: Light green color. Default: `#ccffcc`
- `blue`: Blue color. Default: `#1688f0`
- `light_blue`: Light blue color. Default: `#11dddd`
- `yellow`: Yellow color. Default: `#ffb86c`
- `light_yellow`: Light yellow color. Default: `#ffd21a`
- `purple`: Purple color. Default: `#bf58ff`
- `light_purple`: Light purple color. Default: `#ff65c6`

If you are a `tpm` user, you can install the theme and keep up to date by adding the following to your `.tmux.conf` file:
To customize theme colors:

```bash
set -g @plugin '2kabhishek/tmux2k'

set -g @tmux2k-text '#cdcdcd' # change text to white
set -g @tmux2k-bg-main '#ffffff' # change bg to white
set -g @tmux2k-yellow '#f8c800' # change yellow color
```

- Run `tmux`
- Use the `tpm` install command: prefix + I (default prefix is `ctrl+b`)
> You may have to restart `tmux` for some changes to reflect
You can also directly clone the repo to your `~/.tmux/plugins/` folder.
### 🧩 Available Plugins

## 🚀 Usage
- `battery`: Show battery stats and percentage
- `git`: Show Git branch and status information
- `cpu`: Show CPU usage information
- `gpu`: Show GPU usage information
- `ram`: Show RAM usage information
- `network`: Show network status and statistics
- `bandwidth`: Show network bandwidth usage
- `ping`: Show network ping statistics
- `time`: Show current time and date
- `weather`: Show weather information
- `wimdow`: tmux window list

tmux2k to should automatically start after installation. Here's how you can customize it's features
To use plugins:

```bash
# Left and right status bar plugins
# set the left and right plugin sections
set -g @tmux2k-left-plugins "git cpu ram"
set -g @tmux2k-right-plugins "battery network time"

# to customize plugin colors
set -g @tmux2k-[plugin-name]-colors "[background] [foreground]"
set -g @tmux2k-cpu-colors "red black" # set cpu plugin bg to red, fg to black

# to enable compact window list size
set -g @tmux2k-compact-windows true

# change refresh rate
set -g @tmux2k-refresh-rate 5

Expand All @@ -115,70 +142,50 @@ set -g @tmux2k-show-fahrenheit false
# 24 hour time
set -g @tmux2k-military-time true

# it can accept `session`, 'window`, or any string
set -g @tmux2k-start-icon ""

# network interface to watch
set -g @tmux2k-network-name "wlo1"
```

# update powerline symbols
set -g @tmux2k-right-sep  # alternate right status bar sep
set -g @tmux2k-win-right-sep  # alternate window right sep
#### 🪆 Add New Plugins

# to disable powerline
set -g @tmux2k-show-powerline false
To add a new plugin, add a script to the [scripts](./scripts) folder that prints something to the console.

# to customize theme
set -g @tmux2k-theme 'onedark'
> The plugin name and script file name must match e.g: plugin named `foo` should have a file called `scripts/foo.sh`
# to show icons only
set -g @tmux2k-icons-only true
## ⚡ Setup

# to enable compact window tab size
set -g @tmux2k-compact-windows true
### ⚙️ Requirements

# to customize colors
set -g @tmux2k-text '#cdcdcd' # change text to white
set -g @tmux2k-bg-main '#ffffff' # change bg to white
set -g @tmux2k-yellow '#f8c800' # change yellow color
Before you begin, ensure you have met the following requirements:

# to customize plugin colors
set -g @tmux2k-[plugin-name]-colors "[background] [foreground]"
set -g @tmux2k-cpu-colors "blue dark_gray"
```
- You have installed the latest version of `tmux`.
- bash 5.2 or newer, mac users can install it using `brew install bash`
- [tpm](https://github.com/tmux-plugins/tpm) for managing `tmux` plugins.
- A [patched nerd font](https://www.nerdfonts.com/) for `powerline` and glyphs support.

> You may have to restart `tmux` for some changes to reflect
### 💻 Installation

### 🖌️ Customize Colors
If you are a `tpm` user, you can install the theme and keep up to date by adding the following to your `.tmux.conf` file:

#### Available Colors:
```bash
set -g @plugin '2kabhishek/tmux2k'

- `text`: Default text color. Default: `#282a36`
- `bg_main`: Background color for main sections. Default: `#15152a`
- `bg_alt`: Background color for alternate sections. Default: `#45455a`
- `black`: Black color. Default: `#0a0a0f`
- `white`: White color. Default: `#d5d5da`
- `red`: Red color. Default: `#ff001f`
- `light_red`: Light red color. Default: `#ff0055`
- `green`: Green color. Default: `#3dd50a`
- `light_green`: Light green color. Default: `#ccffcc`
- `blue`: Blue color. Default: `#1688f0`
- `light_blue`: Light blue color. Default: `#11dddd`
- `yellow`: Yellow color. Default: `#ffb86c`
- `light_yellow`: Light yellow color. Default: `#ffd21a`
- `purple`: Purple color. Default: `#bf58ff`
- `light_purple`: Light purple color. Default: `#ff65c6`
```

- Run `tmux`
- Use the `tpm` install command: prefix + I (default prefix is `ctrl+b`)

You can also directly clone the repo to your `~/.tmux/plugins/` folder.

## 🏗️ What's Next

- [ ] [Windows compatibility #8](https://github.com/2KAbhishek/tmux2k/issues/8)
- [ ] [Theming support #9](https://github.com/2KAbhishek/tmux2k/issues/9)
- You tell me!

## 🧑‍💻 Behind The Code

### 🌈 Inspiration

I came across [dracula/tmux](https://github.com/dracula/tmux) sometime back but it didn't have everything I wanted.
I came across [dracula/tmux](https://github.com/dracula/tmux) sometime back and I wanted to create a more customizable and easy to expand solution.

### 💡 Challenges/Learnings

Expand Down
Binary file modified images/catppuccin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/catpuccin-icons.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/default-icons.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/default-no-powerline.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/default.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/duo-blue.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/duo-icons.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/duo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/gruvbox-icons.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/gruvbox.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/monokai-icons.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/monokai.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/onedark-icons.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/onedark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
50 changes: 43 additions & 7 deletions scripts/tmux2k.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ icons_only=$(get_tmux_option "@tmux2k-icons-only" false)
compact=$(get_tmux_option "@tmux2k-compact-windows" false)

text=$(get_tmux_option "@tmux2k-text" '#282a36')
bg_main=$(get_tmux_option "@tmux2k-bg-main" '#15152a')
bg_alt=$(get_tmux_option "@tmux2k-bg-alt" '#45455a')
bg_main=$(get_tmux_option "@tmux2k-bg-main" '#000000')
bg_alt=$(get_tmux_option "@tmux2k-bg-alt" '#1f1f1f')
black=$(get_tmux_option "@tmux2k-black" '#0a0a0f')
white=$(get_tmux_option "@tmux2k-white" '#d5d5da')
red=$(get_tmux_option "@tmux2k-red" '#ff001f')
Expand Down Expand Up @@ -75,9 +75,28 @@ set_theme() {
light_blue=$(get_tmux_option "@tmux2k-light-blue" '#91d7e3')
yellow=$(get_tmux_option "@tmux2k-yellow" '#f5a97f')
light_yellow=$(get_tmux_option "@tmux2k-light-yellow" '#eed49f')
purple=$(get_tmux_option "@tmux2k-purple" '#c6a0f6')
purple=$(get_tmux_option "@tmux2k-purple" '#b6a0fe')
light_purple=$(get_tmux_option "@tmux2k-light-purple" '#f5bde6')
;;
"duo")
duo_bg=$(get_tmux_option "@tmux2k-duo-bg" '#000000')
duo_fg=$(get_tmux_option "@tmux2k-duo-fg" '#ffffff')
text=$(get_tmux_option "@tmux2k-white" "$duo_bg")
bg_main=$(get_tmux_option "@tmux2k-bg-main" "$duo_bg")
bg_alt=$(get_tmux_option "@tmux2k-bg-alt" "$duo_bg")
black=$(get_tmux_option "@tmux2k-black" "$duo_bg")
white=$(get_tmux_option "@tmux2k-white" "$duo_fg")
red=$(get_tmux_option "@tmux2k-red" "$duo_fg")
light_red=$(get_tmux_option "@tmux2k-light-red" "$duo_fg")
green=$(get_tmux_option "@tmux2k-green" "$duo_fg")
light_green=$(get_tmux_option "@tmux2k-light-green" "$duo_fg")
blue=$(get_tmux_option "@tmux2k-blue" "$duo_fg")
light_blue=$(get_tmux_option "@tmux2k-light-blue" "$duo_fg")
yellow=$(get_tmux_option "@tmux2k-yellow" "$duo_fg")
light_yellow=$(get_tmux_option "@tmux2k-light-yellow" "$duo_fg")
purple=$(get_tmux_option "@tmux2k-purple" "$duo_fg")
light_purple=$(get_tmux_option "@tmux2k-light-purple" "$duo_fg")
;;
"gruvbox")
bg_main=$(get_tmux_option "@tmux2k-bg-main" '#282828')
bg_alt=$(get_tmux_option "@tmux2k-bg-alt" '#3c3836')
Expand All @@ -91,8 +110,24 @@ set_theme() {
light_blue=$(get_tmux_option "@tmux2k-light-blue" '#83a598')
yellow=$(get_tmux_option "@tmux2k-yellow" '#d79921')
light_yellow=$(get_tmux_option "@tmux2k-light-yellow" '#fabd2f')
purple=$(get_tmux_option "@tmux2k-purple" '#b16286')
light_purple=$(get_tmux_option "@tmux2k-light-purple" '#d3869b')
purple=$(get_tmux_option "@tmux2k-purple" '#b162d6')
light_purple=$(get_tmux_option "@tmux2k-light-purple" '#f386cb')
;;
"monokai")
bg_main=$(get_tmux_option "@tmux2k-bg-main" '#272822')
bg_alt=$(get_tmux_option "@tmux2k-bg-alt" '#3e3d32')
black=$(get_tmux_option "@tmux2k-black" '#272822')
white=$(get_tmux_option "@tmux2k-white" '#f8f8f2')
red=$(get_tmux_option "@tmux2k-red" '#f92672')
light_red=$(get_tmux_option "@tmux2k-light-red" '#ff6188')
green=$(get_tmux_option "@tmux2k-green" '#a6e22e')
light_green=$(get_tmux_option "@tmux2k-light-green" '#a6e22e')
blue=$(get_tmux_option "@tmux2k-blue" '#66d9ef')
light_blue=$(get_tmux_option "@tmux2k-light-blue" '#66d9ef')
yellow=$(get_tmux_option "@tmux2k-yellow" '#e6db74')
light_yellow=$(get_tmux_option "@tmux2k-light-yellow" '#e6db74')
purple=$(get_tmux_option "@tmux2k-purple" '#ae81ff')
light_purple=$(get_tmux_option "@tmux2k-light-purple" '#fe81ff')
;;
"onedark")
bg_main=$(get_tmux_option "@tmux2k-bg-main" '#282c34')
Expand All @@ -107,12 +142,13 @@ set_theme() {
light_blue=$(get_tmux_option "@tmux2k-light-blue" '#61afef')
yellow=$(get_tmux_option "@tmux2k-yellow" '#e5c07b')
light_yellow=$(get_tmux_option "@tmux2k-light-yellow" '#e5c07b')
purple=$(get_tmux_option "@tmux2k-purple" '#c678dd')
light_purple=$(get_tmux_option "@tmux2k-light-purple" '#c678dd')
purple=$(get_tmux_option "@tmux2k-purple" '#c678fd')
light_purple=$(get_tmux_option "@tmux2k-light-purple" '#f678cd')
;;
esac

if $icons_only; then
show_powerline=false
text=$bg_main
plugin_colors=(
["git"]="text green"
Expand Down

0 comments on commit 85a7cca

Please sign in to comment.