<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xml:base="https://bjorn.now/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Alfredapp on bjorn.now</title><link>https://bjorn.now/tags/alfredapp/</link><description>Recent content in Alfredapp on bjorn.now</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Tue, 16 Apr 2024 12:30:00 +0800</lastBuildDate><atom:link href="https://bjorn.now/tags/alfredapp/feed.xml" rel="self" type="application/rss+xml"/><item><title>Day-to-day automation using Alfred on your Mac — reducing TOIL outside of your DevOps practice</title><link>https://bjorn.now/blog/2024/04/15/day-to-day-automation-using-alfred/?utm_medium=feed</link><pubDate>Mon, 15 Apr 2024 19:15:00 +0800</pubDate><guid>https://bjorn.now/blog/2024/04/15/day-to-day-automation-using-alfred/</guid><description>I try to be aware of where I have friction in my day-to-day when working at my computer, keeping an eye out for TOIL to remove. Whether it’s from manually repeated actions, or from differing behaviors across apps and services I use. When I identify any of these I try to spend some small amount of time automating or changing how I work to improve.
All of these things don’t necessarily make a lot of sense from how much time I save, but, it also makes me happy to spend a bit of time improving my environment, and spending a bit of time to make me happy is good enough for me.</description><content:encoded><![CDATA[<p>I try to be aware of where I have friction in my day-to-day when working at my
computer, keeping an eye out for <a href="https://sre.google/sre-book/eliminating-toil/">TOIL to remove.</a> Whether it&rsquo;s from
manually repeated actions, or from differing behaviors across apps and services
I use. When I identify any of these I try to spend some small amount of time
automating or changing how I work to improve.</p>
<p>All of these things don&rsquo;t necessarily make a lot of sense from how much time I
save, but, it also makes me happy to spend a bit of time improving my
environment, and spending a bit of time to make me happy is good enough for me.</p>
<p>I view doing these kinds of small workflow improvements like a <a href="https://en.wikipedia.org/wiki/Kata#Outside_martial_arts">kata</a> because it
improves my automation/scripting skills and encourages me to think about how I
work. I usually give myself 10-20m to try and make these kinds of improvements
just so I know how much time to spend. Just don&rsquo;t go overboard. XKCD, as always,
have a comic to illustrate the downside of going too far. 🙂</p>
<p><a href="https://xkcd.com/1319"><img src="https://imgs.xkcd.com/comics/automation.png" alt="&lsquo;Automating&rsquo; comes from the roots &lsquo;auto-&rsquo; meaning &lsquo;self-&rsquo;, and &lsquo;mating&rsquo;, meaning &lsquo;screwing&rsquo;.&quot;"></a></p>
<h2 id="what-is-alfred-and-why-is-it-an-app-im-focusing-on">
  What is Alfred and why is it an app I&rsquo;m focusing on?
  <a href="#what-is-alfred-and-why-is-it-an-app-im-focusing-on" class="heading-anchor" aria-label="Direct link to What is Alfred and why is it an app I&rsquo;m focusing on?"><span aria-hidden="true">#</span></a>
</h2>
<p><a href="https://alfredapp.com/">Alfred</a> is an application launcher but oh-so-much-more. It connects with macOS
and the Workflows contains a lot of extensions that allow you to interact with
all kinds of programs, websites, etc.</p>
<p>A big part of what Alfred has helped me create is a more unified experience
across the apps and websites I use. I have moved some operations that behave
differently in different apps into Alfred because then I can focus on what I
need to do and then use Alfred to provide consistency (and as I&rsquo;ve
been told, &ldquo;consistency is good even outside the bathroom&rdquo;).</p>
<p>Now, let&rsquo;s look at how I use Alfred.</p>
<h2 id="built-in-functionality">
  Built-in functionality
  <a href="#built-in-functionality" class="heading-anchor" aria-label="Direct link to Built-in functionality"><span aria-hidden="true">#</span></a>
</h2>
<p>These are features that don&rsquo;t require anything extra to install and use.</p>
<h3 id="open-an-app">
  Open an app
  <a href="#open-an-app" class="heading-anchor" aria-label="Direct link to Open an app"><span aria-hidden="true">#</span></a>
</h3>
<p>Alfred&rsquo;s starter feature is the application launcher, and it means you summon it
with a keybinding and type the name of the app you want to start and voilà.
I have bound the keyboard shortcut to <code>cmd+space</code> and replaced the built-in
Spotlight search.</p>
<figure><img src="/img/2024/04/15/01-open-app.png"
    alt="Opening Firefox in Alfred">
</figure>

<h3 id="spell--define">
  Spell / define
  <a href="#spell--define" class="heading-anchor" aria-label="Direct link to Spell / define"><span aria-hidden="true">#</span></a>
</h3>
<p>There are certain words I rarely get right (continuous) and some
words are spelled very differently from how they sound. Summon Alfred and
<code>spell &lt;word&gt;</code> and you&rsquo;ll have suggestions that often will go right. And if
you don&rsquo;t find it, replace <code>spell</code> with <code>google</code> and see if Google knows
better. Hit enter to copy the correct spelling to the clipboard.</p>
<figure><img src="/img/2024/04/15/02-spell-continuous.png"
    alt="Finding the correct spelling of continuus">
</figure>

<p>And <code>define</code> is the same thing but for dictionary lookup because you have some
word you&rsquo;re unsure what it means, or because you&rsquo;re wondering if someone was
trying to call you something you with some subtle nuance to a word. 😉
Hit enter to open the definition in macOS&rsquo;s dictionary app.</p>
<figure><img src="/img/2024/04/15/03-define-laggard.png"
    alt="Define &#39;laggard&#39;">
</figure>

<h3 id="calculator">
  Calculator
  <a href="#calculator" class="heading-anchor" aria-label="Direct link to Calculator"><span aria-hidden="true">#</span></a>
</h3>
<p>You can give it an expression and when you hit enter the result goes into the
clipboard. I often end up using this instead of opening a Python console on the
CLI.</p>
<figure><img src="/img/2024/04/15/04-calculator.png"
    alt="Adding some numbers together">
</figure>

<h3 id="custom-web-search">
  Custom web search
  <a href="#custom-web-search" class="heading-anchor" aria-label="Direct link to Custom web search"><span aria-hidden="true">#</span></a>
</h3>
<p>A custom web search allow you to quickly open a web browser at a
particular website with whatever value you&rsquo;ve typed into Alfred which <em>doesn&rsquo;t
have to be a search engine or even a search page.</em></p>
<p>To configure a custom web search summon Alfred and hit <code>cmd+,</code> to open
the settings page. Go into the <code>Features</code> tab and click on <code>Web Search</code>.</p>
<figure><img src="/img/2024/04/15/05-web-search-listing.png"
    alt="Alfred&#39;s setting Features -&gt; Web Search highlighted">
</figure>

<p>Some example search engines I have made:</p>
<ul>
<li>Jira: <code>https://jira.example.com/browse/{query}</code>
<ul>
<li>This isn&rsquo;t a search but rather the view this ticket. Because I often get a
ticket id (either from a commit message or someone rattling it off in a
meeting) and this way I can open it quickly</li>
</ul>
</li>
<li>Confluence: <code>https://confluence.example.com/dosearchsite.action? queryString={query}</code></li>
<li>Wordnik: <code>https://wordnik.com/words/{query}</code>
<ul>
<li>So I can find synonyms and other alternatives for words. Often use this when
I want to find a good name for something which has been inspired
by <a href="https://signalvnoise.com/svn3/hunting-for-great-names-in-programming/">Hunting for great names in programming</a>.</li>
</ul>
</li>
<li>Pypi: <code>https://pypi.org/project/{query}</code>
<ul>
<li>To look up python packages</li>
</ul>
</li>
</ul>
<figure><img src="/img/2024/04/15/06-web-search-example-config.png"
    alt="Example setup of the Confluence search engine">
</figure>

<h2 id="working-with-other-applications">
  Working with other applications
  <a href="#working-with-other-applications" class="heading-anchor" aria-label="Direct link to Working with other applications"><span aria-hidden="true">#</span></a>
</h2>
<p>Alfred has ended being the tool that brings my apps to focus and smoothes
over differences between apps.</p>
<h3 id="give-my-most-common-apps-a-keybinding">
  Give my most common apps a keybinding
  <a href="#give-my-most-common-apps-a-keybinding" class="heading-anchor" aria-label="Direct link to Give my most common apps a keybinding"><span aria-hidden="true">#</span></a>
</h3>
<p>Instead of <code>cmd+tab</code> between the various apps I&rsquo;m using I have bound specific
keybindings to my most used app, so I can quickly swap between
them. <a href="https://dev.to/rstacruz/switching-apps-slow-down-my-productivity-and-how-i-fixed-it-2anb">Hat tip to Rico Sta. Cruz</a>
who blogged about this a couple of years ago and who I picked it up from.</p>
<p>The big benefit I have found here is just the ease of being mid-thinking and
wanting to switch back to another app, whether it&rsquo;s to jot down a quick note, to
finish that Regex you were visualizing on <a href="https://regex101.com/">Regex 101</a>, or
to get back to Slack to paste that thing your colleague asked for. It feels so
seamless compared to tabbing between.</p>
<p>This is using <a href="https://www.alfredapp.com/workflows/">Alfred&rsquo;s Workflows</a>, and
they&rsquo;re part of their advanced set of options. You can do keybindings that work
across all of macOS as well as actions based on what you&rsquo;re typing.</p>
<figure><img src="/img/2024/04/15/07-app-shortcuts.png"
    alt="The custom app shortcuts workflow">
</figure>

<h3 id="spotify-controller">
  Spotify controller
  <a href="#spotify-controller" class="heading-anchor" aria-label="Direct link to Spotify controller"><span aria-hidden="true">#</span></a>
</h3>
<p>I have been using these keybindings since before Alfred, in Quicksilver, and
there are other workflows for Spotify but since I had these I never bothered
installing anything else.</p>
<p>The cool extra in this workflow is that I added a keyword to open the
current playing song on <a href="https://genius.com">Genius.com</a> because I like
reading the lyrics.</p>
<p>This is an example of something where the automation is <em>far from necessary,</em>
but, I enjoyed adding it. It&rsquo;s something I do every other week and knowing I
can just go straight into the song nearly every time is great.</p>
<figure><img src="/img/2024/04/15/08-spotify-keybindings.png"
    alt="Spotify keybinding and keyword configuration">
</figure>

<p>My <a href="https://github.com/gaqzi/alfred-workflows/blob/master/Spotify%20keyboard%20shortcuts.alfredworkflow">Spotify workflow</a> is on Github if you want to install it, or <a href="https://gist.github.com/gaqzi/b3de88050bf1caaf8d2661233b51a1ae">here&rsquo;s a gist</a>
if you&rsquo;re just curious how I made &ldquo;open on genius.&rdquo;</p>
<h3 id="global-microphone-muteunmute-shortcuts">
  Global microphone mute/unmute shortcuts
  <a href="#global-microphone-muteunmute-shortcuts" class="heading-anchor" aria-label="Direct link to Global microphone mute/unmute shortcuts"><span aria-hidden="true">#</span></a>
</h3>
<p>I regularly use Google Meet, Slack, and Zoom for talking with people, and these
apps all use different shortcuts to mute. So instead of keeping the app
focused and remembering the various shortcuts I now just leave myself unmuted
everywhere and directly mute/unmute the OS through Alfred. My mic has a visual
indicator when it&rsquo;s on. +I have a notification posted, so I can see the current
status on the screen.</p>
<p>As I started using this workflow I realized that sometimes the microphone
bugs out but swapping it between the built-in and back will fix it. So after
a while I made a script to help swap as well.</p>
<p>And finally, I realized that sometimes my virtual soundcard which removes
background noise (<a href="https://krisp.ai">krisp.ai</a>) hangs and needs to be
restarted, so another keybinding to quickly restart the soundcard.</p>
<p>The only downside of this workflow is that others can&rsquo;t as clearly see when
I want to speak by unmuting myself in the current app, so in those rare cases
I&rsquo;ll use the mute in the app itself. Because optimizing my workflow
shouldn&rsquo;t come at the pain of everyone else, we live in a society. 🙂</p>
<figure><img src="/img/2024/04/15/09-mic-switch.png"
    alt="The mic switch workflow setup">
</figure>

<p>This <a href="https://github.com/gaqzi/alfred-workflows/blob/master/Toggle%20mute%20mic.alfredworkflow">mute/unmute workflow</a> is available on Github,
and <a href="https://gist.github.com/gaqzi/f299047706c10b2616ba15c94cabf1fe">here&rsquo;s a gist</a> if you want to see the toggle code. My
dotfiles got the <a href="https://github.com/gaqzi/conf/blob/master/bin/swap-mic-input">swap mic script</a> and the <a href="https://github.com/gaqzi/conf/blob/master/bin/%2Crestart-krisp">restart krisp script</a>.</p>
<h2 id="improvement-to-my-day-to-day-workflow">
  Improvement to my day-to-day workflow
  <a href="#improvement-to-my-day-to-day-workflow" class="heading-anchor" aria-label="Direct link to Improvement to my day-to-day workflow"><span aria-hidden="true">#</span></a>
</h2>
<h3 id="text-replacement--snippets">
  Text replacement / snippets
  <a href="#text-replacement--snippets" class="heading-anchor" aria-label="Direct link to Text replacement / snippets"><span aria-hidden="true">#</span></a>
</h3>
<p>Snippets are short pieces of text that expand into something else. It can be
a static string, or it can be dynamic and I use both kinds as I work. For me
they fall into these categories</p>
<ol>
<li>&ldquo;Named paste&rdquo;, things that are hard to remember or unwieldy and are now not</li>
<li>Dynamic replacement, something that follows a pattern and I want to swap
between. Generally these use the clipboard</li>
<li>Generated inputs, I need the current time in a specific format or some
other piece of data</li>
</ol>
<p>You configure snippets by summoning Alfred and hitting <code>cmd+,</code> which opens
Settings, then go into Features -&gt; Snippets. Snippets work by specifying a
keyword, in my default bundle I require that my keywords are prefixed with <code>\\</code>,
meaning that Alfred will expand my snippets if it sees <code>\\&lt;keyword&gt;</code> and with
the example keyword <code>exp</code> you&rsquo;d then type <code>\\exp</code> to add it. If you need to type
the exact string for some reason it&rsquo;s easiest to add a space somewhere before
you type the last character and then go back and remove it.</p>
<figure><img src="/img/2024/04/15/11-snippets-config.png"
    alt="How to view or create snippets">
</figure>

<p>My trigger for creating a snippet is finding that I keep typing or
pasting the same thing again and again.</p>
<p>Let&rsquo;s look at how I use them in a couple of different places.</p>
<h4 id="gmail">
  GMail
  <a href="#gmail" class="heading-anchor" aria-label="Direct link to GMail"><span aria-hidden="true">#</span></a>
</h4>
<p>Finding emails from &ldquo;unusual senders:&rdquo; I label the majority of emails I get
at work as they are notifications or otherwise automated emails. So if I get
something that isn&rsquo;t labeled it&rsquo;s probably a human or something I need to
look into, and it can sometimes get hidden in a sea of everything else.</p>
<p><code>&lt;prefix&gt;gmailn</code> in the search bar turns into <code>is:inbox is:unread has:nouserlabels</code> which only shows unread emails in the inbox which doesn&rsquo;t
have a label.</p>
<p>When I&rsquo;m processing my labels, which are effectively buckets of things to do,
I often go into a label and want to see only the unread items, so I can open
the first and then go through them one-by-one. So open the label, focus on
the search bar, and type in <code>&lt;prefix&gt;unr</code> to give me <code>is:unread</code> and then
get to that focus.</p>
<h4 id="jira-tickets">
  Jira tickets
  <a href="#jira-tickets" class="heading-anchor" aria-label="Direct link to Jira tickets"><span aria-hidden="true">#</span></a>
</h4>
<p>If I&rsquo;m writing a message on Slack and I need to reference a ticket I think
it&rsquo;s nice to give a link even if I only have the jira ticket ID, so I made a
snippet that adds the current clipboard item at the end of my company&rsquo;s Jira
instance in a Markdown link. Now it looks nice where markdown is and the
other person doesn&rsquo;t have to open it up themselves.</p>
<p>Copy <code>WRK-123</code> and then type <code>&lt;prefix&gt;jiramd</code> which replaces it with
<code>[WRK-123](https://jira.deliveryhero.com/browse/WRK-123)</code>.</p>
<p>The Alfred snippet configuration</p>
<div class=" copy-enabled">
  <pre tabindex="0"><code>[{clipboard:trim}](https://jira.example.com/browse/{clipboard:trim})</code></pre>
</div>
<figure><img src="/img/2024/04/15/12-snippet-jiramd.png"
    alt="Configuring the jiramd snippet in Alfred">
</figure>

<h4 id="roam-research">
  Roam Research
  <a href="#roam-research" class="heading-anchor" aria-label="Direct link to Roam Research"><span aria-hidden="true">#</span></a>
</h4>
<p>Roam is my notetaking app and where most of my thinking happen and I have a
whole slew of replacements for how I work with Roam Research and most of them
are to help me keep my workflow consistent (using the right tags)
and to make common actions easier and faster.</p>
<ul>
<li><code>&lt;prefix&gt;rts</code> turns into the current time in bold since I practice
interstitial journaling. Example <code>**15:03**</code>. Snippet configuration: <code>** {time:short}**</code></li>
<li><code>&lt;prefix&gt;b&lt;shortcode&gt;</code> for how I bucket tasks so when I spend time on a
particular bucket I can find the things I need to do. I.e. my bucket  &ldquo;Life in
Production&rdquo; (on-call, observability, continuous delivery, etc.) is prefixed
with <code>&lt;prefix&gt;bl</code> and that turns into <code>[🥬]([[Bucket/Life in Production]])</code></li>
<li><code>&lt;prefix&gt;&lt;INITIALS&gt;</code> to turn into the name of my most frequent
collaborators at work, so I can tag what I&rsquo;ve said to them or a task we
need to do.</li>
</ul>
<h3 id="emoji-search">
  Emoji search
  <a href="#emoji-search" class="heading-anchor" aria-label="Direct link to Emoji search"><span aria-hidden="true">#</span></a>
</h3>
<p>Spending a lot of time communicating across continents involves timezones
and people rarely hearing your voice, so I have gotten used to peppering my
inputs with emojis to help since it&rsquo;s so easy to come off sounding like an
ass otherwise.</p>
<p>And because some websites or applications don&rsquo;t have a good search for
emoji and this way I only have to learn one keyboard shortcut and normalize it
across places. This way I don&rsquo;t have to remember how Slack named this emoji vs.
Miro vs. Google Docs vs. Confluence vs. other random website. I just learn it in
Alfred and then paste it straight into the textbox I wanted.</p>
<figure><img src="/img/2024/04/15/10-search-emoji.png"
    alt="Searching for the rocket emoji">
</figure>

<p>This is an external Workflow made by <a href="https://github.com/jsumners">James Sumners</a>, and you can download it
from the <a href="https://github.com/jsumners/alfred-emoji">workflow&rsquo;s Github page.</a></p>
<h3 id="generate-uuids-on-the-fly">
  Generate uuids on the fly
  <a href="#generate-uuids-on-the-fly" class="heading-anchor" aria-label="Direct link to Generate uuids on the fly"><span aria-hidden="true">#</span></a>
</h3>
<p>As I was writing the tying it up section I realized that I had a recent pain
which where I kept jumping between apps to create new UUIDs. I was running
the following command on the CLI and then pasting it into some yaml files in
my editor.</p>
<div class=" copy-enabled">
  <div class="highlight"><pre tabindex="0" class="chroma"><code class="language-shell" data-lang="shell"><span class="line"><span class="cl">uuidgen <span class="p">|</span> tr <span class="s1">&#39;[:upper:]&#39;</span> <span class="s1">&#39;[:lower:]&#39;</span> <span class="p">|</span> tr -d <span class="s1">&#39;\n&#39;</span> <span class="p">|</span> pbcopy</span></span></code></pre></div>
</div>
<p>So I instead created a new workflow that is triggered by a snippet that runs
this for me.</p>
<figure><img src="/img/2024/04/15/15-snippet-uuidgen.png"
    alt="Configuring the uuidgen snippet">
</figure>

<p><strong>Note:</strong> To make it behave just like a regular snippet you need to
configure the <em>Copy to clipboard</em> output to <code>Automatically paste to the frontmost app</code> and <code>Mark item as transient in clipboard</code>.</p>
<figure><img src="/img/2024/04/15/16-snippet-uuidgen-clipboard-config.png"
    alt="How configure the Copy to clipboard output">
</figure>

<p>The <a href="https://github.com/gaqzi/alfred-workflows/blob/master/uuidgen.alfredworkflow">uuidgen workflow</a> is available on Github.</p>
<h2 id="other-workflows">
  Other workflows
  <a href="#other-workflows" class="heading-anchor" aria-label="Direct link to Other workflows"><span aria-hidden="true">#</span></a>
</h2>
<p>Some other workflows I have installed since they save me time.</p>
<h3 id="calculate-anything">
  Calculate Anything
  <a href="#calculate-anything" class="heading-anchor" aria-label="Direct link to Calculate Anything"><span aria-hidden="true">#</span></a>
</h3>
<p>I installed this for two reasons: to quickly translate cooking recipes using
imperial units into metric and currency conversion. Super convenient and now I
can finally get how much 16 floz is in ml (473.176) without needing to go
online.</p>
<figure><img src="/img/2024/04/15/13-calculate-anything.png"
    alt="Calculate Anything converting 16 floz to ml">
</figure>

<p>By <a href="https://github.com/biati-digital">Biati Digital</a> and available in
the <a href="https://alfred.app/workflows/biatidigital/calculate-anything/">Alfred Gallery</a>.</p>
<h3 id="epoch-converter">
  Epoch converter
  <a href="#epoch-converter" class="heading-anchor" aria-label="Direct link to Epoch converter"><span aria-hidden="true">#</span></a>
</h3>
<p>There was a time when I kept looking at unix timestamps and needed to quickly
get when it was, so copying and then <code>ts &lt;paste&gt;</code> gave me when it was and
<code>ts</code> without anything will give you the current unix timestamp.</p>
<figure><img src="/img/2024/04/15/14-epoch-converter.png"
    alt="Epoch Converter showing the current unix timestamp">
</figure>

<p>By <a href="https://github.com/snooze92">Julien Lehuen</a> and available in
the <a href="https://alfred.app/workflows/julienlehuen/epoch-converter/">Alfred Gallery</a>.</p>
<h2 id="tying-it-up-and-how-i-figure-out-what-to-add">
  Tying it up and how I figure out what to add
  <a href="#tying-it-up-and-how-i-figure-out-what-to-add" class="heading-anchor" aria-label="Direct link to Tying it up and how I figure out what to add"><span aria-hidden="true">#</span></a>
</h2>
<p>I hope the above gives you some ideas or inspiration for what you could do
to improve your day-to-day computer usage. These are things that I&rsquo;ve pulled
together over years, and similarly I have a <a href="https://github.com/gaqzi/conf">bin/ folder</a> with other types of
automation I&rsquo;ve accrued, hehe. 😅</p>
<p>Now, how have I accrued these things? I generally try to reflect on the work
I do and the biggest help to it has been scheduling 30min every Friday to
reflect on the week. This session covers everything from updating my <a href="https://jvns.ca/blog/brag-documents/">brag
document</a> to reflecting on what work I felt I repeated a lot and whether
there&rsquo;s anything there to spend time on in the future. Pretty much,
what annoyed me when working and can I do something about it?</p>
<p>If I come up with something that I can&rsquo;t deal with right now then I&rsquo;ll
record it in Roam under <code>#hack-idea</code>, whether it&rsquo;s Friday or not, and when I
feel like hacking on something I&rsquo;ll look there. Because sometimes you just
need something quick to hack on. 🙂</p>
<p>I&rsquo;d love to hear what your favorite day-to-day automations are
on <a href="https://hachyderm.io/@gaqzi">Mastodon</a>!</p>
]]></content:encoded></item></channel></rss>