adriankarlen / bar.wezterm

A wezterm tab bar with batteries included

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

🍺 bar.wezterm

A tab bar configuration for wezterm, this configuration is heavily inspired by rose-pine/tmux

📷

image

🌷 Rosé Pine

image

😸 Catppuccin Mocha

image  

🚀 Installation

This is a wezterm plugin. It can be installed by importing the repo and calling the apply_to_config-function. It is important that the apply_to_config-function is called after color_scheme has been set.

local bar = wezterm.plugin.require("https://github.com/adriankarlen/bar.wezterm")
bar.apply_to_config(config)

NOTE: This assumes that you have imported the wezterm module and initialized the config-object.

 

🛠️ Configuration

The apply_to_config-function takes a second param opts. To override any options simply pass a table of the desired changes.

bar.apply_to_config(
  config,
  {
    enabled_modules = {
      username = false,
      clock = false
    }
  }
)

🏭 Default configuration

NOTE: The default config requires that you are using a Nerd Font or has "Symbols Nerd Font" installed on your system so wezterm can default to it.

{
  position = "bottom",
  max_width = 32,
  left_separator = "",
  right_separator = "",
  field_separator = "  |  ",
  leader_icon = "",
  workspace_icon = "",
  pane_icon = "",
  user_icon = "",
  hostname_icon = "󰒋",
  clock_icon = "󰃰",
  cwd_icon = "",
  enabled_modules = {
    username = true,
    hostname = true,
    clock = true,
    cwd = true,
  },
  ansi_colors = {
    workspace = 8,
    leader = 2,
    pane = 7,
    active_tab = 4,
    inactive_tab = 6,
    username = 6,
    hostname = 8,
    clock = 5,
    cwd = 7,
  },
}

🎨 Colors

Every ansi color used is configurable, to change a color, pass in the desired ansi code to use for a specific setting.

If you want to change any other color used, since the plugin uses your themes colors you can configure the theme to get a different result. For instance, if I want to change the active tab background color I can do so like this:

return {
  -- ... your existing config
  colors = {
    tab_bar = {
      active_tab = {
        bg_color = "#26233a"
      }
    }
  }
}

🖌️ Color table

Color option Default
tab_bar.background transparent
tab_bar.active_tab.bg_color transparent
tab_bar.inactive_tab.bg_color transparent

📜 License

This project is licensed under the MIT License - see the LICENSE file

About

A wezterm tab bar with batteries included

License:MIT License


Languages

Language:Lua 100.0%