Skip to content

Commit

Permalink
Add appmenu widget-specific options
Browse files Browse the repository at this point in the history
  • Loading branch information
HeitorAugustoLN authored Aug 25, 2024
1 parent 0c01f98 commit 7ccd49f
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
55 changes: 55 additions & 0 deletions modules/widgets/app-menu.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{ lib, ... }:
let
inherit (import ./lib.nix { inherit lib; }) configValueType;
inherit (import ./default.nix { inherit lib; }) positionType sizeType;

mkBoolOption = description: lib.mkOption {
type = with lib.types; nullOr bool;
default = null;
example = true;
inherit description;
};
in {
appMenu = {
opts = {
position = lib.mkOption {
type = positionType;
example = { horizontal = 100; vertical = 300; };
description = "The position of the widget. (Only for desktop widget)";
};
size = lib.mkOption {
type = sizeType;
example = { width = 500; height = 50; };
description = "The size of the widget. (Only for desktop widget)";
};
compactView = mkBoolOption "Whether to show the app menu in a compact view";
settings = lib.mkOption {
type = configValueType;
default = null;
example = {
Appearance = {
compactView = true;
};
};
description = ''
Extra configuration for the widget
'';
apply = settings: if settings == null then {} else settings;
};
};

convert =
{ position
, size
, compactView
, settings
}: {
name = "org.kde.plasma.appmenu";
config = lib.recursiveUpdate {
General = lib.filterAttrs (_: v: v != null) {
inherit compactView;
};
} settings;
};
};
}
1 change: 1 addition & 0 deletions modules/widgets/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ let
};

sources = lib.attrsets.mergeAttrsList (map (s: import s args') [
./app-menu.nix
./application-title-bar.nix
./battery.nix
./digital-clock.nix
Expand Down

0 comments on commit 7ccd49f

Please sign in to comment.