Skip to content

Commit

Permalink
dock: allow setting spacer tiles
Browse files Browse the repository at this point in the history
You can create spacer tiles in the dock by passing empty tile-data with
specific tile-types
  • Loading branch information
khaneliman committed Nov 21, 2024
1 parent 61cee20 commit 229153f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion modules/system/defaults/dock.nix
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,13 @@ in {
apply = value:
if !(isList value)
then value
else map (app: { tile-data = { file-data = { _CFURLString = app; _CFURLStringType = 0; }; }; }) value;
else map (app:
if app == "large-spacer"
then { tile-data = {}; tile-type = "spacer-tile"; }
else if app == "small-spacer"
then { tile-data = {}; tile-type = "small-spacer-tile"; }
else { tile-data = { file-data = { _CFURLString = app; _CFURLStringType = 0; }; }; }
) value;
};

system.defaults.dock.persistent-others = mkOption {
Expand Down
2 changes: 1 addition & 1 deletion tests/system-defaults-write.nix
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
system.defaults.dock.appswitcher-all-displays = false;
system.defaults.dock.autohide-delay = 0.24;
system.defaults.dock.orientation = "left";
system.defaults.dock.persistent-apps = ["MyApp.app" "Cool.app"];
system.defaults.dock.persistent-apps = ["MyApp.app" "Cool.app" "small-spacer" "large-spacer"];
system.defaults.dock.persistent-others = ["~/Documents" "~/Downloads/file.txt"];
system.defaults.dock.scroll-to-open = false;
system.defaults.finder.AppleShowAllFiles = true;
Expand Down

0 comments on commit 229153f

Please sign in to comment.