From 96ed365ab79fc70c5d6ac594b17fc13dcd8e4c49 Mon Sep 17 00:00:00 2001 From: Dave Snider Date: Fri, 25 Aug 2023 19:21:42 -0400 Subject: [PATCH 1/2] alacritty integration --- lua/true-zen/config.lua | 4 ++++ lua/true-zen/integrations/alacritty.lua | 27 +++++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 lua/true-zen/integrations/alacritty.lua diff --git a/lua/true-zen/config.lua b/lua/true-zen/config.lua index 5a21d99..c98b217 100644 --- a/lua/true-zen/config.lua +++ b/lua/true-zen/config.lua @@ -74,6 +74,10 @@ config.options = { enabled = false, font = "+3" }, + alacritty = { + enabled = false, + font = "24" + }, twilight = false, -- enable twilight (ataraxis) lualine = false -- hide nvim-lualine (ataraxis) }, diff --git a/lua/true-zen/integrations/alacritty.lua b/lua/true-zen/integrations/alacritty.lua new file mode 100644 index 0000000..f2a60f6 --- /dev/null +++ b/lua/true-zen/integrations/alacritty.lua @@ -0,0 +1,27 @@ +local M = {} + +local cnf = require("true-zen.config").options +local fn = vim.fn +local status + +function M.on() + if not fn.executable("alacritty") then + return + end + local cmd = "alacritty msg config -w %s font.size=%s" + local win_id = fn.expand("$ALACRITTY_WINDOW_ID") + fn.system(cmd:format(win_id, cnf.integrations.alacritty.font)) + vim.cmd([[redraw]]) + status = true +end + +function M.off() + if status == true then + local cmd = "alacritty msg config -w %s --reset" + local win_id = fn.expand("$ALACRITTY_WINDOW_ID") + fn.system(cmd:format(win_id)) + end + status = nil +end + +return M From 2d049993e19d46e1e99aa80a124b8c84e255c5ba Mon Sep 17 00:00:00 2001 From: Dave Snider Date: Fri, 25 Aug 2023 19:32:57 -0400 Subject: [PATCH 2/2] readme --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 171f811..c921a13 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,7 @@ https://user-images.githubusercontent.com/58336662/181860318-8834446a-e28f-4a75- - integratons: - [tmux](https://github.com/tmux/tmux) - [kitty](https://sw.kovidgoyal.net/kitty/) + - [alacritty](https://alacritty.org/) - [twilight.nvim](https://github.com/folke/twilight.nvim) - [nvim-lualine](https://github.com/nvim-lualine/lualine.nvim) @@ -161,6 +162,10 @@ true-zen comes with the following defaults: enabled = false, font = "+3" }, + alacritty = { -- increment font size in Alacrity. Requires v 0.10.0 or higher. Uses `alacritty msg` subcommand to toggle font size + enabled = false, + font = "24" + }, twilight = false, -- enable twilight (ataraxis) lualine = false -- hide nvim-lualine (ataraxis) },