Lokyr
Documentation

Notifications

On this page

macOS · on by default · [notifications], [agents], [bell]

Lokyr lets you know when something in a terminal needs you while you work elsewhere: a program that sends a notification, an AI agent that waits for you or is done, a long command that ends, or a bell. It uses macOS's own notifications, and a click on one brings you back to the pane that sent it.

Try it

Run this command, then switch to another app within three seconds:

sleep 3; printf '\033]777;notify;Build;Finished in 42 seconds\033\\'

A notification shows "Build" and "Finished in 42 seconds". Click it: Lokyr comes forward with the pane that sent it. The first time, macOS asks whether Lokyr may show notifications.

What it gives you

Allow Lokyr's notifications

macOS asks the first time that Lokyr shows a notification. To change your answer later, open System Settings › Notifications › Lokyr and turn on Allow notifications. There, you can also choose banners or alerts, and whether they show on the lock screen.

How Lokyr shows them

Settings

[notifications]
long-command = 10      # seconds a command runs before its end is notified; 0 turns it off

[agents]
notify = true          # an agent's notifications
dock-badge = true      # the Dock's count of the agents that wait

[bell]
sound = false          # the system's alert sound
flash = true           # the window flashes while it has the focus
bounce = true          # the Dock's icon bounces while Lokyr is in the background
mark-title = true      # 🔔 before the title of a window in the background

The configuration guide lists each key's values.

How it works

A program sends a notification by printing an escape code, OSC 9 or OSC 777, which Lokyr reads and never shows. Notification codes describes each, with what to print. Lokyr hands the notification to macOS, which shows it as it shows every app's.

A program can also send OSC 99, a notification whose title and body come in parts. · Since 1.3

Limits

Troubleshooting

No notification shows

Why: Lokyr isn't allowed to show notifications, the window had the focus, a Focus mode holds them, or the window showed another less than two seconds before.

Fix: allow Lokyr in System Settings › Notifications › Lokyr, turn off the Focus mode, and switch to another app before the notification comes.

Check: run the command of Try it, then switch to another app: the notification shows.

A click on a notification opens a second Lokyr

Why: macOS sends the click to an app of Lokyr's identity, and another copy of Lokyr on your Mac, such as one left in Downloads, can take it.

Fix: keep one copy of Lokyr, in Applications, and move the others to the Trash.

Check: click a new notification: the Lokyr that you use comes forward, and no second icon shows in the Dock.

See also