forked from CoreyMSchafer/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwezterm.lua
executable file
·103 lines (87 loc) · 2.61 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
99
100
101
102
103
-- Pull in the wezterm API
local wezterm = require("wezterm")
-- This will hold the configuration.
local config = wezterm.config_builder()
-- This is where you actually apply your config choices
config.default_domain = "WSL:Ubuntu"
-- config.font = wezterm.font("JetBrainsMono Nerd Font")
config.font = wezterm.font("0xProto Nerd Font Mono", { weight = "Regular" })
-- config.font = wezterm.font("0xProto Nerd Font", { weight = "Regular" })
-- config.font = wezterm.font("ProFont IIx Nerd Font Propo", { weight = "Regular" })
-- config.font = wezterm.font("ProFontWindows Nerd Font Mono", { weight = "Regular" })
-- config.font = wezterm.font("FiraCode Nerd Font")
-- config.font = wezterm.font("MesloLGS NF")
-- config.font = wezterm.font("Source Code Pro for Powerline")
config.font_size = 12
config.enable_tab_bar = false
config.window_decorations = "RESIZE"
config.window_padding = {
left = 0,
right = 0,
top = 0,
bottom = 0,
}
config.color_scheme = "Rasi (terminal.sexy)"
config.enable_kitty_keyboard = true
config.max_fps = 120
local h = {}
h.get_random_entry = function(tbl)
local keys = {}
for key, _ in ipairs(tbl) do
table.insert(keys, key)
end
local randomKey = keys[math.random(1, #keys)]
return tbl[randomKey]
end
local M = {}
M.get_wallpaper = function(dir)
local wallpapers = {}
for _, v in ipairs(wezterm.glob(dir)) do
if not (string.match(v, "%.git$") or string.match(v, "%.DS_Store$")) then
table.insert(wallpapers, v)
end
end
local wallpaper = h.get_random_entry(wallpapers)
wallpaper = string.gsub(wallpaper, "/", "\\")
return {
source = { File = { path = wallpaper } },
height = "Cover",
width = "Cover",
horizontal_align = "Center",
repeat_x = "Repeat",
repeat_y = "Repeat",
opacity = 1,
hsb = {
brightness = 0.02,
hue = 1.0,
saturation = 1.0,
},
-- speed = 200,
}
end
local path = "C:\\Users\\Tushya\\Desktop\\Wallpaper\\**"
config.background = { M.get_wallpaper(path) }
-- config.background = {
-- {
-- source = { File = { path = "C:\\Users\\Tushya\\Desktop\\Wallpaper\\n6s6uj47jst61.jpg" } },
-- height = "Cover",
-- width = "Cover",
-- horizontal_align = "Center",
-- repeat_x = "Repeat",
-- repeat_y = "Repeat",
-- opacity = 1,
-- hsb = {
-- brightness = 0.02,
-- hue = 1.0,
-- saturation = 1.0,
-- },
-- -- speed = 200,
-- },
-- }
local mux = wezterm.mux
wezterm.on("gui-startup", function()
local _, _, window = mux.spawn_window({})
window:gui_window():maximize()
end)
-- and finally, return the configuration to wezterm
return config