1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2024-12-14 11:57:34 +00:00

Merge pull request #928 from rmgpinto/persistent-others

Add persistent others to dock
This commit is contained in:
Michael Hoang 2024-05-14 12:22:58 +10:00 committed by GitHub
commit de8b0d60d6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 44 additions and 0 deletions

View file

@ -136,6 +136,19 @@ in {
else map (app: { tile-data = { file-data = { _CFURLString = app; _CFURLStringType = 0; }; }; }) value;
};
system.defaults.dock.persistent-others = mkOption {
type = types.nullOr (types.listOf (types.either types.path types.str));
default = null;
example = [ "~/Documents" "~/Downloads" ];
description = lib.mdDoc ''
Persistent folders in the dock.
'';
apply = value:
if !(isList value)
then value
else map (folder: { tile-data = { file-data = { _CFURLString = folder; _CFURLStringType = 15; }; }; }) value;
};
system.defaults.dock.show-process-indicators = mkOption {
type = types.nullOr types.bool;
default = null;

View file

@ -255,6 +255,36 @@ defaults write com.apple.dock 'persistent-apps' $'<?xml version="1.0" encoding="
</dict>
</array>
</plist>'
defaults write com.apple.dock 'persistent-others' $'<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<dict>
<key>tile-data</key>
<dict>
<key>file-data</key>
<dict>
<key>_CFURLString</key>
<string>~/Documents</string>
<key>_CFURLStringType</key>
<integer>15</integer>
</dict>
</dict>
</dict>
<dict>
<key>tile-data</key>
<dict>
<key>file-data</key>
<dict>
<key>_CFURLString</key>
<string>~/Downloads</string>
<key>_CFURLStringType</key>
<integer>15</integer>
</dict>
</dict>
</dict>
</array>
</plist>'

View file

@ -47,6 +47,7 @@
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-others = ["~/Documents" "~/Downloads"];
system.defaults.screencapture.location = "/tmp";
system.defaults.screensaver.askForPassword = true;
system.defaults.screensaver.askForPasswordDelay = 5;