From c0a531a023123707ea7952db07039125abb415aa Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Thu, 20 Mar 2025 09:11:09 +0100 Subject: [PATCH] feat(gui/kbd): add configurable ellipsis keybinding - Introduce `gui.kbd.ellipsis.enable` option for keybinding. - Move related xkb configuration to a dedicated module for clarity. - Simplify `default.nix` by delegating ellipsis setup to the new module. --- homes/x86_64-linux/harald@x1/default.nix | 11 +---------- modules/home/gui/kbd/default.nix | 25 ++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 10 deletions(-) create mode 100644 modules/home/gui/kbd/default.nix diff --git a/homes/x86_64-linux/harald@x1/default.nix b/homes/x86_64-linux/harald@x1/default.nix index ca75ab9..237c42d 100644 --- a/homes/x86_64-linux/harald@x1/default.nix +++ b/homes/x86_64-linux/harald@x1/default.nix @@ -18,6 +18,7 @@ tools = { git.enable = true; }; + gui.kbd.ellipsis.enable = true; }; fonts.fontconfig.enable = true; @@ -64,16 +65,6 @@ }; dconf.settings."org/gnome/desktop/input-sources".xkb-options = [ "mod:ellipsis" ]; - xdg.configFile."xkb/symbols/mod".text = '' - xkb_symbols "ellipsis" { - key { [ period, greater, ellipsis, division ] }; - }; - ''; - xdg.configFile."xkb/rules/evdev".text = '' - ! option = symbols - mod:ellipsis = +mod(ellipsis) - ! include %S/evdev - ''; xdg.enable = true; xdg.mime.enable = true; diff --git a/modules/home/gui/kbd/default.nix b/modules/home/gui/kbd/default.nix new file mode 100644 index 0000000..b404878 --- /dev/null +++ b/modules/home/gui/kbd/default.nix @@ -0,0 +1,25 @@ +{ config, lib, ... }: + +with lib; +let + cfg = config.metacfg.gui.kbd; +in +{ + options.metacfg.gui.kbd = { + ellipsis = mkEnableOption "ellipsis keybinding for period key"; + }; + + config = mkIf cfg.ellipsis { + xdg.configFile."xkb/symbols/mod".text = '' + xkb_symbols "ellipsis" { + key { [ period, greater, ellipsis, division ] }; + }; + ''; + + xdg.configFile."xkb/rules/evdev".text = '' + ! option = symbols + mod:ellipsis = +mod(ellipsis) + ! include %S/evdev + ''; + }; +} \ No newline at end of file