As my way of playing around with what BitBar can do, I created a Spotify script. Until it's merged you can check out the pull request: https://github.com/matryer/bitbar/pull/34
Shows current track name and artist in menu bar. Shows track/artist/album in dropdown along with play/pause/next/previous buttons.
Sadly it's too bespoke to release, I had all the profile switching scripts written already and have been using them for a few years now. On top of updating environment variables with proxy settings etc, they also update a bunch of configuration files for maven, ssh, stunnel etc via symlinks
All this bitbar thing does is call those existing scripts, very simple, but saves me
a) wondering what profile I have enabled (now in the menubar)
b) opening a terminal and typing "update-env (work|home)" (one click switch)
Could also use Hammerspoon (http://www.hammerspoon.org/) for this. It uses Lua but you can invoke processes and modify the toolbar. In addition you can hook into keystrokes, do window management, and all kinds of stuff.
and the upcoming 0.9.44 release will be even more flexible for this sort of use, because the process invoking stuff (http://www.hammerspoon.org/docs/hs.task.html ) will support processes that run indefinitely, so you could do crazy stuff like have a menubar item that shows the most recent line of a log file, or whatever you want :)
-- Creating a simple menubar item
-- Lots of Mac utilities place a small icon in the system menubar to display their
-- status and let you interact with them. We're going to use two of Hammerspoon's
-- extensions to whip up a very simple replacement for the popular utility Caffeine.
local caffeine = hs.menubar.new()
function setCaffeineDisplay(state)
if state then
caffeine:setTitle("AWAKE")
else
caffeine:setTitle("SLEEPY")
end
end
function caffeineClicked()
setCaffeineDisplay(hs.caffeinate.toggle("displayIdle"))
end
if caffeine then
caffeine:setClickCallback(caffeineClicked)
setCaffeineDisplay(hs.caffeinate.get("displayIdle"))
end
In case you made the mistake of choosing a directory with thousands of files as the plugin directory and BitBar getting stuck forever, do this from terminal to reset it:
I only use one though, so I can't say for sure but judging by their blog posts they offer to choose which monitor Ubersicht runs on, but I believe it can't be displayed on multiple monitors at the same time. That's true about the menubar icon, but it doesn't bother me.
The issue i can see in gnome-shell (on linux) implementations is that long running script can block the UI. Async script execution, on the other hand, exhaust open file resources due to non closed file descriptors. Do OSX tools like this suffer the same problem?
I won't be able to get to tinkering with this for a couple weeks, but if it does what it says it does, I've been wanting almost exactly this for a very long time. Thanks for getting it out there.
Awesome, now I can run quick Python commands and see the output in my XFCE panel:
sudo apt-get install xfce4-genmon-plugin
Right click panel > Panel > Add New Items > Generic Monitor > Add
Right click "(genmon)XXX", > Properties
Try this command: python -c "import time;print time.time()"
You might set it to run every 10 seconds.
You could get results from a webpage or all kinds of things.
It supports images, tooltips, progress bar, buttons...
This is great!
Thanks!
Shows current track name and artist in menu bar. Shows track/artist/album in dropdown along with play/pause/next/previous buttons.
Raw script here: https://raw.githubusercontent.com/jtokoph/bitbar/jtokoph-spo...