repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

wezterm/bugabinga/nugu/init.lua

Raw
local nugu_dark = require 'bugabinga/nugu/palette_dark'
local nugu_light = require 'bugabinga/nugu/palette_light'

local make_theme = function ( palette )
  return {
    -- The default text color
    foreground = palette.content.normal,
    -- The default background color
    background = palette.content.backdrop,
    -- Overrides the cell background color when the current cell is occupied by the
    -- cursor and the cursor style is set to Block
    cursor_bg = palette.ui.accent,
    -- Overrides the text color when the current cell is occupied by the cursor
    cursor_fg = palette.ui.backdrop,
    -- Specifies the border color of the cursor when the cursor style is set to Block,
    -- or the color of the vertical or horizontal bar when the cursor style is set to
    -- Bar or Underline.
    cursor_border = palette.ui.accent,
    selection_fg = palette.ui.backdrop,
    selection_bg = palette.ui.focus,
    -- The color of the scrollbar 'thumb'; the portion that represents the current viewport
    scrollbar_thumb = palette.ui.unfocus,
    -- The color of the split lines between panes
    split = palette.ui.unfocus,
    ansi = {
      palette.content.normal,          -- Index 0: BLACK (Should be dark)
      palette.error,                 -- Index 1: RED
      palette.content.focus,           -- Index 2: GREEN
      palette.content.focus,           -- Index 3: YELLOW/OLIVE
      palette.content.important_local, -- Index 4: BLUE
      palette.content.focus,           -- Index 5: PURPLE
      palette.content.accent,          -- Index 6: CYAN
      palette.content.unfocus,         -- Index 7: WHITE (Should be light-ish)
    },
    brights = {
      palette.content.minor,           -- Index 8: BRIGHT BLACK (Grey)
      palette.error,                 -- Index 9: BRIGHT RED
      palette.content.focus,           -- Index 10: BRIGHT GREEN
      palette.content.unfocus,         -- Index 11: BRIGHT YELLOW
      palette.content.important_global,-- Index 12: BRIGHT BLUE
      palette.content.focus,           -- Index 13: BRIGHT PURPLE
      palette.content.accent,          -- Index 14: BRIGHT CYAN
      palette.content.backdrop,        -- Index 15: BRIGHT WHITE (Should be very light)
    },
    -- Arbitrary colors of the palette in the range from 16 to 255
    indexed = {},
    -- When the IME, a dead key or a leader key are being processed and are effectively
    -- holding input pending the result of input composition, change the cursor
    -- to this color to give a visual cue about the compose state.
    compose_cursor = palette.ui.focus,
    -- Colors for copy_mode and quick_select
    -- available since: 20220807-113146-c2fee766
    -- In copy_mode, the color of the active text is:
    -- 1. copy_mode_active_highlight_* if additional text was selected using the mouse
    -- 2. selection_* otherwise
    copy_mode_active_highlight_bg = { Color = palette.ui.accent, },
    copy_mode_active_highlight_fg = { Color = palette.ui.backdrop, },
    copy_mode_inactive_highlight_bg = { Color = palette.ui.unfocus, },
    copy_mode_inactive_highlight_fg = { Color = palette.ui.normal, },
    quick_select_label_bg = { Color = palette.ui.minor, },
    quick_select_label_fg = { Color = palette.ui.normal, },
    quick_select_match_bg = { Color = palette.ui.unfocus, },
    quick_select_match_fg = { Color = palette.ui.normal, },
    -- Command Palette / Input Selector
    -- input_selector_label_bg = { Color = palette.ui.backdrop },
    -- input_selector_label_fg = { Color = palette.ui.normal },
    -- Launcher
    -- launcher_label_bg = { Color = palette.ui.backdrop },
    -- launcher_label_fg = { Color = palette.ui.normal },
    tab_bar = {
      -- The color of the strip that goes along the top of the window
      -- (does not apply when fancy tab bar is in use)
      background = palette.content.backdrop,

      -- The active tab is the one that has focus in the window
      active_tab = {
        -- The color of the background area for the tab
        bg_color = palette.ui.focus,
        -- The color of the text for the tab
        fg_color = palette.ui.backdrop,

        -- Specify whether you want "Half", "Normal" or "Bold" intensity for the
        -- label shown for this tab.
        -- The default is "Normal"
        intensity = 'Bold',

        -- Specify whether you want "None", "Single" or "Double" underline for
        -- label shown for this tab.
        -- The default is "None"
        underline = 'None',

        -- Specify whether you want the text to be italic (true) or not (false)
        -- for this tab.  The default is false.
        italic = false,

        -- Specify whether you want the text to be rendered with strikethrough (true)
        -- or not for this tab.  The default is false.
        strikethrough = false,
      },

      -- Inactive tabs are the tabs that do not have focus
      inactive_tab = {
        bg_color = palette.ui.backdrop,
        fg_color = palette.ui.unfocus,

        -- The same options that were listed under the `active_tab` section above
        -- can also be used for `inactive_tab`.
      },

      -- You can configure some alternate styling when the mouse pointer
      -- moves over inactive tabs
      inactive_tab_hover = {
        bg_color = palette.ui.accent,
        fg_color = palette.ui.normal,
        intensity = 'Bold',

        -- The same options that were listed under the `active_tab` section above
        -- can also be used for `inactive_tab_hover`.
      },

      -- The new tab button that let you create new tabs
      new_tab = {
        bg_color = palette.ui.backdrop,
        fg_color = palette.ui.unfocus,

        -- The same options that were listed under the `active_tab` section above
        -- can also be used for `new_tab`.
      },

      -- You can configure some alternate styling when the mouse pointer
      -- moves over the new tab button
      new_tab_hover = {
        bg_color = palette.ui.accent,
        fg_color = palette.ui.normal,

        -- The same options that were listed under the `active_tab` section above
        -- can also be used for `new_tab_hover`.
      },
    },
  }
end

local apply_window_frame = function ( cfg, scheme_name )
  local palette = (scheme_name == 'nugu-dark') and nugu_dark.palette or nugu_light.palette
  cfg.window_frame = {
    active_titlebar_bg = palette.ui.backdrop,
    inactive_titlebar_bg = palette.ui.backdrop,
    active_titlebar_fg = palette.ui.normal,
    inactive_titlebar_fg = palette.ui.unfocus,
    button_fg = palette.ui.normal,
    button_bg = palette.ui.backdrop,
    button_hover_fg = palette.ui.accent,
    button_hover_bg = palette.ui.minor,
  }
end

return {
  schemes = {
    ['nugu-dark'] = make_theme( nugu_dark.palette ),
    ['nugu-light'] = make_theme( nugu_light.palette ),
  },
  apply_window_frame = apply_window_frame,
}