Skip to content

Commit

Permalink
feat: add COSMIC panel configuration support (#4)
Browse files Browse the repository at this point in the history
- Add panel configuration module with comprehensive settings
- Support panel positioning, autohide behavior, and appearance
- Add plugin configuration for center and wings sections
- Include panel size and output display options
- Implement panel background and opacity controls
  • Loading branch information
HeitorAugustoLN authored Dec 24, 2024
1 parent 5b3a5ca commit af18536
Show file tree
Hide file tree
Showing 3 changed files with 306 additions and 18 deletions.
42 changes: 24 additions & 18 deletions lib/types.nix
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,9 @@
"one of the following RON enum variants: ${lib.concatMapStringsSep ", " show variants}";
descriptionClass = if builtins.length variants < 2 then "noun" else "conjunction";
functor = lib.defaultFunctor name // {
payload = { inherit variants; };
payload = {
inherit variants;
};
type = payload: ronEnum' payload.variants;
binOp = a: b: { variants = lib.unique (a.variants + b.variants); };
};
Expand Down Expand Up @@ -159,7 +161,7 @@
value = { };
};
};
merge = loc: defs: {
merge = _loc: defs: {
__type = "map";
value = builtins.foldl' (first: def: lib.recursiveUpdate first def.value.value) { } defs;
};
Expand Down Expand Up @@ -200,24 +202,24 @@
functor = lib.defaultFunctor name // {
wrapped = elemType;
};
getSubModules = elemType.getSubModules;
inherit (elemType) getSubModules;
getSubOptions = prefix: elemType.getSubOptions (prefix ++ [ "<name>" ]);
merge =
loc: defs:
let
pushPositions = map (
def:
builtins.mapAttrs (n: v: {
builtins.mapAttrs (_n: v: {
inherit (def) file;
value = v;
}) def.value.value
);
in
{
__type = "map";
value = builtins.mapAttrs (n: v: v.value) (
lib.filterAttrs (n: v: v ? value) (
lib.zipAttrsWith (
value = builtins.mapAttrs (_n: v: v.value) (
lib.filterAttrs (_n: v: v ? value) (
builtins.zipAttrsWith (
name: defs: (lib.mergeDefinitions (loc ++ [ name ]) elemType defs).optionalValue
) (pushPositions defs)
)
Expand Down Expand Up @@ -298,14 +300,14 @@
functor = lib.defaultFunctor name // {
wrapped = elemType;
};
getSubModules = elemType.getSubModules;
inherit (elemType) getSubModules;
getSubOptions = prefix: elemType.getSubOptions (prefix ++ [ "<name>" ]);
merge =
loc: defs:
let
pushPositions = map (
def:
builtins.mapAttrs (n: v: {
builtins.mapAttrs (_n: v: {
inherit (def) file;
value = v;
}) def.value.value
Expand All @@ -330,9 +332,9 @@
else
first.value.__name
) (builtins.head defs) (builtins.tail defs);
value = builtins.mapAttrs (n: v: v.value) (
lib.filterAttrs (n: v: v ? value) (
lib.zipAttrsWith (
value = builtins.mapAttrs (_n: v: v.value) (
lib.filterAttrs (_n: v: v ? value) (
builtins.zipAttrsWith (
name: defs: (lib.mergeDefinitions (loc ++ [ name ]) elemType defs).optionalValue
) (pushPositions defs)
)
Expand Down Expand Up @@ -395,7 +397,7 @@
functor = lib.defaultFunctor name // {
wrapped = elemType;
};
getSubModules = elemType.getSubModules;
inherit (elemType) getSubModules;
getSubOptions = prefix: elemType.getSubOptions (prefix ++ [ "<name>" ]);
merge = loc: defs: {
__type = "optional";
Expand Down Expand Up @@ -436,7 +438,7 @@
value = [ ];
};
};
merge = loc: defs: {
merge = _loc: defs: {
__type = "tuple";
value = builtins.concatLists (map (x: x.value.value) defs);
};
Expand Down Expand Up @@ -481,7 +483,9 @@
} with a value";
descriptionClass = if builtins.length variants < 2 then "noun" else "conjunction";
functor = lib.defaultFunctor name // {
payload = { inherit variants; };
payload = {
inherit variants;
};
type = payload: ronTupleEnum' payload.variants;
binOp = a: b: { variants = lib.unique (a.variants + b.variants); };
};
Expand Down Expand Up @@ -533,14 +537,16 @@
} value";
descriptionClass = if builtins.length variants < 2 then "noun" else "conjunction";
functor = lib.defaultFunctor name // {
payload = { inherit elemType variants; };
payload = {
inherit elemType variants;
};
type = payload: ronTupleEnumOf' payload.elemType payload.variants;
binOp = a: b: {
variants = lib.unique (a.variants + b.variants);
elemType = a.elemType.typeMerge b.elemType.functor;
};
};
getSubModules = elemType.getSubModules;
inherit (elemType) getSubModules;
getSubOptions = prefix: elemType.getSubOptions (prefix ++ [ "*" ]);
merge = loc: defs: {
__type = "enum";
Expand Down Expand Up @@ -622,7 +628,7 @@
functor = lib.defaultFunctor name // {
wrapped = elemType;
};
getSubModules = elemType.getSubModules;
inherit (elemType) getSubModules;
getSubOptions = prefix: elemType.getSubOptions (prefix ++ [ "*" ]);
merge = loc: defs: {
__type = "tuple";
Expand Down
1 change: 1 addition & 0 deletions modules/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
in
[
./files.nix
./panels.nix
]
++ lib.foldlAttrs (
prev: name: type:
Expand Down
Loading

0 comments on commit af18536

Please sign in to comment.