repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

wezterm: small fix for win32

c3422676805c51601d57e99a729187da5e551171

Oliver Krylow <o.krylow@isp-insoft.de> ·

unsigned

Browse filesCompare with HEAD

Changed files (7)

+74 / −75 text lines

Diff layout

git/gitconfig

Modified

+3 / −2 text lines

5050[mergetool "nvim_merge"]
5151 cmd = "nvim -d \"$LOCAL\" \"$MERGED\" \"$REMOTE\" "
53[push]
54 autoSetupRemote = true
5356[pull]
5457 rebase = false
8083# On each host a different file might be symlinked into '.gitconfig.include'.
8184[include]
8285 path = .gitconfig.include
83[push]
84 autoSetupRemote = true

neovim/lua/bugabinga/plugins/zen.lua

Modified

+1 / −0 text lines

33 cmd = 'ZenMode',
44 dependencies = { { 'folke/twilight.nvim', opts = { dimming = { inactive = true } } } },
55 opts = {
6 --FIXME: this does not work, because on win32 there is no base64 binary
67 plugins = { wezterm = { enabled = true, font = "+4" } },
78 window = {
89 width = 0.69,

wezterm/bugabinga/auto_dark_mode.lua

Added
new file mode 100644

+30 / −0 text lines

1local wez = require 'wezterm'
2
3-- wezterm.gui is not available to the mux server, so take care to
4-- do something reasonable when this config is evaluated by the mux
5local get_appearance = function()
6 if wez.gui then
7 return wez.gui.get_appearance()
8 end
9 return 'Dark'
10end
12local scheme_for_appearance = function(appearance)
13 if appearance:find 'Dark' then
14 return 'nugu-dark'
15 else
16 return 'nugu-light'
17 end
18end
20wez.on('window-config-reloaded', function(window)
21 local overrides = window:get_config_overrides() or {}
22 local appearance = window:get_appearance()
23 local scheme = scheme_for_appearance(appearance)
24 if overrides.color_scheme ~= scheme then
25 overrides.color_scheme = scheme
26 window:set_config_overrides(overrides)
27 end
28end)
30return scheme_for_appearance(get_appearance())

wezterm/bugabinga/dark_mode.lua

Deleted
deleted file mode 100644

+0 / −30 text lines

1local wez = require 'wezterm'
2
3-- wezterm.gui is not available to the mux server, so take care to
4-- do something reasonable when this config is evaluated by the mux
5local get_appearance = function()
6 if wez.gui then
7 return wez.gui.get_appearance()
8 end
9 return 'Dark'
10end
12local scheme_for_appearance = function(appearance)
13 if appearance:find 'Dark' then
14 return 'nugu-dark'
15 else
16 return 'nugu-light'
17 end
18end
20wez.on('window-config-reloaded', function(window)
21 local overrides = window:get_config_overrides() or {}
22 local appearance = window:get_appearance()
23 local scheme = scheme_for_appearance(appearance)
24 if overrides.color_scheme ~= scheme then
25 overrides.color_scheme = scheme
26 window:set_config_overrides(overrides)
27 end
28end)
30return scheme_for_appearance(get_appearance())

wezterm/bugabinga/key_binds.lua

Modified

+3 / −10 text lines

3333 { key = 'k', action = wez.action.ActivatePaneDirection 'Up' },
3434 { key = 'l', action = wez.action.ActivatePaneDirection 'Right' },
36 { key = 'v', action = wez.action.SplitHorizontal { domain = 'CurrentPaneDomain' }, },
37 { key = 's', action = wez.action.SplitVertical { domain = 'CurrentPaneDomain' }, },
3639 { key = 'r', action = wez.action.ActivateKeyTable { name = resize_pane_mode, one_shot = false } },
3841 { key = 'q', action = wez.action.CloseCurrentPane { confirm = true } },
119122 mods = 'CTRL|SHIFT',
120123 action = wez.action.PasteFrom 'Clipboard',
121124 },
122 {
123 key = 'v',
124 mods = 'LEADER',
125 action = wez.action.SplitHorizontal { domain = 'CurrentPaneDomain' },
126 },
127 {
128 key = 's',
129 mods = 'LEADER',
130 action = wez.action.SplitVertical { domain = 'CurrentPaneDomain' },
131 },
132125 {
133126 key = 't',
134127 mods = 'LEADER',

wezterm/bugabinga/neovim_zen_mode.lua

Modified

+23 / −22 text lines

1local wez = require'wezterm'
2
3wez.on('user-var-changed', function(window, pane, name, value)
4 local overrides = window:get_config_overrides() or {}
5 if name == "ZEN_MODE" then
6 local incremental = value:find("+")
7 local number_value = tonumber(value)
8 if incremental ~= nil then
9 while (number_value > 0) do
10 window:perform_action(wez.action.IncreaseFontSize, pane)
11 number_value = number_value - 1
1return function( wez )
2 wez.on('user-var-changed', function(window, pane, name, value)
3 print "zen"
4 local overrides = window:get_config_overrides() or {}
5 if name == "ZEN_MODE" then
6 local incremental = value:find("+")
7 local number_value = tonumber(value)
8 if incremental ~= nil then
9 while (number_value > 0) do
10 window:perform_action(wez.action.IncreaseFontSize, pane)
11 number_value = number_value - 1
12 end
13 overrides.enable_tab_bar = false
14 elseif number_value < 0 then
15 window:perform_action(wez.action.ResetFontSize, pane)
16 overrides.font_size = nil
17 overrides.enable_tab_bar = true
18 else
19 overrides.font_size = number_value
20 overrides.enable_tab_bar = false
1221 end
13 overrides.enable_tab_bar = false
14 elseif number_value < 0 then
15 window:perform_action(wez.action.ResetFontSize, pane)
16 overrides.font_size = nil
17 overrides.enable_tab_bar = true
18 else
19 overrides.font_size = number_value
20 overrides.enable_tab_bar = false
2122 end
22 end
23 window:set_config_overrides(overrides)
24end)
23 window:set_config_overrides(overrides)
24 end)
25end

wezterm/wezterm.lua

Modified

+14 / −11 text lines

22local nugu = require 'bugabinga.nugu'
44local key_binds = require 'bugabinga.key_binds'
5local dark_mode = require 'bugabinga.dark_mode'
5local auto_dark_mode = require 'bugabinga.auto_dark_mode'
66-- local workspaces = require 'bugabinga.workspaces'
77require 'bugabinga.status'
8require 'bugabinga.neovim_zen_mode'
8local zen_mode = require 'bugabinga.neovim_zen_mode'
9zen_mode(wez)
1011local hostname = wez.hostname()
1112local enable_wayland = false
1617if hostname == 'x230' then
1718 font_size = 13
1819 enable_wayland = true
19elseif hostname == 'pop-os' then
20 font_size = 15
2120elseif hostname == 'NB-00718' then
22 font_size = 15
21 font_size = 19
2322end
2524return {
2625 -- logs key presses
2726 -- debug_key_events = true,
28 default_cwd = wez.home_dir,
29 default_prog = { 'nu', '--login' },
30 default_cursor_style = 'SteadyBlock',
2932 font = font,
3033 font_size = font_size,
3134 freetype_load_target = 'Light',
3235 freetype_render_target = 'HorizontalLcd',
3336 underline_position = "-2pt",
3437 warn_about_missing_glyphs = false,
35 color_scheme = dark_mode,
39 color_scheme = auto_dark_mode,
3640 color_schemes = nugu,
37 default_cwd = wez.home_dir,
38 default_prog = { 'nu' },
39 default_cursor_style = 'SteadyBlock',
4041 cursor_blink_rate = 0,
42 -- https://github.com/wez/wezterm/issues/2635
43 force_reverse_video_cursor = true,
4144 -- cursor_thickness = '1cell',
4245 window_decorations = window_decorations,
46 enable_wayland = enable_wayland,
4347 enable_tab_bar = true,
4448 -- if this is hidden, we cannot see the right status area
4549 hide_tab_bar_if_only_one_tab = false,
4650 use_fancy_tab_bar = false,
4751 check_for_updates = false,
4852 show_update_window = false,
49 win32_system_backdrop = "Mica",
5053 audible_bell = 'Disabled',
5154 visual_bell = {
5255 fade_in_duration_ms = 69,
5861 brightness = 0.69,
5962 },
6063 tab_max_width = 42,
61 enable_wayland = enable_wayland,
6264 window_padding = {
6365 left = 2,
6466 right = 2,
6567 top = 2,
6668 bottom = 0,
6769 },
6871 disable_default_key_bindings = true,
6972 leader = key_binds.leader,
7073 keys = key_binds.keys,