Skip to content

Commit

Permalink
Add module for KRunner
Browse files Browse the repository at this point in the history
  • Loading branch information
Iorvethe committed Sep 2, 2024
1 parent c002619 commit ae65789
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
1 change: 1 addition & 0 deletions modules/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
./fonts.nix
./hotkeys.nix
./input.nix
./krunner.nix
./kscreenlocker.nix
./kwin.nix
./panels.nix
Expand Down
43 changes: 43 additions & 0 deletions modules/krunner.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{ config, lib, ... }:
let cfg = config.programs.plasma;
in with lib; {
options.programs.plasma.krunner = {
position = mkOption {
type = with types; nullOr (enum [ "Top" "Center" ]);
default = null;
example = "Center";
description = "Position of KRunner on screen.";
};
activateWhenTypingOnDesktop = mkOption {
type = with types; nullOr bool;
default = null;
description = "Activate KRunner when typing on the desktop.";
};
historyBehavior = mkOption {
type = with types;
nullOr (enum [ "Disabled" "EnableSuggestions" "EnableAutoComplete" ]);
default = null;
example = "Disabled";
description = "Behavior of KRunner’s history.";
};
};

config.programs.plasma.configFile."krunnerrc" = (mkMerge [
(mkIf (cfg.krunner.position != null) {
General.FreeFloating = cfg.krunner.position == "Center";
})
(mkIf (cfg.krunner.activateWhenTypingOnDesktop != null) {
General.ActivateWhenTypingOnDesktop =
cfg.krunner.activateWhenTypingOnDesktop;
})
(mkIf (cfg.krunner.historyBehavior != null) {
General.historyBehavior =
(if cfg.krunner.historyBehavior == "EnableSuggestions" then
"CompletionSuggestion"
else if cfg.krunner.historyBehavior == "EnableAutoComplete" then
"ImmediateCompletion"
else
cfg.krunner.historyBehavior);
})
]);
}

0 comments on commit ae65789

Please sign in to comment.