-
-
Notifications
You must be signed in to change notification settings - Fork 493
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dock: allow setting spacer tiles #1187
Conversation
2915c54
to
9c4bf62
Compare
Using fork until LnL7/nix-darwin#1187 merged
Sorry, forgot to update test fixture. |
9a98401
to
a9b0e9c
Compare
8ce526e
to
e05bd61
Compare
158701e
to
c5e8286
Compare
5010519
to
0c9bacc
Compare
Took me too long to realize that I didn't update my flake's usage for spacer tiles.... I was so confused. |
@Enzime Alright, sorry I forgot about this for a bit. Updated with last suggested changes. |
modules/system/defaults/dock.nix
Outdated
apply = | ||
let | ||
toTile = item: if item ? app then { | ||
tile-data = { file-data = { _CFURLString = item.app.path; _CFURLStringType = 0; }; }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe I've missed some nix-darwin style preference, but IMO this is more readable as:
tile-data.file-data = {
_CFURLString = item.app.path;
_CFURLStringType = 0;
};
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't seen any formatter configuration or documentation on formatting in this repo. So, I have no idea whether I should just format the whole file with nixfmt or just try to fit it into whats in here...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a discussion in #1054 that would be worth revisiting. I agree that a default format would be really helpful.
22c002c
to
72120b5
Compare
@Enzime friendly ping |
977c756
to
23941cc
Compare
@Enzime any chance of taking another look? 🙂 |
tile-type = if item.spacer.small then "small-spacer-tile" else "spacer-tile"; | ||
} else if item ? folder then { | ||
tile-data.file-data = { | ||
_CFURLString = "file://" + item.folder; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to use lib.escapeURL
here, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can create spacer tiles in the dock by passing empty tile-data with specific tile-types
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, thanks!
You can create spacer tiles in the dock by passing empty tile-data with specific tile-types.
Used to do this in my old dotfiles and have been meaning to upstream a change to support doing this in nix-darwin.
