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

system.defaults.dock.persistent-others doesn't work with ~ shortcut or env #1398

Open
skoblenick opened this issue Mar 24, 2025 · 1 comment

Comments

@skoblenick
Copy link

Using MacOS Nix with the configuration:

system.defaults.dock.persistent-others = ["~/Documents" "~/Downloads/file.txt"];

# or

system.defaults.dock.persistent-others = ["$HOME/Documents/"];

Doesn't work and results in a broken dock item that won't open the Documents folder. Using defaults read com.apple.dock 'persistent-others'

(
        {
        "tile-data" =         {
            "file-data" =             {
                "_CFURLString" = "file://~/Documents/";
                "_CFURLStringType" = 15;
            };
        };
        "tile-type" = "directory-tile";
    }
)

# or
(
        {
        "tile-data" =         {
            "file-data" =             {
                "_CFURLString" = "file://$HOME/Documents/";
                "_CFURLStringType" = 15;
            };
        };
        "tile-type" = "directory-tile";
    }
)

Respectively.

However, if i use the full path the Dock item works correctly.

# replacing <username> with the current user
system.defaults.dock.persistent-others = ["/Users/<username>/Documents/"];

I call this out cause your tests are using this example case here and the example in the code here. and mentioned at mynixos.

@TimoKraenzle
Copy link

This is a duplicate of #968, seems to be known for some time. Just pass your username as argument; the example should be changed.

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

No branches or pull requests

2 participants