Question

I am hoping there is some kind of alternate notification system available for macos as a program or a cli. I don't mind paying. I have created vim bindings with karabiner that work anywhere on macos, but I would like to display a small indicator any time I switch modes or turn the bindings on or off.

If you don't know what vim is, basically I just want to display a small colored circle or some similar indicator on the corner of my screen using a bash/zsh/shell scripting command.

If anyone could give me some direction on beginning to write an application or system extension I will do that if I can't find a tool for this out there.

Was it helpful?

Solution

The premiere notification third party notification system for macOS is Growl:

https://github.com/growl/growl

The project was just recently marked as retired (less than a week ago), but you can still download the code and use it. It is very easy to use Growl to trigger a notification from a shell script.

If you can live with the built-in macOS notifications, you can use a command like this from your shell script:

osascript -e 'display notification "Mode change" with title "Mode change"'

This uses the built-in AppleScript function for displaying a local notification. You can ofcourse change the text to be whatever you want, like "Bindings turned on", and so on.

If you want to write your own application to display the notification, you could start looking at this sample application code from Apple:

https://developer.apple.com/library/archive/samplecode/FunkyOverlayWindow/Introduction/Intro.html

It is basically an overlay window that appears on top of every other window at all times. If you make it small, you could use it to display a color when you want, and let it be fully transparent at other times.

Licensed under: CC-BY-SA with attribution
Not affiliated with apple.stackexchange
scroll top