Skip to content

Commit 29d8543

Browse files
author
Fixerer
committed
Add home-manager option for mousebinds
1 parent 26dfae2 commit 29d8543

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

nix/modules/home-manager.nix

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ in
224224
"select"
225225
"up"
226226
"down"
227+
"nop"
227228
];
228229
};
229230
};
@@ -232,6 +233,34 @@ in
232233
default = null;
233234
};
234235

236+
mousebinds = mkOption {
237+
type = nullOr (
238+
listOf (submodule {
239+
options = {
240+
button = mkOption {
241+
type = str;
242+
description = ''
243+
Mouse button name
244+
245+
Primary/Secondary/Middle or Unknown(<u32>) with key code for the mouse button.
246+
'';
247+
};
248+
action = mkOption {
249+
type = enum [
250+
"close"
251+
"select"
252+
"up"
253+
"down"
254+
"nop"
255+
];
256+
};
257+
};
258+
})
259+
);
260+
default = null;
261+
};
262+
263+
235264
extraLines = mkOption {
236265
type = nullOr lines;
237266
default = null;
@@ -328,6 +357,22 @@ in
328357
'') cfg.config.keybinds
329358
}],
330359
'';
360+
361+
mousebinds =
362+
if cfg.config.mousebinds == null then
363+
""
364+
else
365+
''
366+
mousebinds: [
367+
${
368+
concatMapStringsSep "\n" (x: ''
369+
Mousebind(
370+
button: "${capitalize x.button}",
371+
action: ${capitalize x.action},
372+
),
373+
'') cfg.config.mousebinds
374+
}],
375+
'';
331376
in
332377
{
333378
assertions = [
@@ -382,6 +427,7 @@ in
382427
plugins: ${toJSON parsedPlugins},
383428
${optionalString (cfg.config.extraLines != null) cfg.config.extraLines}
384429
${keybinds}
430+
${mousebinds}
385431
)
386432
'';
387433
}

0 commit comments

Comments
 (0)