5

In Ubuntu 12.04+, you can hold Super, then press 1 or 2 or 3 and so on until 0 to open or focus an application. The number corresponds to the location of the icon on the launcher from top to bottom.

In Windows 7, you can just press the Windows Logo, and 1 or 2 or 3 etc to open or focus an application on the taskbar (the number corresponding to the location on taskbar)

I'm currently using mission control workspaces to do something similar on OSX, but I'd really love it if I could number the icons on my dock instead, and be able to open/focus on an application on the dock using a keyboard shortcut.

Is there maybe something in the app store or some system preference I can tweak so I can number/add keyboard shortcuts for the icons on my dock like this?

2 Answers 2

6

I think you're looking for Snap

Snap automatically assigns keyboard shortcuts to apps pinned in your dock using a modifier key (command, option, control, or shift) and the number keys. For example, command+1 opens the 1st app in your dock, command+2 the 2nd, etc.

You don't really need to configure anything in the app. All you need to do is change the order of apps in your dock, but you always have the option of setting manual shortcuts for apps that are not on the dock.

The only problem is that it ignores Finder, so if you have Finder first, Cmd+1 for example, will open the second item in your dock.

You can choose to open with only or a combination of command, option, control and shift with number keys as the triggers for the actual app.

A screenshot I took:

enter image description here

2
  • A quick question, what happens if there are multiple Chrome windows opened on Cmd+1? Will it cycle through the opened Chrome windows like how it behaves in Windows?
    – Dev
    Commented Dec 29, 2022 at 9:31
  • Snap UI does not work on Monterey+
    – clarkttfu
    Commented Jan 6, 2023 at 8:02
1

You can also assign shortcuts to scripts like this:

tell application "System Events" to tell process "Dock"
    click UI element 1 of list 1
end tell

Or just use KeyRemap4MacBook to assign shortcuts to applications directly:

<?xml version="1.0"?>
<root>
  <vkopenurldef>
    <name>KeyCode::VK_OPEN_URL_FINDER</name>
    <url>file:///System/Library/CoreServices/Finder.app</url>
  </vkopenurldef>
  <vkopenurldef>
    <name>KeyCode::VK_OPEN_URL_ITUNES</name>
    <url>file:///Applications/iTunes.app</url>
  </vkopenurldef>
  <item>
    <name>custom</name>
    <identifer>custom</identifier>
    <autogen>__KeyToKey__ KeyCode::KEY_1, ModifierFlag::COMMAND_R | ModifierFlag::NONE, KeyCode::VK_OPEN_URL_FINDER</autogen>
    <autogen>__KeyToKey__ KeyCode::KEY_2, ModifierFlag::COMMAND_R | ModifierFlag::NONE, KeyCode::VK_OPEN_URL_ITUNES</autogen>
  </item>
</root>

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .