Skip to content

Commit

Permalink
feat(extras): add tmux theme
Browse files Browse the repository at this point in the history
  • Loading branch information
mehalter committed Jul 24, 2024
1 parent c03d782 commit 1c8d80d
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
1 change: 1 addition & 0 deletions lua/astrotheme/extras/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ M.extras = {
sublime = { ext = "tmTheme", url = "https://www.sublimetext.com/docs/themes", label = "Sublime Text" },
terminator = { ext = "conf", url = "https://gnome-terminator.readthedocs.io/en/latest/config.html", label = "Terminator" },
tilix = { ext = "json", url = "https://github.com/gnunn1/tilix", label = "Tilix" },
tmux = { ext = "tmux", url = "https://github.com/tmux/tmux/wiki", label = "Tmux" },
vim = { ext = "vim", url = "https://vimhelp.org/", label = "Vim", subdir = "colors"},
vimium = { ext = "css", url = "https://vimium.github.io/", label = "Vimium" },
wezterm = { ext = "toml", url = "https://wezfurlong.org/wezterm/config/files.html", label = "WezTerm" },
Expand Down
52 changes: 52 additions & 0 deletions lua/astrotheme/extras/tmux.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
local util = require "astrotheme.extras"

local M = {}

--- @param colors AstroThemePalette
function M.generate(colors)
return util.template(
[[
#!/usr/bin/env bash
# ${_style_name} colors for Tmux
set -g mode-style "fg=${ui.accent},bg=${ui.selection}"
set -g message-style "fg=${ui.accent},bg=${ui.selection}"
set -g message-command-style "fg=${ui.accent},bg=${ui.selection}"
set -g pane-border-style "fg=${ui.selection}"
set -g pane-active-border-style "fg=${ui.accent}"
set -g status "on"
set -g status-justify "left"
set -g status-style "fg=${ui.accent},bg=${ui.statusline}"
set -g status-left-length "100"
set -g status-right-length "100"
set -g status-left-style ${none}
set -g status-right-style ${none}
set -g status-left "#[fg=${ui.base},bg=${ui.accent},bold] #S #[fg=${ui.accent},bg=${ui.statusline},nobold,nounderscore,noitalics]"
set -g status-right "#[fg=${ui.statusline},bg=${ui.statusline},nobold,nounderscore,noitalics]#[fg=${ui.accent},bg=${ui.statusline}] #{prefix_highlight} #[fg=${ui.selection},bg=${ui.statusline},nobold,nounderscore,noitalics]#[fg=${ui.accent},bg=${ui.selection}] %Y-%m-%d  %I:%M %p #[fg=${ui.accent},bg=${ui.selection},nobold,nounderscore,noitalics]#[fg=${ui.base},bg=${ui.accent},bold] #h "
if-shell '[ "$(tmux show-option -gqv "clock-mode-style")" == "24" ]' {
set -g status-right "#[fg=${ui.statusline},bg=${ui.statusline},nobold,nounderscore,noitalics]#[fg=${ui.accent},bg=${ui.statusline}] #{prefix_highlight} #[fg=${ui.selection},bg=${ui.statusline},nobold,nounderscore,noitalics]#[fg=${ui.accent},bg=${ui.selection}] %Y-%m-%d  %H:%M #[fg=${ui.accent},bg=${ui.selection},nobold,nounderscore,noitalics]#[fg=${ui.base},bg=${ui.accent},bold] #h "
}
setw -g window-status-activity-style "underscore,fg=${ui.text_inactive},bg=${ui.statusline}"
setw -g window-status-separator ""
setw -g window-status-style "${none},fg=${ui.text_inactive},bg=${ui.statusline}"
setw -g window-status-format "#[fg=${ui.statusline},bg=${ui.statusline},nobold,nounderscore,noitalics]#[default] #I  #W #F #[fg=${ui.statusline},bg=${ui.statusline},nobold,nounderscore,noitalics]"
setw -g window-status-current-format "#[fg=${ui.statusline},bg=${ui.selection},nobold,nounderscore,noitalics]#[fg=${ui.accent},bg=${ui.selection},bold] #I  #W #F #[fg=${ui.selection},bg=${ui.statusline},nobold,nounderscore,noitalics]"
# tmux-plugins/tmux-prefix-highlight support
set -g @prefix_highlight_output_prefix "#[fg=${ui.yellow}]#[bg=${ui.statusline}]#[fg=${ui.statusline}]#[bg=${ui.yellow}]"
set -g @prefix_highlight_output_suffix ""
]],
colors
)
end

return M

0 comments on commit 1c8d80d

Please sign in to comment.