hide-finder-trash-dock-icons
hide-finder-trash-dock-icons copied to clipboard
DockMenus.plist in not editable in MacOS 12.2
The file cannot be edited with sudo privileges
$ PL="/System/Library/CoreServices/Dock.app/Contents/Resources/DockMenus.plist"&& sudo -- defaults write $PL finder-running -array-add '<dict><key>command</key><integer>1004</integer><key>name</key><string>REMOVE_FROM_DOCK</string></dict>'
2022-07-23 15:17:38.969 defaults[66687:5083525] Could not write domain /System/Library/CoreServices/Dock.app/Contents/Resources/DockMenus.plist; exiting
Spent few hours but no luck :(
Did you try turning off SIP (System Integrity Protection)?: https://stackoverflow.com/questions/32590053/copying-file-under-root-got-failed-in-os-x-el-capitan-10-11
I haven't yet tested on macOS 12.2.
On my MacBook Air running macOS High Sierra (v10.13.6) it's essentially this to change SIP:
1.) Reboot and hold down CMD+r, go to Terminal, "csrutil disable", "reboot". 2.) Do the stuff and things. 3.) Turn SIP back on: "csrutil enable", "reboot".
I hope that helps <3.
If that helps I'll add to the README :)
@jesscxc I tried it, and it did not work :(
Turning off the SIP is relatively hard on Mac Monterey. I followed the following steps to turn it off.
- Shut down the Mac
- Press and hold the power button to access the startup settings.
- Hit options. This will take you to macOS recovery.
- Once you are in recovery, hover over the Apple logo in the menu bar and hit “STARTUP DISK” choose the one where your main OS is and restart. Keep holding the Power button until the system is off
- Press the power button and keep holding it to open recovery again, and voila, you can access “startup security utility” properly.
Ref:
- https://discussions.apple.com/thread/253397576
- https://apple.stackexchange.com/questions/431329/cant-change-system-security-settings-in-new-macbook-pro-m1-monterey-startup-rec
I was successfully able to disable the SIP. In normal mode, csrutil status
reported disable
.
However, sudo vim /System/Library/CoreServices/Dock.app/Contents/Resources/DockMenus.plist
can only open in RO mode.
That's a bummer.
@ivorynoise It turns out after MacOS Catalina the system files are stored on a whole different volume which is read-only, so there is no way (even with disabling SIP, which I also tried) to edit any of the files there...
@benjaminhera that's a restriction from MacOS. Marking this issue as closed.