aboutsummaryrefslogtreecommitdiffstats
path: root/wezterm
diff options
context:
space:
mode:
authorGravatar Tom Willemse2026-07-07 22:47:09 -0700
committerGravatar Tom Willemse2026-08-26 23:04:25 -0700
commitd077a21a682faa27ab6f153650f38737894af7af (patch)
tree8fd975b6e89fb499dab5e4d6a38f32183a110f45 /wezterm
parent46f760afc641c26a2576a50a2e7b26eafd22603b (diff)
downloadnew-dotfiles-d077a21a682faa27ab6f153650f38737894af7af.tar.gz
new-dotfiles-d077a21a682faa27ab6f153650f38737894af7af.zip
wezterm: Dynamically load fennel for configuration
Diffstat (limited to 'wezterm')
-rw-r--r--wezterm/.config/wezterm/init.fnl (renamed from wezterm/.config/wezterm/wezterm.fnl)0
-rw-r--r--wezterm/.config/wezterm/wezterm.lua39
2 files changed, 22 insertions, 17 deletions
diff --git a/wezterm/.config/wezterm/wezterm.fnl b/wezterm/.config/wezterm/init.fnl
index 611624d..611624d 100644
--- a/wezterm/.config/wezterm/wezterm.fnl
+++ b/wezterm/.config/wezterm/init.fnl
diff --git a/wezterm/.config/wezterm/wezterm.lua b/wezterm/.config/wezterm/wezterm.lua
index 3459deb..cfd432e 100644
--- a/wezterm/.config/wezterm/wezterm.lua
+++ b/wezterm/.config/wezterm/wezterm.lua
@@ -1,19 +1,24 @@
-local wezterm = require("wezterm")
-local colors = {foreground = "#bfbfbf", background = "#222424"}
-local open_url_key
-local function _1_(window, pane)
- local url = window:get_selection_text_for_pane(pane)
- wezterm.log_info(("opening: " .. url))
- return wezterm.open_with(url)
+local wezterm = require "wezterm"
+
+local function file_exists(name)
+ local f = io.open(name, "r")
+ if f ~= nil then
+ io.close(f)
+ return true
+ end
+ return false
end
-open_url_key = {key = "E", mods = "CTRL|SHIFT", action = wezterm.action.QuickSelectArgs({label = "open url", patterns = {"https?://[[:alnum:]./-]+[[:alnum:]/]"}, action = wezterm.action_callback(_1_)})}
-local copy_guix_hash_key
-local function _2_(window, pane)
- local text = window:get_selection_text_for_pane(pane)
- wezterm.log_info(("copying: " .. text))
- return window:copy_to_clipboard(text)
+
+local file_name = wezterm.config_dir .. "/fennel.lua"
+
+if not file_exists(file_name) then
+ os.execute("curl -o \"" .. file_name .. "\" https://fennel-lang.org/downloads/fennel-1.6.1.lua")
end
-copy_guix_hash_key = {key = "G", mods = "CTRL|SHIFT", action = wezterm.action.QuickSelectArgs({label = "copy hash", patterns = {"[a-z0-9]{52}"}, action = wezterm.action_callback(_2_)})}
-local keys = {open_url_key, copy_guix_hash_key, {key = "o", mods = "ALT", action = wezterm.action.PaneSelect}, {key = "p", mods = "ALT", action = wezterm.action.ScrollToPrompt(-1)}, {key = "n", mods = "ALT", action = wezterm.action.ScrollToPrompt(1)}}
-local inactive_pane_hsb = {saturation = 0.8, brightness = 0.7}
-return {default_cursor_style = "SteadyBar", colors = colors, keys = keys, inactive_pane_hsb = inactive_pane_hsb, command_palette_font_size = 14, command_palette_bg_color = "#111414", command_palette_fg_color = "#bfbfbf", command_palette_rows = 10, font = wezterm.font("Fantasque Sans Mono"), font_size = 20, hide_tab_bar_if_only_one_tab = true, quick_select_alphabet = "arstdhneio", window_decorations = "INTEGRATED_BUTTONS|RESIZE", adjust_window_size_when_changing_font_size = false}
+
+wezterm.log_info(package.path)
+
+local fennel_file_name = wezterm.config_dir .. "/init.fnl"
+
+wezterm.add_to_config_reload_watch_list(fennel_file_name)
+
+return require("fennel").install().dofile(fennel_file_name)