Alternative Notification System for Macos || Program or CLI to Display Image/Emblem/Icon at corner of screen (no text or box)

apple.stackexchange https://apple.stackexchange.com/questions/407722

문제

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.

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 apple.stackexchange
scroll top