dotfiles/tycho/wezterm/wezterm.lua

59 lines
2.1 KiB
Lua
Raw Permalink Normal View History

2024-10-24 22:06:14 +00:00
-- Import the wezterm module
local wezterm = require 'wezterm'
-- Creates a config object which we will be adding our config to
local config = wezterm.config_builder()
-- Find them here: https://wezfurlong.org/wezterm/colorschemes/index.html
-- config.color_scheme = 'Ayu Dark (Gogh)'
config.color_scheme = 'GruvboxDarkHard'
-- Choose your favourite font, make sure it's installed on your machine
config.font = wezterm.font({ family = 'Iosevka Medium' })
-- And a font size that won't have you squinting
config.font_size = 12
-- Slightly transparent and blurred background
config.window_background_opacity = 0.9
config.macos_window_background_blur = 30
-- Removes the title bar, leaving only the tab bar. Keeps
-- the ability to resize by dragging the window's edges.
-- On macOS, 'RESIZE|INTEGRATED_BUTTONS' also looks nice if
-- you want to keep the window controls visible and integrate
-- them into the tab bar.
config.window_decorations = 'RESIZE|INTEGRATED_BUTTONS'
-- Sets the font for the window frame (tab bar)
config.window_frame = {
-- Berkeley Mono for me again, though an idea could be to try a
-- serif font here instead of monospace for a nicer look?
font = wezterm.font({ family = 'Iosevka Medium', weight = 'Bold' }),
font_size = 12,
}
wezterm.on('update-status', function(window)
-- Grab the utf8 character for the "powerline" left facing
-- solid arrow.
local SOLID_LEFT_ARROW = utf8.char(0xe0b2)
-- Grab the current window's configuration, and from it the
-- palette (this is the combination of your chosen colour scheme
-- including any overrides).
local color_scheme = window:effective_config().resolved_palette
local bg = color_scheme.background
local fg = color_scheme.foreground
window:set_right_status(wezterm.format({
-- First, we draw the arrow...
{ Background = { Color = 'none' } },
{ Foreground = { Color = bg } },
{ Text = SOLID_LEFT_ARROW },
-- Then we draw our text
{ Background = { Color = bg } },
{ Foreground = { Color = fg } },
{ Text = ' ' .. wezterm.hostname() .. ' ' },
}))
end)
-- Returns our config to be evaluated. We must always do this at the bottom of this file
return config