Skip to content

About

Fast Cmd-Tab-style application switcher for Alfred — MRU order, type-to-filter, launch fallback, hide/quit, and Dock badges on icons.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

45 Commits

Folders and files

Repository files navigation

AppSwitcher icon

AppSwitcher

A fast, Cmd-Tab-style application switcher for Alfred.

Switch between your open apps in most-recently-used order — like macOS Cmd-Tab, but driven through Alfred. The previously-used app sits at the top and is pre-selected, so one keypress flips you back. Type to filter, launch apps that aren't running, and hide or quit apps without leaving the switcher. Apps with a Dock badge (e.g. NotePlan's task count) show it right on their icon.

Features

  • MRU switching — apps ordered by recent use; previous app on top for instant Cmd-Tab-style toggling.
  • Type to filter — narrow the running apps as you type.
  • Launch fallback — if nothing running matches what you typed, the switcher offers to launch a matching installed app.
  • Hide apps — ⌘ + Enter removes an app from the switcher (stored in the workflow config; un-hide there).
  • Quit apps — ⌃ + Enter quits the highlighted app.
  • Dock badges on icons — unread counts / task badges are composited onto the app icon (falls back to the title if ImageMagick isn't installed).
  • Fast — ~25 ms typical, with metadata and badges refreshed in the background.

Requirements

  • macOS with Alfred 5 and the Powerpack.
  • Optional: ImageMagick (brew install imagemagick) to render Dock badges on the icon. Without it, badges appear as Name (3) in the row title instead.

Install

  1. Download AppSwitcher.alfredworkflow from the latest release.
  2. Double-click it to import into Alfred.
  3. Open Alfred Preferences → Workflows → AppSwitcher and:
    • Double-click the Hotkey trigger and press your shortcut. Option+Tab is recommended (unused by macOS by default).
    • Make sure the Hotkey's Argument is set to None (so nothing from your selection/clipboard is passed in).

Usage

Summon with your hotkey, then:

Key Action
Enter Switch to the highlighted app
Type Filter the running apps; if none match, offer Launch <app> for installed apps
⌘ + Enter Hide the highlighted app from the switcher
⌃ + Enter (Ctrl) Quit the highlighted app (graceful — may prompt to save)

Configure hidden apps

Click the [𝗑] configuration button on the workflow:

  • Hidden apps — one app name or bundle id per line (e.g. Finder, com.apple.Spotlight). Case-insensitive. ⌘-hidden apps land in this same list, so to un-hide just remove the line.
  • Show current app — off by default, so the top item is the previous app (Cmd-Tab toggle). Turn on to also list the app you're currently in.

How it works

  • The live app set and order come from lsappinfo visibleProcessList (front-to-back z-order) on every summon, so quitting an app removes it immediately and ordering stays current.
  • The app you came from is identified reliably via Alfred's focused-app hotkey variable and dropped, so the previous app lands on top without any z-order race.
  • App metadata (bundle id, path) and Dock badges are read in a detached background process and cached, keeping the hot path around 25 ms. Badges are at most a couple of seconds stale.
  • Badge icons are composited with ImageMagick and cached per (app, count).

No background daemon, no persistent process — everything runs on summon.

Build from source

zsh build.sh        # produces dist/AppSwitcher.alfredworkflow

Development

zsh tests/test.sh   # runs the test suite (stubs lsappinfo/osascript/etc — touches no real apps)

The workflow is plain zsh under workflow/:

  • list_apps.sh — the Script Filter: builds the MRU list, filtering, launch fallback, badges.
  • activate.sh / quit.sh — activate or quit an app by bundle id.
  • hide.sh — add an app to the Hidden apps config (prefs.plist).
  • refresh.sh / badges.sh — background metadata + Dock badge snapshot.
  • info.plist — the Alfred workflow graph.

Releasing

Tag a version and push it; a GitHub Actions workflow builds the .alfredworkflow and attaches it to a GitHub Release:

git tag v1.0.0
git push origin v1.0.0

License

MIT © Tobias Mende

About

Fast Cmd-Tab-style application switcher for Alfred — MRU order, type-to-filter, launch fallback, hide/quit, and Dock badges on icons.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages