My Alfred Setup
Tags: productivity, macos, alfred
Published: 2021-02-04 12:26:30

---
title: My Alfred Setup
published: true
date: 2021-02-03 19:30:00 UTC
tags: #productivity #macOS #alfred
canonical_url: https://stefanzweifel.dev/posts/2021/02/03/my-alfred-setup
---

[Alfred](https://www.alfredapp.com) is my favourite piece of software on the Mac. It's fast. It's reliable. It's unobtrusive.

I've been using it since I started working on macOS in 2013. In this post I would like to show you how I use it, my custom workflows and some tips and tricks. (Note: You find links to used themes and wallpapers at [the end](#themes-and-wallpapers) of this article).

 ![](https://stefanzweifel.dev/assets/images/posts/20210130-my-alfred-setup/alfred-themes.jpg)
## What is Alfred?[#](#what-is-alfred "Permalink")

macOS ships with [Spotlight](https://en.wikipedia.org/wiki/Spotlight_(software)). A system wide search. In Yosemite, Apple redesigned the UI and Spotlight got a lot smarter. (You can do calculations or webs searches too).

Alfred is Spotlight on steroids. It uses Spotlight's search index to search files on your Mac, can start any of your installed apps and you can extend Alfred with custom workflows. The worfklow features become available when you upgrade and buy the "Powerpack".

With the basic summary out of the way, let's get started by replacing Spotlight with Alfred.

## Use Spotlight Keyboard Shortcut for Alfred[#](#use-spotlight-keyboard-shortcut-for-alfred "Permalink")

The first I thing I do, when installing Alfred on a Mac, is disabling the default keyboard shortcut for Spotlight (`⌘+Space`) and use it for Alfred.

To do that, open `System Preferences → Keyboard → Shortcuts`. Click on "Spotlight" and disable "Show Spotlight search".

![Screenshot of macOS System Settings.app. The keyboard shortcut setting for 'Show Spotlight search is highlighted.'](https://stefanzweifel.dev/assets/images/posts/20210130-my-alfred-setup/system-setttings-keyboard.jpg)<figcaption>Disable the "Show Spotlight search" setting to free up the `⌘+Space` keyboard shortcut</figcaption>

Open the Alfred settings and use the freed up `⌘+Space`-combination to launch Alfred.

![Screenshot of Alfred settings. The keyboard shortcut has been updated to ⌘+Space](https://stefanzweifel.dev/assets/images/posts/20210130-my-alfred-setup/alfred-keyboard-settings.jpg)<figcaption>Update the keyboard shortcut to invoke Alfred to `⌘+Space`.</figcaption>

## Custom Web Searches[#](#custom-web-searches "Permalink")

Web searches are the first powerful feature we take a closer look at. I use them everyday at work; but not necessarily to search. Let me explain:

In summary, a custom web search allows you to set up a shortcut to start a search on any website. It just passes the given search term to a URL. For example `app Tony Stark` expands to `https://example.com/search?q=Tony Stark`. So far, so good.

The way I use "web searches" in Alfred, is that my input is ususally an ID for a resource in one of my most used applications and not necessarily as a search term. Here are a few examples:

- Open the customer details page in our app. `app:customer 123` expands to `https://example.com/admin/customers/123/`.
- Open the invoice details page in our app. `app:invoice 123` would expand to `https://example.com/admin/invoices/123`. ("invoice" is a generic example and you can adapt this to any other "thing" you use at your job (posts, sale, product, …))
- Open a JIRA ticket. `jira PROJ-123` expands to `https://jira.example.com/browse/PROJ-123`.
- Quickly open a personal GitHub repository by typing `ghm repo_name`. The search url looks like this: `https://github.com/your-username/{query}`

Of course I also use it as a regular search too.Here are a few examples I use regularly. (Click "Import" to import the custom web search)

- Search [MDN Web Docs](https://developers.mozilla.org). `mdn querySelectorAll`. [Import](alfred://customsearch/Search%20MDN%20for%20%7Bquery%7D/mdn/utf8/nospace/https%3A%2F%2Fdeveloper.mozilla.org%2Fen-US%2Fsearch%3Fq%3D%7Bquery%7D)
- Search [caniuse.com](https://caniuse.com/). `can flexbox`. [Import](alfred://customsearch/Can%20I%20Use%20X%20in%20browser%20Y/can/utf8/nospace/https%3A%2F%2Fcaniuse.com%2F%23search%3D%7Bquery%7D)
- Search [caniemail.com](https://caniemail.com). `canemail grid`. [Import](alfred://customsearch/Search%20caniemail.com%20for%20%7Bquery%7D/canemail/utf8/nospace/https%3A%2F%2Fwww.caniemail.com%2Fsearch%2F%3Fs%3D%7Bquery%7D)

I also have custom searches for different ecommerce sites I regularly visit. I can type `groceries Toiletpaper` and land on the search page of the desired online shop.

But I think you get the gist: The sky is the limit!  
If you regularly go to a website and search for something or need to look up a "details page", consider creating a custom web search for it.

## Clipboard History[#](#clipboard-history "Permalink")

Copy and pasting is something I do everyday. Be it code, files, URLs, IDs or just text. Alfred ships with a clipboard manager, which allows you to paste previously copied text into your editor or email draft.

The best thing about it? It also supports images and file lists! What does this mean? Instead of just keeping track of copied text, Alfred also stores copied files and images in a buffer. You can then browse this buffer and paste text and images in any order you like.

<video loading="lazy" controls loop muted>
        <source src="https://stefanzweifel.dev/assets/images/posts/20210130-my-alfred-setup/alfred_history_compressed.mp4" type="video/mp4">
    </source></video><figcaption>This video shows, how I can copy multiple items into the clipboard history and retrieve them in different orders.</figcaption>

I've remapped the shortcut to open the Clipboard History to `⇧+⌘+C`. It's a bit more logical to me.

The clipboard history is something that takes some time to get used to. The first few days or weeks you forget, that it exists. But once you've understood it, are compfortable with it and know that it's available to you in every app, you don't wan't to miss it.

## Snippets[#](#snippets "Permalink")

Yet another powerful tool hidden behind "Features" in Alfreds settings are Snippets. As the name might suggest, in snippets you can store often used text snippets. Be it canned email responses, fake credit card numbers to test your Stripe integration, Emojis or Mac Symols like `⌘` or `⌅`.

I've updated the keyword to open the snippet search to be￼ `s`. To paste the character `→` into a document for example, I then only have to type `s right`, select the right snippet and hit enter.

### Markdown Fences[#](#markdown-fences "Permalink")

My most used snippets do not paste readable text into the currently focused editor, but rather a set of characters. Backticks or "Markdown fences" to be exact.

For 20 years now, I've used keyboards with the Swiss-German layout. To denote a word or phrase as code in Markdown, you have to enclose it in backticks (`). On the Swiss-German keyboard layout you have to hit a weird combination which gets quite annoying if you have to type it a hundred times a day. I also quickly fall out of my writing flow.  
So I've written 2 snippets to fix that.

First there is the "inline Markdown code" snippet, invoked by typing `imdc`. As the name suggests it's for highlighting code inline in a sentence (Like you've seen it scattered in the article you're reading right know). For multi-line code examples I've created a "Markdown code" snippet, invoked by typing `mdc`.

<video loading="lazy" controls loop muted>
        <source src="https://stefanzweifel.dev/assets/images/posts/20210130-my-alfred-setup/alfred_markdown.mp4" type="video/mp4">
    </source></video><figcaption>By using a snippet to create Markdown code fences, I can easly type my code examples without breaking my writing flow.</figcaption>

The best thing is, that you can use the `{cursor}` variable to automatially move the cursor between the two backticks.


### Emojis[#](#emojis "Permalink")

My biggest snippet collection is centered around emojis. Wether you love them or hate them, sometimes you use them.

Joel Califa once created an ["Emoji Snippet Pack"](http://joelcalifa.com/blog/alfred-emoji-snippet-pack/). This collection of snippets allows you to type `:v:` to get the ✌️ emoji. Since Joel released his pack, new emojis have been released, and I stepped up and created a build process to his open-sourced emoji pack ([see PR #1](https://github.com/califa/alfred-emoji-pack/pull/1)).  
However, my added build process relies on dependencies which very slowly update to newly released emojis (which is okay, as these dependencies are used for something different than a snippet pack).

That's why I've created my own project. You can find it [on GitHub](https://github.com/stefanzweifel/alfred-emoji-pack).  
Currently it's the same as the one from Joel, but written in PHP. The goal is, to switch the source for the emojis to the official list of available characters from unicode.org.  
A plus would then be to also create a new release when new emojis are being released by using GitHub Actions. I will work on that project over the next couple of weeks.

Here's a quick video on how I use the emoji snippets.

<video loading="lazy" controls loop muted>
        <source src="https://stefanzweifel.dev/assets/images/posts/20210130-my-alfred-setup/alfred_emoji.mp4" type="video/mp4">
    </source></video><figcaption>By having all emojis available as snippets, I can type them out or search them in my snippets library. No need to scroll though Apple's emoji picker.</figcaption>

### Miscellaneous Snippets[#](#miscellaneous-snippets "Permalink")

I also have snippets which actually contain text:

- Canned responses to support emails or unsolicited recruiter emails,
- Templates for certain types of notes I take
- Code snippets I regularly use
- Shortcuts for CLI actions (like ziping a folder on UNIX as I will never remember the options for `tar` 😅)

## Workflows[#](#workflows "Permalink")

Next let's cover the most famous and powerful feature of Alfred: Workflows.

Workflows allow you to write basic programs with a drag and drop editor. You define the event that triggers the workflow (a hotkey, a snippet, a file action), define its input (keyword, file filter) and then take action it (open a file, run a search or run a script).

They can wary between very simple and very complex. For example "search _this_ folder for _that_ file type and open the file in _that_ app" is quite easy to accomplish. "Search and play Spotify playlists" however is quite complex and needs a lot of scripting work.

So first I would like to show you some of my own workflows. They are quite simple but save me a couple of seconds every day.

### Open Common Folders[#](#open-common-folders "Permalink")

Eventhough Alfred comes with a backed in file browser, I often still use good old Finder.app. To get access to my most used folders quickly, I've created workflows which just open that folder:

- `downloads` opens `~/Downloads`
- `desktop` opens `~/Desktop`
- `sites` opens `~/Sites` (where all my code projects live)
- `inbox` opens my [File Inbox](https://stefanzweifel.dev/posts/2020/08/04/synology-nas-setup-2020/#folder-structure--synology-drive)

![Screenshot of the Common Folders Workflow in Alfred.](https://stefanzweifel.dev/assets/images/posts/20210130-my-alfred-setup/alfred-workflows-common-folders.jpg)<figcaption>The "Common Folders" workflow is simple but effective for navigating to most used folders quickly.</figcaption>

Workflows like these might look silly at first. But once you realize how much time you spend browsing Finder – by mouse or keyboard – you might change your mind.

### File Filter Workflows[#](#file-filter-workflows "Permalink")

Not used that much anymore but still handy, is my collection of file filters. I've created several workflows to search for files with a certain extension or just folders in a directory and pass that file to an application.

<video loading="lazy" controls loop muted>
        <source src="https://stefanzweifel.dev/assets/images/posts/20210130-my-alfred-setup/alfred_phpstorm.mp4" type="video/mp4">
    </source></video><figcaption>This video shows, how I can quickly search for a folder in my `~/Sites` directory and open it in PhpStorm.</figcaption>

For example, I can type `phps laravel-stats` to open [laravel-stats](https://github.com/stefanzweifel/laravel-stats) in [PhpStorm](https://www.jetbrains.com/phpstorm/).

Or I can type `unzip backup` and Alfred will search for `.zip` files which have "backup" in their name. Selecting the zip file will open it in [The Unarchiver](https://apps.apple.com/ch/app/the-unarchiver/id425424353?l=en&mt=12).

![Screenshot of the File Filters Workflow in Alfred.](https://stefanzweifel.dev/assets/images/posts/20210130-my-alfred-setup/alfred-workflows-file-filters.jpg)<figcaption>With "File Filters" I can open any Markdown file in my favourite app.</figcaption>

Here's a quick tutorial on how to set this up yourself:

1. Create a new blank workflow
2. Add a new "File Filter" input
3. Set a keyword, title and subtext that matches what you want to do.
4. Drag the file types you want to search for into the "File Types" box. For example, if you want to search for Markdown files, drag a `.md`-file into it.
5. Then create and connect a "Open File" Action with your File Filter.
6. Drag the app you want to open the files in, in the right most box
7. Done 🎉

You can get quite creative. As you can see from the screenshot above, I've also created workflows to open Markdown files in iA Writer and Sketch files in Sketch.app.

### NAS Managment[#](#nas-managment "Permalink")

I own a Synology NAS, for which I also created a few workflows. (Read more about my NAS setup [here](https://stefanzweifel.dev/posts/2020/08/04/synology-nas-setup-2020/)).

Collected under the name "Relaxo" (German name for the Snorlax Pokemon) I've created several workflows for interactinve with the NAS:

- I can wake it up (in case it's not running)
- Open the web-based control center
- Open the Plex web player
- Or mount NAS disks to macOS

![Screenshot of the Relaxo/Snorlax Workflow to manage my Synology NAS.](https://stefanzweifel.dev/assets/images/posts/20210130-my-alfred-setup/alfred-workflows-relaxo.jpg)<figcaption>This workflow to manage my Synology NAS gives me quick access to the management console, to Plex and let's me boot the NAS in case it's offline.</figcaption>

If you want to build something like this your self, here are a few tricks:

You can boot the NAS by installing [wakeonlan](https://formulae.brew.sh/formula/wakeonlan) on your Mac and running the following script in Alfred. (`$mac_address` is a variable for the MAC address of your NAS. You also need to enable wakeonlan explicitly in the settings of the NAS).


```
/usr/local/bin/wakeonlan -p 9 $mac_address;
```

Do open the dialog to select to be mounted disks, use the "Open URL" action and use `afp://$name_of_your_nas.local` as the URL.

### Zettelkasten[#](#zettelkasten "Permalink")

I try use the [Zettelkasten](https://en.wikipedia.org/wiki/Zettelkasten) method to store my notes. This means that is store all my notes as plain text files in a single folder and follow a common schema.

To create a new Zettelkasten note I naturally created a workflow. With `z:new The Old Man and the Sea - Review` Alfred creates a new note with the title "The Old Man and the Sea - Review", creates a unique ID for the note and stores it in the file and opes the note in iA Writer.

The other side of the coin is the `z:find` workflow. It consists of a file filter which searches for for `.txt` and `.md` files in my Zettelkasten folder. Matching files are opened in iA Writer.

I'm still growing into this Zettelkasten methodology, so I won't go detail here. If you're interested in it, I recommend reading the book [How to Take Smart Notes](https://takesmartnotes.com).

### Miscellaneous[#](#miscellaneous "Permalink")

Not everything can be put into a neat category. Here are a few other custom made workflows I regularly use.

#### `ngrok 8000`[#](#ngrok-8000 "Permalink")

This workflow opens a new terminal tab and creates a new [ngrok](https://ngrok.com) tunnel for port `8000`. After a 1 second delay it opens the forwarding URL in the default browser. In the terminal script in the Alfred worfklow, I define my region, desired subdomain and auth token, to get a predictable URL I can open in the browser.

#### `b:new Title of Article`[#](#bnew-title-of-article "Permalink")

Workflow used to create new blog posts. The input is the title of the blog post. Alfred slugifies it, prepends a timestamp, stores the file at the right place and opens the file in Sublime Text.

#### `done`[#](#done "Permalink")

At the end of the workday I run `done`. It closes all apps, empties the trash and shuts down my Mac. Simple as that.

![Screenshot of my Done Workflow.](https://stefanzweifel.dev/assets/images/posts/20210130-my-alfred-setup/alfred-workflows-done.jpg)<figcaption>Ending my work day by running `done` closes all apps and shuts down my Mac.</figcaption>

### Third Party Workflows[#](#third-party-workflows "Permalink")

Over the years, a huge community has formed around building very powerful workflows. Here are a few selected workflows I really enjoy.

- [DAS.Units](http://units.dnsu.ch): A powerful unit converter that support natural language input. For example I can type `units 1 usd in chf` to get the current exchange rate.
- [Kill](https://github.com/ngreenstein/alfred-process-killer): Search for a running process on your Mac and kill it.
- [Dark Mode](https://github.com/sindresorhus/alfred-dark-mode#): Switch between light and dark mode on macOS
- [TablePlus](https://github.com/chrisrenga/alfred-tableplus): Search through TablePlus connections and opens them.
- [Laravel Docs](https://github.com/tillkruss/alfred-laravel-docs): Search the Laravel documentation.
- [Tailwind Docs](https://github.com/clnt/alfred-tailwindcss-docs): Search the Tailwind CSS documentation.
- [PHP Docs](https://github.com/billrobclark/alfred-phpdoc-search): Search the php.net documentation.
- [Vue Docs](https://github.com/vmitchell85/alfred-vuejs-docs): Search the Vue.js documentation.

There are countless workflows out there. If you regularly use a particular tool or website, I would suggest investing some time and search for workflows on the internet. If you don't find one, why not create your own and share it with the world?

## Even more Features 🤪[#](#even-more-features- "Permalink")

Alfred comes with even more features than I already mentioned above. For example it comes with an integration with the Dictionary.app that ships with macOS. With `define Anubis` or `spell necessary` you get word definitions and spelling suggestions.

Or the "System" panel in Alfreds settings. Wether it's changing the audio volume, ejecting mounted disks, restarting the Mac, starting the screen saver or quitting or hiding a specific app; there's a keyword for everything.

Tip: Add your remote TimeMachine drive to the exclude-list for the Eject feature. That way, you're not accidentally ejecting the disk while TimeMachine makes a backup and you're running `ejectall`.

The cherry on top it all is the sync feature. Under `Settings → Advanced` you can define a custom storage location for all preferences. The folder can live on iCloud, Dropbox, or on any other sync service. This way, you can use the same settings on many Macs.

## Big Little Design Details[#](#big-little-design-details "Permalink")

Besides the performance and flexibility of Alfred, I love it's attention to little design details.

For example: the update indicator. Instead of blocking me from using the app by showing a modal window – like every other app these days does – Alfred displays a small update indicator below the search input.

![Screenshot of Alfred with an active update indicator.](https://stefanzweifel.dev/assets/images/posts/20210130-my-alfred-setup/alfred-updater.png)<figcaption>Never versions of Alfred display the update indicator in a full span design. Unfortunately I couldn't get an up-to-date screenshot.</figcaption>

It's unobtrusive, fits in the design well and allows me to do the update when I want to. The app doesn't dictate it to me.

## Outro[#](#outro "Permalink")

Phew, that was a lot to take in! Thanks for reading so far.

I hope this post gave you some inspiration to what's possible with Alfred.  
If you installed Alfred a while a go and felt, that it's the same as Spotlight, I hope this post challenged that view. And that you give it a try again!

If you never heard of Alfred before and are now eager to test it out, go give it a shot and [download it](https://www.alfredapp.com) for free.

If you have questions about this setup, critiques or want to share your own setup, reach out to me via email or Twitter.

## Themes and Wallpapers[#](#themes-and-wallpapers "Permalink")

As mentioned at the beginning of the article, here are links to the Alfred Themes and the wallpapers I'm using on my Mac.

- Light Alfred Theme: [BigSur Light](https://www.alfredapp.com/extras/theme/cXTxgwh3R9/)
- Dark Alfred Theme: [BigSur Dark](https://www.alfredapp.com/extras/theme/Ss2UzVpTLe/)
- [Aqueux](https://hector.me/aqueux) wallpaper collection by [Hector Simpson](https://hector.me)