Mac Widgets – Show or Hide Widgets quickly via a Keyboard Shortcut

No one gossips about other people’s secret virtues.
Bertrand Russell

Apple’s macOS allows you to show Widgets on your desktop, which is a great way to keep your calendar or todos in view during the work day. However, there are moments when you might want to quickly hide that information. After all, some information is private.

Top-left corner of my Desktop — case in point, the todos and calendar entries are private.

Unfortunately, macOS does not seem to offer a build-in keyboard shortcut, but there is a workaround.

The widget state can be changed via the macOS Terminal (thanks to https://github.com/sieren/WidgetToggler ):

defaults write com.apple.WindowManager StandardHideWidgets -int 1

1 hides the widgets, 0 shows them again.

As a terminal command is cumbersome, you can trigger show/hide widgets via a simple zsh script:

#!/bin/zsh

state=$(defaults read com.apple.WindowManager StandardHideWidgets 2>/dev/null)

if [[ "$state" == "1" ]]; then
  defaults write com.apple.WindowManager StandardHideWidgets -int 0
else
  defaults write com.apple.WindowManager StandardHideWidgets -int 1
fi

and create a simple Automator App to run that script.

Click on image to enlarge.
Click on image to enlarge.

If you save that Application (in the Application directory), you can tigger the App via Spotlight. (I have restricted Spotlight to the Applications directory as I only use it as App Launcher. If I want to find something, I use the Finder search from the current directory.)

Not the best solution, as a global keyboard shortcut would be easier. But as far as I can see that requires third-party apps. Still, it works and allows you to hide/show the widgets without taking your fingers from keyboard. Just by pressing cmd + space (set as Spotlight shortcut) and then typing «show» and pressing enter. Done in less than 2 seconds.