Saturday 24 July 2021

Using Jitouch on macOS Big Sur

After upgrading to macOS Big Sur, the most essential utility for me, Jitouch, stops working reliably. The process is often dead after the computer wakes up from sleep.

Here's how to keep Jitouch running using launchd.

  1. Create a file ~/Library/LaunchAgents/jitouch.restart.plist with following content:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
        <key>Label</key>
        <string>jitouch.restart.local</string>
        <key>ProgramArguments</key>
        <array>
            <string>sh</string>
            <string>-c</string>
            <string>/Users/yi/Library/PreferencePanes/Jitouch.prefPane/Contents/Resources/Jitouch.app/Contents/MacOS/Jitouch</string>
        </array>
        <key>RunAtLoad</key>
        <true/>
        <key>KeepAlive</key>
        <true/>
    </dict>
    </plist>
    
  2. Remember to replace the Jitouch install location in the file with your own

  3. Enable launchd service from the file:

    $ launchctl load -w ~/Library/LaunchAgents/jitouch.restart.plist
    
  4. Done

For some reason, the sh -c part is necessary. The service crashed when I tried launching Jitouch binary directly.