Skip to content

Commit

Permalink
Make values follow camelCase pattern and remove with lib;
Browse files Browse the repository at this point in the history
  • Loading branch information
HeitorAugustoLN authored Sep 3, 2024
1 parent ae65789 commit 3edf2a6
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions modules/krunner.nix
Original file line number Diff line number Diff line change
@@ -1,43 +1,44 @@
{ config, lib, ... }:
let cfg = config.programs.plasma;
in with lib; {
in {
options.programs.plasma.krunner = {
position = mkOption {
type = with types; nullOr (enum [ "Top" "Center" ]);
position = lib.mkOption {
type = with lib.types; nullOr (enum [ "top" "center" ]);
default = null;
example = "Center";
example = "center";
description = "Position of KRunner on screen.";
};
activateWhenTypingOnDesktop = mkOption {
type = with types; nullOr bool;
type = with lib.types; nullOr bool;
default = null;
example = true;
description = "Activate KRunner when typing on the desktop.";
};
historyBehavior = mkOption {
type = with types;
nullOr (enum [ "Disabled" "EnableSuggestions" "EnableAutoComplete" ]);
type = with lib.types;
nullOr (enum [ "disabled" "enableSuggestions" "enableAutoComplete" ]);
default = null;
example = "Disabled";
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";
config.programs.plasma.configFile."krunnerrc" = (lib.mkMerge [
(lib.mkIf (cfg.krunner.position != null) {
General.FreeFloating = cfg.krunner.position == "center";
})
(mkIf (cfg.krunner.activateWhenTypingOnDesktop != null) {
(lib.mkIf (cfg.krunner.activateWhenTypingOnDesktop != null) {
General.ActivateWhenTypingOnDesktop =
cfg.krunner.activateWhenTypingOnDesktop;
})
(mkIf (cfg.krunner.historyBehavior != null) {
(lib.mkIf (cfg.krunner.historyBehavior != null) {
General.historyBehavior =
(if cfg.krunner.historyBehavior == "EnableSuggestions" then
(if cfg.krunner.historyBehavior == "enableSuggestions" then
"CompletionSuggestion"
else if cfg.krunner.historyBehavior == "EnableAutoComplete" then
else if cfg.krunner.historyBehavior == "enableAutoComplete" then
"ImmediateCompletion"
else
cfg.krunner.historyBehavior);
"Disabled");
})
]);
}

0 comments on commit 3edf2a6

Please sign in to comment.