Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

To build your own menu bar app, I would recommend trying out xbar[1].

You can write "apps" in any language. The output of your program is used to construct the menu bar app, so if your program outputs this:

    Hello
    ---
    Open HN | href=https://news.ycombinator.com/
Then it will create a menu bar entry titled "Hello" with a single element in its drop-down menu, which will open Hacker News when clicked. You place your program in a specific directory for xbar to run, and it can be configured to run at a given frequency, e.g. once a minute to report the results of an API call or some measurement from your system, etc. Up to you to build the menu bar app you want.

[1] https://xbarapp.com/



Use SwiftBar instead, xbar is stalled...

https://github.com/swiftbar/SwiftBar


If you use Hammerspoon, you can build your own menubar icons in Lua using the hs.menubar[1] API. I've built a clipboard history tool using that, for instance.

If you don't use Hammerspoon, you should check it out. :)

[1]: https://www.hammerspoon.org/docs/hs.menubar.html


Hammerspoon is awesome. I have an `hs_message` alias that basically calls `hs.alert`. Super handy. The good thing about xbar is that you can quickly write small shells scripts. But I definitely love HS for global shortcuts/automation.

One of the more impressive things I've seen is stack line [0] a visualization tool that works with tiling window manager, yabai.

[0]: https://github.com/AdamWagner/stackline


Yeah Hammerspoon is great. I've written scripts to rearrange things correctly when I plug/unplug my laptop into external monitors.


If it is not a hassle, could you please share some of these scripts? I always find rearranging apps/windows (I use multiple desktops) after a reboot quit painful.


You'll be disappointed because my use case is pretty simple - move the dock, remaximize all windows on the main screen and move chrome to my secondary screen.

https://github.com/jemmyw/hammerspoon/blob/main/init.lua




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: