feat: mail server

This commit is contained in:
DACHXY 2025-05-05 13:37:38 +08:00
parent 396a4d603d
commit 1e77f204d0
13 changed files with 320 additions and 57 deletions

View file

@ -31,3 +31,22 @@ vim.g.mkdp_combine_preview = 1
vim.g.mkdp_echo_preview_url = 1
vim.g.mkdp_open_to_the_world = 1
vim.g.mkdp_port = "20088"
-- Use osc52 as clipboard provider
local function paste()
return { vim.fn.split(vim.fn.getreg(""), "\n"), vim.fn.getregtype("") }
end
vim.g.clipboard = {
name = "OSC 52",
copy = {
["+"] = require("vim.ui.clipboard.osc52").copy("+"),
["*"] = require("vim.ui.clipboard.osc52").copy("*"),
},
paste = {
["+"] = paste,
["*"] = paste,
},
}
-- To ALWAYS use the clipboard for ALL operations
-- (instead of interacting with the "+" and/or "*" registers explicitly):
vim.opt.clipboard = "unnamedplus"

View file

@ -33,5 +33,7 @@
GTK_CSD = "0";
GTK_USE_PORTAL = "1";
GTK_IM_MODULE = "";
MAIL = "~/Mailbox";
};
}

View file

@ -31,9 +31,18 @@ let
tmux switch-client -t $selected_name
'';
ryank = pkgs.writeShellScriptBin "ryank" ''
# copy via OSC 52
buf=$( cat "$@" )
len=$( printf %s "$buf" | wc -c ) max=74994
test $len -gt $max && echo "$0: input is $(( len - max )) bytes too long" >&2
printf "\033]52;c;$( printf %s "$buf" | head -c $max | base64 | tr -d '\r\n' )\a"
'';
in
{
home.packages = [
tmuxSessionizer
ryank
];
}