-
Notifications
You must be signed in to change notification settings - Fork 1
/
.wezterm.lua
98 lines (93 loc) · 3.03 KB
/
.wezterm.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
local wezterm = require("wezterm")
local config = {}
-- In newer versions of wezterm, use the config_builder which will
-- help provide clearer error messages
if wezterm.config_builder then
config = wezterm.config_builder()
end
config.color_scheme = "Tango (terminal.sexy)"
config.colors = {
foreground = "#ffffff",
background = "#000000",
}
config.cursor_blink_rate = 0
config.font_size = 18.0
config.keys = {
{ key = "c", mods = "ALT", action = wezterm.action({ CopyTo = "Clipboard" }) },
{ key = "v", mods = "ALT", action = wezterm.action({ PasteFrom = "Clipboard" }) },
{ key = "w", mods = "ALT", action = wezterm.action.CloseCurrentTab({ confirm = false }) },
}
if wezterm.target_triple == "x86_64-unknown-linux-gnu" then
config.font = wezterm.font("DejaVuSansM Nerd Font Mono", { weight = "Regular" })
config.window_decorations = "TITLE | RESIZE"
elseif wezterm.target_triple == "x86_64-apple-darwin" then
config.font = wezterm.font("DejaVuSansMono Nerd Font", { weight = "Regular" })
config.window_decorations = "RESIZE"
config.window_background_opacity = 0.999
elseif wezterm.target_triple == "aarch64-apple-darwin" then
config.font = wezterm.font("DejaVuSansMono Nerd Font", { weight = "Regular" })
config.window_decorations = "RESIZE"
end
config.window_close_confirmation = "NeverPrompt"
config.window_frame = {
inactive_titlebar_bg = "#000000",
active_titlebar_bg = "#000000",
inactive_titlebar_fg = "#000000",
active_titlebar_fg = "#000000",
inactive_titlebar_border_bottom = "#000000",
active_titlebar_border_bottom = "#000000",
button_fg = "#000000",
button_bg = "#000000",
button_hover_fg = "#ffffff",
button_hover_bg = "#000000",
border_left_width = "0.0cell",
border_right_width = "0.0cell",
border_bottom_height = "0.0cell",
border_top_height = "0.0cell",
border_left_color = "#000000",
border_right_color = "#000000",
border_bottom_color = "#000000",
border_top_color = "#000000",
}
config.window_padding = {
left = 0,
right = 0,
top = 0,
bottom = 0,
}
config.hide_tab_bar_if_only_one_tab = true
config.hide_mouse_cursor_when_typing = false
config.mouse_bindings = {
{
event = { Up = { streak = 1, button = "Left" } },
mods = "NONE",
action = wezterm.action.Nop,
},
}
-- some hack to fix cursor missing under wayland
local function gsettings(key)
return wezterm.run_child_process({ "gsettings", "get", "org.gnome.desktop.interface", key })
end
local function apply_to_config(conf)
if wezterm.target_triple ~= "x86_64-unknown-linux-gnu" then
-- skip if not running on linux
return
end
local success, stdout, stderr = gsettings("cursor-theme")
if success then
conf.xcursor_theme = stdout:gsub("'(.+)'\n", "%1")
end
local success, stdout, stderr = gsettings("cursor-size")
if success then
conf.xcursor_size = tonumber(stdout)
end
config.enable_wayland = true
if conf.enable_wayland and os.getenv("WAYLAND_DISPLAY") then
local success, stdout, stderr = gsettings("text-scaling-factor")
if success then
conf.font_size = (conf.font_size or 10.0) * tonumber(stdout)
end
end
end
apply_to_config(config)
return config