Windows’ Win+R for Macos

On Windows, you press Win+R and an input box pops up where you can type any command line, hit Enter and it’ll run and the popup will be gone:

Windows Run popup screenshot

Very handy for one-off runs. For example, you’ve got Alacritty installed as a terminal binary, not as an .app and thus it’s not visible on Spotlight. To run it, you’d need a terminal app open (and not occupied) where you’d type alacritty. That’s not as convenient as just hitting Win+R, so Cmdpopup tries to replicate that feature:

Cmdpopup screenshot

How to install and configure

  1. Install Rust - https://www.rust-lang.org/tools/install
  2. Run CARGO_NET_GIT_FETCH_WITH_CLI=true cargo install --git https://git.wilem.eu/cmdpopup.git
  3. Run brew install icanhazshortcut
  4. Configure iCanHazShortcut to run cmdpopup on whatever key combo you’d like. I use Cmd+R.
  5. Try pressing the key combo, it should activate Cmdpopup.

How to use

  1. Press the shortcut configured above to activate the popup.
  2. Type in something, e.g. alacritty
  3. Hit Enter.

The popup can be closed by hitting Escape.

If nothing happens when you press Enter, means there was an error - most likely the command was not found in PATH.

Details

The input line will be parsed according to the regular Unix shell rules (see https://crates.io/crates/shell-words for exact details), which means you can use quotes to force something into a single argument and so on.

The command will be run directly, without going through a shell. However, if the command doesn’t start as absolute path, it’ll be looked up in PATH, as customary when running from a shell.

There will be no stdout/stderr output anywhere. If the command fails (it wasn’t found in PATH), there’s no visual feedback.

TODO