Skip to content

Commit

Permalink
fix: some fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
fabioluciano committed Jun 2, 2023
1 parent e3b58ba commit cc3013c
Show file tree
Hide file tree
Showing 5 changed files with 91 additions and 19 deletions.
47 changes: 32 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,46 @@
<h1 align="center">
Tokyo Night Tmux Theme
</h1>

<h4 align="center">A Tokyo Night tmux theme directly inspired from Tokyo Night vim theme</h4>
<hr>
<p align="center">
• <a href="#features">Features</a> •
<a href="#screenshots">Screenshots</a> •
<a href="#install">Install</a> •
<a href="#available-configurations">Available Configurations</a> •
<a href="#plugins">Plugins</a> •
</p>
<hr>
<div align="center">
<h1>Tokyo Night Tmux Theme</h1>

<h4>A Tokyo Night tmux theme directly inspired from Tokyo Night vim theme</h4>

---

**[<kbd> <br> Features <br> </kbd>][features]**
**[<kbd> <br> Screenshots <br> </kbd>][screenshots]**
**[<kbd> <br> Install <br> </kbd>][install]**
**[<kbd> <br> Available Configurations <br> </kbd>][available-configurations]**
**[<kbd> <br> Plugins <br> </kbd>][plugins]**

---

</div>

## Features

## Screenshots

### Tokyo Night - Default Variation

| Inactive | Active |
|-------------- | -------------- |
|![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")|

## Install
## Install

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

```
set -g @plugin 'fabioluciano/tmux-tokyo-night'
```

Hit <kbd>prefix</kbd> + <kbd>I</kbd> to fetch the plugin and source it. You can now use the plugin.

## Available Configurations

| Configuration | Description | Avaliable Options | Default |
|---------------- | --------------- | --------------- | --------------- |
| `@theme_variation`| The tokyo night theme variation to be use | `night`, `storm`, `moon` | `night` |
| `@theme_enable_icons`| Switch icons in window list and plugins | `1`, `0` | `1` |
| `@theme_active_pane_border_style`| | | |
| `@theme_left_separator`| | | |
| `@theme_right_separator` | | | |
Expand All @@ -40,6 +49,7 @@ Hit <kbd>prefix</kbd> + <kbd>I</kbd> to fetch the plugin and source it. You can
| `@theme-plugins` | | | |

## Plugins

### Datetime

| Configuration | Description | Avaliable Options | Default |
Expand All @@ -52,6 +62,7 @@ Hit <kbd>prefix</kbd> + <kbd>I</kbd> to fetch the plugin and source it. You can
### Example configuration

tmux.conf

```
set -g @plugin 'tmux-plugins/tpm'
Expand All @@ -68,3 +79,9 @@ set -g @theme_right_separator ''
run '~/.tmux/plugins/tpm/tpm'
```

[features]:#features
[screenshots]:#screenshots
[install]:#install
[available-configurations]:#available-configurations
[plugins]:#plugins
38 changes: 38 additions & 0 deletions src/palletes/day.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/usr/bin/env bash

#Tokyo Night Day Pallet
declare -A PALLETE=(
[none]="NONE"
[bg]="#1a1b26"
[bg_dark]="#16161e"
[bg_highlight]="#292e42"
[terminal_black]="#414868"
[fg]="#c0caf5"
[fg_dark]="#a9b1d6"
[fg_gutter]="#3b4261"
[dark3]="#545c7e"
[comment]="#565f89"
[dark5]="#737aa2"
[blue0]="#3d59a1"
[blue]="#7aa2f7"
[cyan]="#7dcfff"
[blue1]="#2ac3de"
[blue2]="#0db9d7"
[blue5]="#89ddff"
[blue6]="#b4f9f8"
[blue7]="#394b70"
[magenta]="#bb9af7"
[magenta2]="#ff007c"
[purple]="#9d7cd8"
[orange]="#ff9e64"
[yellow]="#e0af68"
[green]="#9ece6a"
[green1]="#73daca"
[green2]="#41a6b5"
[teal]="#1abc9c"
[red]="#f7768e"
[red1]="#db4b4b"
[white]="#ffffff"
)

export PALLETE
6 changes: 3 additions & 3 deletions src/plugin/datetime.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#!/usr/bin/env bash
#
# shellcheck disable=SC2005

plugin_datetime_icon=$(get_tmux_option "@theme_plugin_datetime_icon" "")
plugin_datetime_accent_color=$(get_tmux_option "@theme_plugin_datetime_accent_color" "blue7")
plugin_datetime_accent_color_icon=$(get_tmux_option "@theme_plugin_datetime_accent_color_icon" "blue0")

# https://man7.org/linux/man-pages/man1/date.1.html
plugin_datetime_format=$(get_tmux_option "@theme_plugin_datetime_format" "%F")
plugin_datetime_format=$(get_tmux_option "@theme_plugin_datetime_format" "%c")

function load_plugin() {
echo "$(date +"${plugin_datetime_format}")"
echo "${plugin_datetime_format}"
}

export plugin_datetime_icon plugin_datetime_accent_color plugin_datetime_accent_color_icon
15 changes: 15 additions & 0 deletions src/plugin/weather.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash
#
# shellcheck disable=SC2005
plugin_weather_icon=$(get_tmux_option "@theme_plugin_weather_icon" "")
plugin_weather_accent_color=$(get_tmux_option "@theme_plugin_weather_accent_color" "blue7")
plugin_weather_accent_color_icon=$(get_tmux_option "@theme_plugin_weather_accent_color_icon" "blue0")

# https://man7.org/linux/man-pages/man1/date.1.html
plugin_weather_format=$(get_tmux_option "@theme_plugin_weather_format" "%c")

function load_plugin() {
echo "${plugin_weather_format}"
}

export plugin_weather_icon plugin_weather_accent_color plugin_weather_accent_color_icon
4 changes: 3 additions & 1 deletion src/theme.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
. "$CURRENT_DIR/utils.sh"

theme_variation=$(get_tmux_option "@theme_variation" "night")
theme_enable_icons=$(get_tmux_option "@theme_variation" 1)

# shellcheck source=src/palletes/night.sh
. "$CURRENT_DIR/palletes/$theme_variation.sh"

Expand Down Expand Up @@ -81,7 +83,7 @@ for plugin in "${plugins[@]}"; do

plugin_icon_output="${separator_icon_start}#[fg=${PALLETE[white]},bg=${PALLETE[$accent_color_icon]}]${plugin_icon}${separator_icon_end}"

if [ ! $is_last_plugin -eq 1 ];then
if [ ! $is_last_plugin -eq 1 ] || [ "${#plugins[@]}" -gt 1 ];then
plugin_output_string="${plugin_icon_output}${plugin_output}${separator_end}"
else
plugin_output_string="${plugin_icon_output}${plugin_output}"
Expand Down

0 comments on commit cc3013c

Please sign in to comment.