Skip to content

dtinth/MyStatusItem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MyStatusItem

Create your own status bar menu, without having any Cocoa knowledge, using your favorite programming language! I created this tool because I suck at Cocoa.

About

This this a simple application that pulls the menu items from a URL (default: http://localhost:12799/menu.json) and displays it on the status bar.

That means you can create your own menu using any language that can serve JSON over HTTP. See code examples in the Wiki!

Installation

Download a release and put it in /Application/ or whatever.

menu.json File Format

{
  "title": "[1]",
  "items": [
    ITEM, ...
  ]
}

ITEM

Each item is a JSON object.

A separator

{ "separator": true }

Renders a separator.

A menu item

{ "title": "Hello!" }

Renders a menu item with text "Hello!". If no action is specified, the item is disabled.

Specifying an action
{ "title": "Start Pomodoro", "url": "http://localhost:12799/pomodoro/start" }

The item becomes enabled. When clicked, MyStatusItem will send a POST request to the specified url. It expects a 200 response. The response data is ignored, and the menu is refreshed.

{ "title": "Start Music", "script": "tell application \"iTunes\" to play" }

The item becomes enabled. When clicked, the specified AppleScript will run.

An alternate menu item.
{ "title": "Start Music", "script": "tell application \"iTunes\" to play" },
{ "title": "Stop Music", "script": "tell application \"iTunes\" to pause",
  "alternate": true }

While option key is held down, the alternate item replaces the previous item.

Customization and Settings

Running at Startup

Just put the app in Login Items.

Changing the Menu URL

defaults write th.in.dt.MyStatusItem menuURL -string 'http://localhost:22222/menu.php'

Changing the Refresh Period

defaults write th.in.dt.MyStatusItem refreshPeriod -float 10

Repositioning MyStatusItem in the Status Bar

Use the awesome Bartender app.

Help Me Please

This project has fulfilled my needs already, but there are areas of improvements to make it more useful to others and to make it more cool:

  • Can someone create an icon for this?
  • Again, I suck at Cocoa, and now the code is messy. A refactor may make the code easier to work with.
  • More language examples in the Wiki.
  • Support nested submenus.
  • Windows / Linux port?

Any contribution is appreciated!

About

All the information you want — in one place! Create a Mac OS X status menu using your favorite language — enhance thy productivity!

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published