Skip to content

Commit 555427d

Browse files
committed
Add wezterm config
1 parent 6354493 commit 555427d

5 files changed

Lines changed: 94 additions & 0 deletions

File tree

config/lsyncd/wsl.lua

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
local xdg_config_home = os.getenv('XDG_CONFIG_HOME') or '/home/hexin/.config'
2+
local user_profile = os.getenv('USERPROFILE') or '/mnt/c/Users/Hexin'
23
local appdata = os.getenv('APPDATA') or '/mnt/c/Users/Hexin/AppData/Roaming'
34

45
local transitions = {
56
{
67
source = ('%s/alacritty/'):format(xdg_config_home),
78
target = ('%s/alacritty/'):format(appdata),
89
},
10+
{
11+
source = ('%s/wezterm/'):format(xdg_config_home),
12+
target = ('%s/.config/wezterm/'):format(user_profile),
13+
},
914
}
1015

1116
for _, transition in ipairs(transitions) do

config/wezterm/appearance.lua

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
local wezterm = require('wezterm')
2+
3+
local M = {}
4+
5+
function M.apply(config)
6+
config.initial_rows = 46
7+
config.initial_cols = 160
8+
9+
config.color_scheme = 'Tomorrow Night Eighties'
10+
11+
config.font = wezterm.font('HackGen Console NF')
12+
config.font_size = 11
13+
14+
config.enable_tab_bar = false
15+
16+
config.animation_fps = 1
17+
config.cursor_blink_ease_in = 'Constant'
18+
config.cursor_blink_ease_out = 'Constant'
19+
20+
config.ui_key_cap_rendering = 'WindowsSymbols'
21+
22+
config.window_decorations = 'RESIZE'
23+
config.window_padding = {
24+
left = 0,
25+
right = 0,
26+
top = 0,
27+
bottom = 0,
28+
}
29+
30+
wezterm.on('gui-startup', function (cmd)
31+
local _, _, window = wezterm.mux.spawn_window(cmd or {})
32+
33+
local gui_window = window:gui_window()
34+
gui_window:set_position(0, 0)
35+
end)
36+
end
37+
38+
return M

config/wezterm/keys.lua

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
local wezterm = require('wezterm')
2+
3+
local M = {}
4+
5+
function M.apply(config)
6+
config.keys = {
7+
{
8+
key = 'k',
9+
mods = 'CTRL | SHIFT',
10+
action = wezterm.action.ShowDebugOverlay,
11+
},
12+
{
13+
key = '^',
14+
mods = 'CTRL',
15+
action = wezterm.action.DisableDefaultAssignment,
16+
},
17+
}
18+
config.debug_key_events = true
19+
end
20+
21+
22+
return M

config/wezterm/wezterm.lua

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
local wezterm = require('wezterm')
2+
local appearance = require('appearance')
3+
local keys = require('keys')
4+
5+
local config = wezterm.config_builder()
6+
7+
config.automatically_reload_config = true
8+
9+
config.font = wezterm.font('HackGen Console NF')
10+
config.font_size = 11
11+
config.check_for_updates = true
12+
13+
config.default_prog = {
14+
'C:/Windows/system32/wsl.exe',
15+
'--cd',
16+
'~',
17+
'--distribution',
18+
'arch',
19+
'--exec',
20+
'/bin/zsh',
21+
'-c',
22+
'tmux new -A && exec zsh -i',
23+
}
24+
25+
appearance.apply(config)
26+
keys.apply(config)
27+
28+
return config

install

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ install_dotfiels() {
5757
make_symlink tmux $XDG_CONFIG_HOME/tmux
5858
make_symlink npm $XDG_CONFIG_HOME/npm
5959
make_symlink alacritty $XDG_CONFIG_HOME/alacritty
60+
make_symlink wezterm $XDG_CONFIG_HOME/wezterm
6061
make_symlink lsyncd $XDG_CONFIG_HOME/lsyncd
6162
make_symlink systemd/user $XDG_CONFIG_HOME/systemd/user
6263
}

0 commit comments

Comments
 (0)