Open Docker Dashboard using keyboard shortcut

22 Views Asked by At

Mac M1, Docker version 25.0.3

I enjoy a good keyboard shortcut. The most useful of my shortcuts so far has actually turned out to be simply opening specific applications with one press: "hyperkey + V" opens VS Code, "hyperkey + t" opens terminal, etc. i have found this approach to be much more useful than using "cmd + tab" to go through the running applications because i can choose the application i want with one press regardless of where it is in the list of running applications. I achieved this using automator and keyboard>shortcuts>services. The only application that is giving me trouble is Docker. Ironically, I much prefer Docker Desktop over the CLI for viewing logs and exec shells etc. Here is my Automator application for opening Docker

launch application "Docker.app"

For all other applications like google chrome for example,

  • if the application IS NOT running it runs the application and opens a new window.
  • if the application IS running and has windows open, it activates those windows and brings them to the front.
  • if the application IS running and has no window open it opens a new window and brings it to the front.

great! this works as expected in all scenarios

with Docker:

  • if the application is NOT running, it runs docker. (my docker preferences are set to "open dashboard when docker starts") and a new docker dashboard window opens up
  • if Docker IS running, which is the vast majority of the time when i am building something, i press the keyboard shortcut and nothing happens. Docker is not activated, it is not brought to the front, and no dashboard is opened.

so i must grab my mouse and scroll to the icon in the menu bar and then click the open dashboard menu item.

you would think it would annoy me lees considering i'm about to use the GUI anyway. lol. but i really hate the two extra clicks.

  • I have tried "open -a Docker" in the terminal,
  • I have tried open "Docker.app" in spotlight
  • I have tried an apple script to click menu items
  • I have tried apple script to activate.

none of them will open a new dashboard.

let me know if you all can think of any other ways i might be able to achieve this.

0

There are 0 best solutions below