Skip to content

Commit

Permalink
Merge pull request #31 from fabioluciano/docs
Browse files Browse the repository at this point in the history
doc: improving readme
  • Loading branch information
fabioluciano authored Jun 4, 2024
2 parents a6415e3 + c698679 commit 524326a
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 17 deletions.
33 changes: 22 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@

## Features

## Plugins

- **Datetime** - Show datetime;
- **Weather** - Show weather;
- **Playerctl** - Show playerctl;
- **Spt** - Show Spotify;
- **Homebrew** - Show Homebrew;
- **yay** - Show yay;

## Screenshots

### Tokyo Night - Default Variation
Expand All @@ -37,17 +46,18 @@ Hit <kbd>prefix</kbd> + <kbd>I</kbd> to fetch the plugin and source it. You can

## 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` | | | |
| `@theme_window_with_activity_style` | | | |
| `@theme_status_bell_style` | | | |
| `@theme_plugins` | | `datetime`, `weather`, `playerctl` | `datetime,weather` |
| `@theme_disable_plugins` | Disables plugins | 1, 0 | 0 |
| 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` | | | `#737aa2` |
| `@theme_inactive_pane_border_style` | | | `#292e42` |
| `@theme_left_separator` | | | `` |
| `@theme_right_separator` | | | `` |
| `@theme_window_with_activity_style` | | | `italics` |
| `@theme_status_bell_style` | | | `bold` |
| `@theme_plugins` | | `datetime`, `weather`, `playerctl`, `spt`, `homebrew`, `yay` | `datetime,weather` |
| `@theme_disable_plugins` | Disables plugins | `1`, `0` | `0` |

## Plugins

Expand Down Expand Up @@ -101,6 +111,7 @@ set -g @plugin 'fabioluciano/tmux-tokyo-night'
set -g @theme_variation 'moon'
set -g @theme_left_separator ''
set -g @theme_right_separator ''
set -g @theme_plugins 'datetime,weather,playerctl,yay'
run '~/.tmux/plugins/tpm/tpm'
```
Expand Down
12 changes: 6 additions & 6 deletions src/theme.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ 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)
theme_enable_icons=$(get_tmux_option "@theme_enable_icons" 1)
theme_disable_plugins=$(get_tmux_option "@theme_disable_plugins" 0)

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

### Load Options
border_style_active_pane=$(get_tmux_option "@theme_active_pane_border_style" "fg=${PALLETE['dark5']}")
border_style_inactive_pane=$(get_tmux_option "@theme_inactive_pane_border_style" "fg=${PALLETE[bg_highlight]}")
border_style_active_pane=$(get_tmux_option "@theme_active_pane_border_style" "${PALLETE['dark5']}")
border_style_inactive_pane=$(get_tmux_option "@theme_inactive_pane_border_style" "${PALLETE[bg_highlight]}")
left_separator=$(get_tmux_option "@theme_left_separator" "")
right_separator=$(get_tmux_option "@theme_right_separator" "")

Expand All @@ -38,8 +38,8 @@ tmux set-option -g message-style "bg=${PALLETE[red]},fg=${PALLETE[bg_dark]}"
tmux set-option -g status-style "bg=${PALLETE[bg_highlight]},fg=${PALLETE[white]}"

# border color
tmux set-option -g pane-active-border-style "$border_style_active_pane"
tmux set-option -g pane-border-style "$border_style_inactive_pane"
tmux set-option -g pane-active-border-style "fg=$border_style_active_pane"
tmux set-option -g pane-border-style "fg=$border_style_inactive_pane"

### Left side
tmux set-option -g status-left "$(generate_left_side_string)"
Expand Down Expand Up @@ -93,7 +93,7 @@ if [ "$theme_disable_plugins" -ne 1 ]; then
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 ] && [ "${#plugins[@]}" -gt 1 ]; then
plugin_output_string="${plugin_icon_output}${plugin_output}${separator_end}"
plugin_output_string="${plugin_icon_output}${plugin_output} ${separator_end}"
else
plugin_output_string="${plugin_icon_output}${plugin_output} "
fi
Expand Down

0 comments on commit 524326a

Please sign in to comment.