Menubarnotifier
Python script to place text notifications/messages in the Mac OS X menubar.
Install / Use
/learn @alexglasser/MenubarnotifierREADME
MenubarNotifier menubarnotifier.py
Alex Glasser September 23, 2014
This is a simple script to display a message in the Mac OS X menubar using PyObjC. Make sure you have PyObjC installed - you can do this using MacPorts or Homebrew.
Call the script with the desired notification as the first and only argument: $ ./menubarnotifier.py "Notification Text"
You may have to add executable permissions to the file first: $ chmod +x ./menubarnotifier.py
This does use NSLog which writes to stderr by default. The way to bypass the logging is to redirect stderr to /dev/null with: $ ./menubarnotifier.py "Notification Text" 2>/dev/null
You will also want to run this in the background so it does not require Ctrl+C to allow you to continue using your shell: $ ./menubarnotifier.py "Notification Text" 2>/dev/null &
Highly recommended: Open your ~/.bash_profile and add/rename the following function:
MenubarNotifier function
mn () { /path/to/menubarnotifier.py "$1" 2>/dev/null & }
Restart your Terminal. This will allow the script to be run like this: $ mn "Notification Text"
...and will not require any redirection or the ampersand.
Feel free to use this code for whatever you want.
Related Skills
node-connect
343.3kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
92.1kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
343.3kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
343.3kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
