diff options
| author | 2026-06-15 17:02:56 -0700 | |
|---|---|---|
| committer | 2026-06-15 17:02:56 -0700 | |
| commit | a50c3f3916a986230b9c2a1f602b6021e902e372 (patch) | |
| tree | 13e3c141f85164711491e3e132c66f50ba25fcbd | |
| parent | 0bf0883bef0d10fa0f198bb3938f59d7a9236e8c (diff) | |
| download | new-dotfiles-a50c3f3916a986230b9c2a1f602b6021e902e372.tar.gz new-dotfiles-a50c3f3916a986230b9c2a1f602b6021e902e372.zip | |
wezterm: Replace Lua config with Fennel
| -rw-r--r-- | GNUmakefile | 11 | ||||
| -rw-r--r-- | _mbsetupuser/Brewfile.org | 2 | ||||
| -rw-r--r-- | emacs/.emacs.d/init.org | 6 | ||||
| -rw-r--r-- | wezterm/.config/wezterm/wezterm.fnl | 68 | ||||
| -rw-r--r-- | wezterm/.config/wezterm/wezterm.lua | 99 |
5 files changed, 105 insertions, 81 deletions
diff --git a/GNUmakefile b/GNUmakefile index ed30f60..f15fd99 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -132,7 +132,14 @@ nyxt: nyxt/.config/nyxt/init.lisp %.elc: %.el @printf "\e[36mELC\e[0m %s\n" $< - $(EMACS) -q -batch -f package-initialize -f batch-byte-compile $< + @$(EMACS) -q -batch -f package-initialize -f batch-byte-compile $< + +%.fnl: %.org + $(call tangle,fennel) + +%.lua: %.fnl + @printf "\e[32mFNL\e[0m %s\n" $< + @fennel --compile $^ > $@ %: %.org $(call tangle) @@ -171,6 +178,8 @@ brew-install: _mbsetupuser/Brewfile before-_mbsetupuser-install: _mbsetupuser/.emacs.d/init.elc +before-wezterm-install: wezterm/.config/wezterm/wezterm.lua + _mbsetupuser/.config/zsh/conf.d/postgresql.sh: _mbsetupuser/Brewfile $(call tangle,shell) diff --git a/_mbsetupuser/Brewfile.org b/_mbsetupuser/Brewfile.org index 208aa50..c55bfe2 100644 --- a/_mbsetupuser/Brewfile.org +++ b/_mbsetupuser/Brewfile.org @@ -30,6 +30,7 @@ Then I need some things for configuration and development purposes: - stow :: Mainly used with this repository, "installs" configuration files by making and maintaining symbolic links. - make :: The bundled version with macos is really old and doesn't support some of the features that I use. - tailscale :: Mesh VPN that lets me connect to my self-hosted services like music streaming. +- fennel :: Fennel is a lisp -> lua compiler, it allows me to write lua config (like Wezterm and Hammerspoon) in lisp. #+begin_src ruby @@ -37,6 +38,7 @@ Then I need some things for configuration and development purposes: brew "stow" brew "make" cask "tailscale-app" + brew "fennel" #+end_src And there are some development projects that I need to be able to install. diff --git a/emacs/.emacs.d/init.org b/emacs/.emacs.d/init.org index fa3f069..13e08ca 100644 --- a/emacs/.emacs.d/init.org +++ b/emacs/.emacs.d/init.org @@ -827,6 +827,12 @@ Highlight diffs in the fringe. (use-package mixed-pitch) #+end_src +* Fennel + +#+begin_src emacs-lisp + (use-package fennel-mode) +#+end_src + * Custom Change the file where =customize= stores its settings. diff --git a/wezterm/.config/wezterm/wezterm.fnl b/wezterm/.config/wezterm/wezterm.fnl new file mode 100644 index 0000000..eb1bffe --- /dev/null +++ b/wezterm/.config/wezterm/wezterm.fnl @@ -0,0 +1,68 @@ +(local wezterm (require :wezterm)) + +(local colors { :foreground "#bfbfbf" + :background "#222424" }) + +(local open-url-key + { :key "E" + :mods "CTRL|SHIFT" + :action (wezterm.action.QuickSelectArgs + { :label "open url" + :patterns [ "https?://[[:alnum:]./-]+[[:alnum:]/]" ] + :action (wezterm.action_callback + (fn [window pane] + (let [url (window:get_selection_text_for_pane pane)] + (wezterm.log_info (.. "opening: " url)) + (wezterm.open_with url)))) }) }) + +(local 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 + (fn [window pane] + (let [text (window:get_selection_text_for_pane pane)] + (wezterm.log_info (.. "copying: " text)) + (window:copy_to_clipboard text)))) }) }) +(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 }) + +{ + ;; I use a tiling window manager, so the window size can't change when the font + ;; size changes. + :adjust_window_size_when_changing_font_size false + + :default_cursor_style "SteadyBar" + + : colors + : keys + : inactive_pane_hsb + + ;; :command_palette_font (wezterm.font "Fantasque Sans Mono") + :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" + + ;; "INTEGRATED_BUTTONS|RESIZE" keeps the borders resizable and puts the + ;; Min/Max/Close buttons in the tab bar (modern look). + :window_decorations "INTEGRATED_BUTTONS|RESIZE" + + } diff --git a/wezterm/.config/wezterm/wezterm.lua b/wezterm/.config/wezterm/wezterm.lua index ebf6494..3459deb 100644 --- a/wezterm/.config/wezterm/wezterm.lua +++ b/wezterm/.config/wezterm/wezterm.lua @@ -1,80 +1,19 @@ -local wezterm = require 'wezterm' - -local colors = { - foreground = '#bfbfbf', - background = '#222424', -} - -local open_url_key = { - key = 'E', - mods = 'CTRL|SHIFT', - action = wezterm.action.QuickSelectArgs { - label = 'open url', - patterns = { - 'https?://[[:alnum:]./-]+[[:alnum:]/]', - }, - action = wezterm.action_callback(function(window, pane) - local url = window:get_selection_text_for_pane(pane) - wezterm.log_info('opening: ' .. url) - wezterm.open_with(url) - end), - }, -} - -local 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(function(window, pane) - local text = window:get_selection_text_for_pane(pane) - wezterm.log_info('copying: ' .. text) - window:copy_to_clipboard(text) - end), - }, -} - -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 { - -- I use a tiling window manager, so the window size can't change when the - -- font size changes. - adjust_window_size_when_changing_font_size = false, - - default_cursor_style = 'SteadyBar', - - colors = colors, - keys = keys, - inactive_pane_hsb = inactive_pane_hsb, - - command_palette_font = wezterm.font 'Fantasque Sans Mono', - 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 = 14, - - hide_tab_bar_if_only_one_tab = true, - - quick_select_alphabet = "arstdhneio", - - -- "INTEGRATED_BUTTONS|RESIZE" keeps the borders resizable and - -- puts the Min/Max/Close buttons in the tab bar (modern look). - window_decorations = "INTEGRATED_BUTTONS|RESIZE", -} +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) +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) +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} |
