Skip to content
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

Merged
merged 2 commits into from
Feb 19, 2025
Merged

dock: allow setting spacer tiles #1187

merged 2 commits into from
Feb 19, 2025

Conversation

khaneliman
Copy link
Contributor

@khaneliman khaneliman commented Nov 21, 2024

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.
image

@khaneliman khaneliman force-pushed the spacer branch 2 times, most recently from 2915c54 to 9c4bf62 Compare November 21, 2024 21:32
khaneliman added a commit to khaneliman/khanelinix that referenced this pull request Nov 21, 2024
@khaneliman
Copy link
Contributor Author

Sorry, forgot to update test fixture.

@khaneliman khaneliman force-pushed the spacer branch 2 times, most recently from 9a98401 to a9b0e9c Compare November 23, 2024 01:26
@khaneliman khaneliman force-pushed the spacer branch 4 times, most recently from 8ce526e to e05bd61 Compare December 2, 2024 02:39
Enzime
Enzime previously requested changes Dec 2, 2024
@khaneliman khaneliman force-pushed the spacer branch 2 times, most recently from 158701e to c5e8286 Compare December 7, 2024 18:26
@khaneliman khaneliman force-pushed the spacer branch 2 times, most recently from 5010519 to 0c9bacc Compare December 18, 2024 01:09
@khaneliman
Copy link
Contributor Author

Took me too long to realize that I didn't update my flake's usage for spacer tiles.... I was so confused.

@khaneliman
Copy link
Contributor Author

@Enzime Alright, sorry I forgot about this for a bit. Updated with last suggested changes.

apply =
let
toTile = item: if item ? app then {
tile-data = { file-data = { _CFURLString = item.app.path; _CFURLStringType = 0; }; };
Copy link
Contributor

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;
};

Copy link
Contributor Author

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...

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.

@khaneliman
Copy link
Contributor Author

@Enzime friendly ping

@khaneliman khaneliman force-pushed the spacer branch 2 times, most recently from 977c756 to 23941cc Compare January 8, 2025 03:09
@MattSturgeon
Copy link
Contributor

@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;
Copy link
Collaborator

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to break when using that.
image
image

You can create spacer tiles in the dock by passing empty tile-data with
specific tile-types
Copy link
Collaborator

@emilazy emilazy left a 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!

@emilazy emilazy dismissed Enzime’s stale review February 19, 2025 02:57

per Matrix discussion

@emilazy emilazy merged commit 6ab392f into LnL7:master Feb 19, 2025
3 checks passed
@khaneliman khaneliman deleted the spacer branch February 19, 2025 03:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants