My Mac Productivity Setup

Published | Go Back

Here is my pro­duc­tiv­ity setup on a Mac. It is just a per­sonal memo, not an en­dorse­ment or an ad­ver­tise­ment.

Tools and Apps

Here is a brief list of some pro­duc­tiv­ity tools. Further sec­tions will dis­cuss com­bin­ing them to achieve pow­er­ful work­flows and se­tups.

Notes and Todo List (and CPU Temperature)

I use FSNotes for all my notes, in­clud­ing a spe­cial text file named Todo.txt. This file is a list of my todo tasks. I’ve writ­ten a sim­ple SwiftBar plu­gin to show the num­ber of lines in that file, in­di­cat­ing how many tasks are un­fin­ished. If the plu­gin re­freshes every 15 sec­onds, why not let it col­lect other data as well? So the ac­tual plu­gin I use also cap­tures the CPU tem­per­a­ture through iS­tats. The plu­gin looks like this:

#!/bin/bash

export GEM_HOME=~/.gem
temp=$(printf "%.0f" `$GEM_HOME/bin/istats cpu temp --value-only`)
speed=$($GEM_HOME/bin/istats fan speed --no-graphs --no-labels | head -n 1)

unread=`awk 'END{print NR}' ~/path/to/Todo.txt`
if [ $unread -gt 0 ]
then
    todo=":checkmark.square: $unread"
else
    todo=":checkmark.seal:"
fi

echo -e ":cpu: $temp\xc2\xb0C    $todo"
echo "---"
echo $speed

Note that those colon-wrapped words like :checkmark.square: are re­fer­ring to SF Symbols, as men­tioned in SwiftBar doc­u­men­ta­tion.

Global Hotkeys

I like to de­fine some global hotkeys so that I can switch to spe­cific ap­pli­ca­tions quickly. For ex­am­ple, I want to press Command+3 to switch to Gmail Desktop. I did­n’t find a good open source app to set global hotkeys on a Mac, so I used AppleScript and Karabiner-Elements as a workaround.

First of all, I use the fol­low­ing script to show and hide a spe­cific ap­pli­ca­tion. Note that it will launch the ap­pli­ca­tion if it’s not al­ready launched.

tell application "System Events"
    set names to name of application processes
    if names contains "Gmail Desktop" then
        tell application process "Gmail Desktop"
            if frontmost is true then
                set visible to false
            else
                tell application "Gmail Desktop" to activate
            end if
        end tell
    else
            tell application "Gmail Desktop" to activate
    end if
end tell

Then I de­fine some com­plex rules in Karabiner-Elements:

{
    "title": "Global Hotkey",
    "rules": [
        {
            "description": "Global hotkeys to launch applications",
            "manipulators": [
                {
                    "type": "basic",
                    "from": {
                        "key_code": "3",
                        "modifiers": {
                            "mandatory": [
                                "command"
                            ]
                        }
                    },
                    "to": [
                        {
                            "shell_command": "osascript ~/path/to/above.scpt"
                        }
                    ]
                }
            ]
        }
    ]
}

Note that the script file here is the com­piled one, as men­tioned pre­vi­ously.