1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-12-16 05:51:08 +01:00

kitty: add option mouseBindings (#8111)

This commit is contained in:
Alex Ionescu 2025-11-03 04:55:45 +01:00 committed by GitHub
parent 0fe68257a9
commit 50a5766d51
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 35 additions and 1 deletions

View file

@ -42,6 +42,10 @@ let
mkKeyValue = key: command: "map ${key} ${command}"; mkKeyValue = key: command: "map ${key} ${command}";
}; };
toKittyMouseBindings = lib.generators.toKeyValue {
mkKeyValue = key: command: "mouse_map ${key} ${command}";
};
toKittyActionAliases = lib.generators.toKeyValue { toKittyActionAliases = lib.generators.toKeyValue {
mkKeyValue = alias_name: action: "action_alias ${alias_name} ${action}"; mkKeyValue = alias_name: action: "action_alias ${alias_name} ${action}";
}; };
@ -199,6 +203,18 @@ in
''; '';
}; };
mouseBindings = mkOption {
type = types.attrsOf types.str;
default = { };
description = "Mapping of mouse bindings to actions.";
example = literalExpression ''
{
"ctrl+left click" = "ungrabbed mouse_handle_click selection link prompt";
"left click" = "ungrabbed no-op";
};
'';
};
environment = mkOption { environment = mkOption {
type = types.attrsOf types.str; type = types.attrsOf types.str;
default = { }; default = { };
@ -316,7 +332,8 @@ in
(mkOrder 540 (toKittyConfig cfg.settings)) (mkOrder 540 (toKittyConfig cfg.settings))
(mkOrder 550 (toKittyActionAliases cfg.actionAliases)) (mkOrder 550 (toKittyActionAliases cfg.actionAliases))
(mkOrder 560 (toKittyKeybindings cfg.keybindings)) (mkOrder 560 (toKittyKeybindings cfg.keybindings))
(mkOrder 570 (toKittyEnv cfg.environment)) (mkOrder 570 (toKittyMouseBindings cfg.mouseBindings))
(mkOrder 580 (toKittyEnv cfg.environment))
]; ];
xdg.configFile."kitty/kitty.conf" = { xdg.configFile."kitty/kitty.conf" = {

View file

@ -19,5 +19,8 @@ action_alias launch_window launch --cwd=current --type=os-window
map ctrl+c copy_or_interrupt map ctrl+c copy_or_interrupt
map ctrl+f>2 set_font_size 20 map ctrl+f>2 set_font_size 20
mouse_map ctrl+left click ungrabbed mouse_handle_click selection link prompt
mouse_map left click ungrabbed no-op
env LS_COLORS=1 env LS_COLORS=1

View file

@ -25,6 +25,11 @@
"ctrl+f>2" = "set_font_size 20"; "ctrl+f>2" = "set_font_size 20";
}; };
mouseBindings = {
"ctrl+left click" = "ungrabbed mouse_handle_click selection link prompt";
"left click" = "ungrabbed no-op";
};
actionAliases = { actionAliases = {
"launch_tab" = "launch --cwd=current --type=tab"; "launch_tab" = "launch --cwd=current --type=tab";
"launch_window" = "launch --cwd=current --type=os-window"; "launch_window" = "launch --cwd=current --type=os-window";

View file

@ -17,5 +17,8 @@ action_alias launch_window launch --cwd=current --type=os-window
map ctrl+c copy_or_interrupt map ctrl+c copy_or_interrupt
map ctrl+f>2 set_font_size 20 map ctrl+f>2 set_font_size 20
mouse_map ctrl+left click ungrabbed mouse_handle_click selection link prompt
mouse_map left click ungrabbed no-op
env LS_COLORS=1 env LS_COLORS=1

View file

@ -25,6 +25,11 @@
"ctrl+f>2" = "set_font_size 20"; "ctrl+f>2" = "set_font_size 20";
}; };
mouseBindings = {
"ctrl+left click" = "ungrabbed mouse_handle_click selection link prompt";
"left click" = "ungrabbed no-op";
};
actionAliases = { actionAliases = {
"launch_tab" = "launch --cwd=current --type=tab"; "launch_tab" = "launch --cwd=current --type=tab";
"launch_window" = "launch --cwd=current --type=os-window"; "launch_window" = "launch --cwd=current --type=os-window";