I'd like to make a shortcut to quickly hide/show widgets on the desktop e.g. for when I'm sharing my screen.
I was able to figure out that the checkboxes in Settings are linked to the "defaults" keys com.apple.WindowManager StandardHideWidgets
and com.apple.WindowManager StageManagerHideWidgets
. Toggling the checkboxes sees the changes reflected in defaults read
, as expected. However, I don't seem to be able to do the reverse, i.e. change the setting by calling defaults write
, which is my goal. The value of the key changes, but the setting seems to be unaffected (yes, even if I restart the Dock, Finder, or WindowManager processes)
-
Maybe its another process entirely other than the Dock, Finder or WindowManager processes.– IconDaemonCommented Oct 25, 2023 at 12:34
-
Well yes of course - if it is, I don’t know how to go about identifying it and am hoping someone does. My guess was the WindowManager process since that’s its defaults domain, but I’m not sure how to proceed given that doesn’t work– CaketrayCommented Oct 25, 2023 at 15:42
Add a comment
|
1 Answer
Try using an int
instead of a boolean. This works for me:
defaults write com.apple.WindowManager StandardHideWidgets -int 0
When using Stage Manager:
defaults write com.apple.WindowManager StageManagerHideWidgets -int 0
Credit to the notes found at WidgetToggler (which is a free and open-source app I haven't tried yet).
Note: When I use this method, the widgets are hidden if there is a window in the foreground but will show when you click on (reveal) the desktop. I'm not sure how to disable them completely.