Skip to content

Commit

Permalink
feat(krunner): add shortcut options (#454)
Browse files Browse the repository at this point in the history
  • Loading branch information
HeitorAugustoLN authored Jan 10, 2025
1 parent 1756b31 commit a53af7f
Showing 1 changed file with 29 additions and 4 deletions.
33 changes: 29 additions & 4 deletions modules/krunner.nix
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,25 @@ in
example = "disabled";
description = "Set the behavior of KRunner’s history.";
};

shortcuts = {
launch = lib.mkOption {
type = with lib.types; nullOr (either str (listOf str));
default = null;
example = "Meta";
description = "Set the shortcut to launch KRunner.";
};
runCommandOnClipboard = lib.mkOption {
type = with lib.types; nullOr (either str (listOf str));
default = null;
example = "Meta+Shift";
description = "Set the shortcut to run the command on the clipboard contents.";
};
};
};

config.programs.plasma.configFile."krunnerrc" = (
lib.mkMerge [
config.programs.plasma = {
configFile.krunnerrc = lib.mkMerge [
(lib.mkIf (cfg.krunner.position != null) {
General.FreeFloating = cfg.krunner.position == "center";
})
Expand All @@ -53,6 +68,16 @@ in
"Disabled"
);
})
]
);
];

shortcuts."services/org.kde.krunner.desktop" = lib.mkMerge [
(lib.mkIf (cfg.krunner.shortcuts.launch != null) {
_launch = cfg.krunner.shortcuts.launch;
})

(lib.mkIf (cfg.krunner.shortcuts.runCommandOnClipboard != null) {
RunClipboard = cfg.krunner.shortcuts.runCommandOnClipboard;
})
];
};
}

0 comments on commit a53af7f

Please sign in to comment.