dock: allow setting tile-types

You can create spacer tiles in the dock by passing empty tile-data with
specific tile-types
This commit is contained in:
Austin Horstman 2024-11-21 15:18:31 -06:00
parent 678b22642a
commit 02ba211ea1
No known key found for this signature in database
3 changed files with 25 additions and 5 deletions

View file

@ -134,10 +134,14 @@ in {
description = ''
Persistent applications in the dock.
'';
apply = value:
if !(isList value)
then value
else map (app: { tile-data = { file-data = { _CFURLString = app; _CFURLStringType = 0; }; }; }) value;
apply =
let
tileTypes = ["spacer-tile" "small-spacer-tile"];
toSpecialTile = type: { tile-data = {}; tile-type = type; };
toAppTile = cfurl: { tile-data = { file-data = { _CFURLString = cfurl; _CFURLStringType = 0; }; }; };
toTile = s: if elem s tileTypes then toSpecialTile s else toAppTile s;
in
value: if isList value then map toTile value else value;
};
system.defaults.dock.persistent-others = mkOption {