diff --git a/nix/home/desktop.nix b/nix/home/desktop.nix index 5b55975..c6140b2 100644 --- a/nix/home/desktop.nix +++ b/nix/home/desktop.nix @@ -31,4 +31,45 @@ in home = { packages = defaultPkgs ++ gnomePkgs; }; + + dconf.settings = + let + inherit (builtins) length head tail listToAttrs genList; + range = a: b: if a < b then [ a ] ++ range (a + 1) b else [ ]; + globalPath = "org/gnome/settings-daemon/plugins/media-keys"; + path = "${globalPath}/custom-keybindings"; + mkPath = id: "${globalPath}/custom${toString id}"; + isEmpty = list: length list == 0; + mkSettings = settings: + let + checkSettings = { name, command, binding }@this: this; + aux = i: list: + if isEmpty list then [ ] else + let + hd = head list; + tl = tail list; + name = mkPath i; + in + aux (i + 1) tl ++ [{ + name = mkPath i; + value = checkSettings hd; + }]; + settingsList = (aux 0 settings); + in + listToAttrs (settingsList ++ [ + { + name = globalPath; + value = { + custom-keybindings = genList (i: "/${mkPath i}/") (length settingsList); + }; + } + ]); + in + mkSettings [ + { + name = "rofi-run"; + command = "rofi -show run -normal-window"; + binding = "d"; + } + ]; } diff --git a/nix/system/configuration.nix b/nix/system/configuration.nix index 14f7681..df4cdf7 100644 --- a/nix/system/configuration.nix +++ b/nix/system/configuration.nix @@ -88,6 +88,7 @@ programs.adb.enable = true; # List services that you want to enable: + services.dbus.packages = with pkgs; [ dconf ]; # Enable fingerprint reading services.fprintd.enable = true;