modules/home/desktop/niri/default.nix: change tab bar modules/home/programs/terminal/wezterm.nix: fix keybinds modules/nixos/desktop/niri.nix: auto-unlock gnome-keyring Signed-off-by: unexplrd <unexplrd@linerds.us>
108 lines
4.4 KiB
Nix
108 lines
4.4 KiB
Nix
{
|
|
config,
|
|
# inputs,
|
|
# pkgs,
|
|
lib,
|
|
...
|
|
}:
|
|
with lib; let
|
|
cfg = config.terminal.wezterm;
|
|
in {
|
|
options = {
|
|
terminal.wezterm.enable =
|
|
mkEnableOption "enable wez's terminal";
|
|
};
|
|
config = mkIf cfg.enable {
|
|
programs.wezterm = {
|
|
enable = true;
|
|
# package = inputs.wezterm.packages.${pkgs.system}.default;
|
|
extraConfig = let
|
|
arrows = {
|
|
left = "LeftArrow";
|
|
down = "DownArrow";
|
|
up = "UpArrow";
|
|
right = "RightArrow";
|
|
};
|
|
homerow-arrows = {
|
|
left = "n";
|
|
down = "e";
|
|
up = "i";
|
|
right = "o";
|
|
};
|
|
genNavigation = keys: ''
|
|
{ key = '${keys.left}', mods = 'LEADER', action = act.ActivatePaneDirection 'Left' },
|
|
{ key = '${keys.down}', mods = 'LEADER', action = act.ActivatePaneDirection 'Down' },
|
|
{ key = '${keys.up}', mods = 'LEADER', action = act.ActivatePaneDirection 'Up' },
|
|
{ key = '${keys.right}', mods = 'LEADER', action = act.ActivatePaneDirection 'Right' },
|
|
{ key = '${keys.left}', mods = 'CTRL|SHIFT', action = act.ActivatePaneDirection 'Left' },
|
|
{ key = '${keys.down}', mods = 'CTRL|SHIFT', action = act.ActivatePaneDirection 'Down' },
|
|
{ key = '${keys.up}', mods = 'CTRL|SHIFT', action = act.ActivatePaneDirection 'Up' },
|
|
{ key = '${keys.right}', mods = 'CTRL|SHIFT', action = act.ActivatePaneDirection 'Right' },
|
|
'';
|
|
in ''
|
|
local wezterm = require 'wezterm'
|
|
local act = wezterm.action
|
|
return {
|
|
front_end = 'WebGpu',
|
|
unix_domains = {
|
|
{
|
|
name = 'unix',
|
|
},
|
|
},
|
|
enable_kitty_graphics = true,
|
|
window_padding = {
|
|
left = 0,
|
|
right = 0,
|
|
top = 0,
|
|
bottom = 0,
|
|
},
|
|
use_fancy_tab_bar = false,
|
|
inactive_pane_hsb = {
|
|
-- saturation = 0.8,
|
|
brightness = 0.7,
|
|
},
|
|
-- window_frame = {
|
|
-- font = wezterm.font { family = 'Cantarell', weight = 'Bold' },
|
|
-- },
|
|
disable_default_key_bindings = true,
|
|
leader = { key = 'Space', mods = 'CTRL', timeout_milliseconds = 2000 },
|
|
keys = {
|
|
{ key = 'Enter', mods = 'SHIFT|CTRL', action = act.ActivateCopyMode },
|
|
{ key = 'R', mods = 'SHIFT|CTRL', action = act.ReloadConfiguration },
|
|
{ key = '=', mods = 'CTRL', action = act.IncreaseFontSize },
|
|
{ key = '-', mods = 'CTRL', action = act.DecreaseFontSize },
|
|
{ key = '0', mods = 'CTRL', action = act.ResetFontSize },
|
|
{ key = 'C', mods = 'SHIFT|CTRL', action = act.CopyTo 'Clipboard' },
|
|
-- { key = 'N', mods = 'SHIFT|CTRL', action = act.SpawnWindow },
|
|
{ key = 'l', mods = 'SHIFT|CTRL', action = act.CharSelect{ copy_on_select = true, copy_to = 'ClipboardAndPrimarySelection' } },
|
|
{ key = 'v', mods = 'SHIFT|CTRL', action = act.PasteFrom 'Clipboard' },
|
|
{ key = '<', mods = 'CTRL|SHIFT', action = act.ActivateTabRelative(-1) },
|
|
{ key = '>', mods = 'CTRL|SHIFT', action = act.ActivateTabRelative(1) },
|
|
{ key = 'Tab', mods = 'CTRL|SHIFT', action = act.ActivateTabRelative(-1) },
|
|
{ key = 'Tab', mods = 'CTRL', action = act.ActivateTabRelative(1) },
|
|
{ key = '%', mods = 'SHIFT|CTRL', action = act.SplitVertical { domain = 'CurrentPaneDomain' }, },
|
|
{ key = '"', mods = 'SHIFT|CTRL', action = act.SplitHorizontal { domain = 'CurrentPaneDomain' }, },
|
|
-- pane navigation
|
|
${genNavigation arrows}
|
|
${genNavigation homerow-arrows}
|
|
|
|
{ key = 't', mods = 'SHIFT|CTRL', action = act.SpawnTab 'CurrentPaneDomain' },
|
|
{ key = 'w', mods = 'SHIFT|CTRL', action = act.CloseCurrentTab{ confirm = false } },
|
|
{ key = 'f', mods = 'SHIFT|CTRL', action = act.CloseCurrentPane{ confirm = false } },
|
|
{ key = 'b', mods = 'LEADER|CTRL', action = act.SendString '\x02', },
|
|
{ key = 'Enter', mods = 'LEADER', action = act.ActivateCopyMode, },
|
|
{ key = 'p', mods = 'LEADER', action = act.PasteFrom 'PrimarySelection', },
|
|
{ key = 'k', mods = 'SHIFT|CTRL', action = act.Multiple
|
|
{
|
|
act.ClearScrollback 'ScrollbackAndViewport',
|
|
act.SendKey { key = 'L', mods = 'CTRL' },
|
|
},
|
|
},
|
|
{ key = 'r', mods = 'LEADER', action = act.ActivateKeyTable { name = 'resize_pane', one_shot = false, }, }
|
|
},
|
|
}
|
|
'';
|
|
};
|
|
};
|
|
}
|