Giter VIP home page Giter VIP logo

xbar's Introduction

Welcome to xbar

xbar (the BitBar reboot) lets you put the output from any script/program in your macOS menu bar.

Digging deeper:

And finally...

Get started

Install

Installing plugins

From an xbar menu, choose Preferences > Plugins... to use the xbar app to discover and manage plugins.

You can browse all the plugins online, or write your own.

The Plugin Directory

The plugin directory is folder on your Mac where the plugins live, located at ~/Library/Application Support/xbar/plugins.

  • If you're transitioning from Bitbar, move your plugins into this new folder to install them

Contributing

If you'd like to contribute a plugin, head over to https://github.com/matryer/xbar-plugins to get started.

Please do not send pull requests to this repo. Open an issue and start a conversation first. PRs will likely not be accepted.

Thanks

xbar's People

Contributors

alexandregz avatar daturkel avatar dlajarretie avatar dnicolson avatar fenhl avatar gautamkrishnar avatar gingerbeardman avatar ibutra avatar iosdeveloper avatar jessor avatar joncse avatar jtokoph avatar kamenevn avatar ksuther avatar leaanthony avatar manojlds avatar matryer avatar matzfan avatar mralexgray avatar muhqu avatar nlassaux avatar raemondbw avatar seripap avatar sg-s avatar steveedson avatar taylorzane avatar tomkinsc avatar tresni avatar trungdq88 avatar vogonistic avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

xbar's Issues

a plugin to show chinese stock price on menu bar


#!/bin/bash

# stock info plugin
#
# by clark
# email:[email protected]
# use baidu stock api to monitor stock price
# the price only show up in market time.
if [ $(date +%H) -lt 9 ]; then
  echo "not trade time|color=red"
  exit
fi
if [ $(date +%H) -gt 15 ]; then
  echo "not trade time|color=red"
  exit
fi
if [ $(date +%w) -gt 5 ]; then
  echo "not trade time|color=red"
  exit
fi
if [ $(date +%w) -eq 0 ]; then
  echo "not trade time|color=red"
  exit
fi

# change folloing code to select your stock
stocknum="sz000410"
# apply for your own api key at http://apistore.baidu.com/apiworks/servicedetail/115.html
apikey="apikey:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

curl  --get --include  "http://apis.baidu.com/apistore/stockservice/stock?stockid=$stocknum&list=1"  -H "$apikey" -s|grep "{"|awk -F "," '{print $4,$9,$16,$17,$18,$19,$20,$21,$22,$23,$24,$25,$26,$27,$28,$29,$30,$31,$32,$33,$34,$35,$36}'|awk -F ":| " '{printf"%s,%.2f,%.2f%|color=red\ns5:%.2f,%.0f|color=green\ns4:%.2f,%.0f|color=green\ns3:%.2f,%.0f|color=green\ns2:%.2f,%.0f|color=green\ns1:%.2f,%.0f|color=green\nb1:%.2f,%.0f|color=red\nb2:%.2f,%.0f|color=red\nb3:%.2f,%.0f|color=red\nb4:%.2f,%.0f|color=red\nb5:%.2f,%.0f|color=red\n",$2,$4,$6,$46,$44,$42,$40,$38,$36,$34,$32,$30,$28,$10,$8,$14,$12,$18,$16,$22,$20,$26,$24}'

Feature Request: ability to add link to menu items

First of all, what a great App! I love the feature to split the output with --- to generate menu items. But it would be awesome if these could be made 'clickable' by providing an URL on a per Item basis.

e.g.

#!/bin/bash
echo "menu bar item"
echo "---"
echo "clickable menu item | href=http://something.com/"
echo "not clickable menu item"

What do you think?!

Support for Ruby & Python

In the plugin section of the readme.md it says 'To write a plugin, just write some form of executable script that outputs to the standard output' but it doesn't seem to work for python or ruby with me.

Also the 'memusage.5s.py' plugin under Systems doesn't work for me.

Anyone else having trouble with this?

Submodule path seems incorrect

Hello,

Just started using BitBar.
I forked the repo to try and add a few functionalities (no whitespace trimming and a manual refresh button), but was having trouble building the project.

Looking at the .gitmodules file, it seems that the submodule are expected to be in the Vendor/ subdirectory. However, they are actually located in the Vendor/App/ subdirectory.

Modifying the .gitmodules file to set the correct path allows to correctly git submodules init and git submodules update. I've created a pull request that fixes the issue if it is confirmed.

Thank you,
Jean

Evolve plugin management

As plugins grow, we will consider a better solution for plugin management that:

  • bundle supporting files with a plugin
  • makes plugins more visual (images)
  • makes them searchable
  • makes it easy to activate/deactivate them
  • maybe has its own UI
  • puts plugins in their own repo

Considerations

  • would using an existing platform (like brew) solve this?

Add a way to tell BitBar to skip the refresh and keep the last state

It would be great if there was a way to tell BitBar that nothing has changed since the last refresh and the last output/state should be kept.

One could solve this with caching in the plugin itself, but that's more complicated than simply returning something like | stale=true.

Separate repo for plugins

As BitBar's popularity will increase, it will be handy to make the plugins a separate repo, similar to oh-my-zsh. This will ensure that the commit tree won't be cluttered with plugin additions/edits and will allow community moderators to approve/reject plugins without giving access to the full BitBar project scope.

In addition it will allow users to retrieve plugin updates without checking out the entire codebase or configuring a sparse checkout.

Bitbar duplicating menu items.

image

image

Tried a small example for multi line in bit bar:

#!/bin/bash
echo "1" 
echo "2" 
echo "3" 
echo "---" 
echo "menu"

The numbers cycle however on each loop when it reaches 3 the menu item is duplicated. Now that I have removed the script from the plugins folder it removed a single item but three remain. Not sure what has caused this. I am running OSX 10.11.1

Better plugin management

The plugin discovery strategy is pretty simple today : "Execute everything that's in the plugin folder". As much as I love the straightforwardness of this, I feel that this has some drawbacks

  • First launch experience is not very clear (select which folder ?)
  • Installing, removing and updating plugins is difficult (copy or symlink to the plugin folder)
  • Having helper scripts right by your plugins is impossible (they should be put in a different folder)

One of the proposed solution in the discussion of PR #53 would be to symlink installed scripts to the plugin folder, but this adds another layer to installing / removing plugins.

Drawing from this, Bitbar could managed installed plugins by itself. For example :

  • By defaults, Bitbar looks for plugins in an ApplicationData/Bitbar/Plugins folder. This folder can be changed.
  • Drag and dropping a script on the Bitbar status menu item symlinks this file to the plugin folder (thus "installing" it in Bitbar)
  • Additional options (Remove plugin, Set refresh time, ...) should be added to the plugin dropdown. Those options either remove or modify the name of the symlinked executable file (thus keeping the legacy API)

This might be a bit overkill, but I'd be willing to give it a try and implement it.
I believe this might make it easier to distribute Bitbar as well as plugins and improve the user experience by just having user drag and drop plugins instead of having to manage the plugin folder.

Feature request: Preference to refresh plugin folder

Currently, if I want to make bitbar re-check my plugin folder, I have to click Change Plugin Folder... and select the folder currently in use. It would be nice if there were a button to simply re-check the currently active plugin folder.

Too much resource used

I wrote a bash code like this, and it runs with too much resource. CPU 10%~20%, memory(1.08G/8G). I don't think it should use so much resource.

172-10-23-204:msg hurray$ cat msg.5d.sh

!/bin/bash

echo "Hello | color=#FF0000"
echo "Hello | color=#FF7F00"
echo "Hello | color=#FFFF00"
echo "Hello | color=#00FF00"
echo "Hello | color=#00FFFF"
echo "Hello | color=#0000FF"
echo "Hello | color=#8B00FF"
echo "Hello | color=#FF00FF"

Configuration for bitbar and plugins

Read config from something like ~/.bitbarrc. This should also enable plugins to hook into it.

For example, for the jenkins plugin, within ~/.bitbarrc:

[jenkins]
user="user"
password="password"

If not for this approach, some config management will be of use.

Have plugins use the same $PATH as current user?

Scripts are currently run using a different $PATH, and so all terminal commands are not available to me unless I use export PATH='/my/paths:/my/additional/paths'

I'm using node to produce my script outputs, and node was not available to me until I changed the path or specified the node executables full path.

Tests are broken

The tests reference an absolute path that seems to be on @matryer machine
~/Work/bitbar/BitBar/BitBarTests/TestPlugins

Furthermore, the .pch file that was removed in 0964f06 is still referenced by the tests

BitBar disappears/crashes

Not really sure what happens. I was trying to create a plugin that uses contrib-rocket. The plugin is the following:

#!/bin/bash
contrib-rocket -d 14

After clicking 'Reset' (or now every time I open the app), it disappears together with other menu bar icons. Can you check what's happening? Thanks.

Streaming through stdout

Is it possible to stream stuff instead of rerunning a script every few seconds?

I have an implementation but all I see is 'BitBar ...'

Great project btw! I've been trying to write something like this for ages but always got stuck.

BitBar Not Displaying Colors for Text

This might be a Yosemite problem.

I made a test script with only one line:

!/bin/sh

echo "FAIL | color=red"

And that is exactly what gets displayed in the menu bar: FAIL | color=red

Follow-up: I tried with BitBar 1.0 and 1.1 on both Mavericks 10.9.4 and Yosemite 10.10.1 and no joy.

Also, the link on the homepage for the "latest" version of BitBar is for 1.0 not 1.1.

Font family and size set, no changes.

Example:
something | color=#ff0000 size=10 font=Tahoma
something | color=#ff0000 size=10
something | color=#ff0000 font=Tahoma

Color is set correctly, but size and font attributes do nothing.
I've read that something changed in method fontWithName:size: in Yosemite or it got deprecated. Maybe that's the case.

bash command doesn't support spaces in path

I've tried escaping but it seems like the app doesn't support parsing escaped spaces when splitting the string.

echo "test me | bash=/some/pa\ th/with/a\ space\ or\ two param1=foo"

github.io page with screenshot gallery

It is wonderful to have so many amazing plugins! As the project grows, it will take time to examine the source of each one to determine how it functions and whether it is worth trying. It would help discoverability to have a github.io page with a screenshot or two for each plugin, demonstrating the functionality. Having a central page like this (with links to the raw plugin files, of course) would make it easy to find great new plugins. The screenshots can probably be taken from pull requests that include them.

Limit length of text shown [Spotify]

Is it possible to get the name limited on this to the first say, 15 characters of the song then the artist name?

image

Otherwise stuff like this happens.

Cannot "Change Plugin Folder"

When I use the "Change Plugin Folder" menu item, it allows me to choose a new folder via the Finder. After I do this I get a message that no plugins are found. (There is, however, one plugin in the folder I'm choosing). When I then choose "Open Plugin Folder" the Finder opens to my "Documents" folder, rather than the folder I'd previously chosen for my plugins.

This is v1.2 installed via homebrew. OS is 10.11.2

Handling PATH

PATH for the app is limited. Most commands that I want to run, like docker, are not in PATH for the app. This makes it very limited regarding what I can write in the plugins.

Would like to know what people are doing for this. I would also like to make a recommendation that PATH from login shell is somehow incorporated, as the premise is running custom scripts that work in our terminals.

Ability to set icon

Ability to set an icon for the menu bar item would be really great. Most of the menu bar items work this way, and having text feels out-of-place.

Ability to have submenus

I would like to create submenus, so that we know that these menus go under a parent menu. Is this possible already? Simple way would be to have some indentation. Suggestions please?

(Spotify?) text not aligned with OS X UI text

As you can see below, the text for the spotify plugin is not exactly vertically aligned with the OS X clock (and left-aligned menu bar items either). Not sure if this is exclusive to Spotify plugin or all text rendered via bitbar.

BitBar Doesn't Update on Assigned Schedule

I have a BitBar script named netstat.1m.sh. It checks the status of the internet connection and displays either Up or Down in the menu bar. It also logs each run of the script.

I expect the status to be updated every 1m. But after a while, BitBar updates twice per minute - once at the 40 second mark and then again at the 20 second mark.
bitbar

Build broken

@mralexgray - after merging your changes, my BitBar build is broken. Probably something trivial, so I thought I'd ask before digging too deeply into it.

brokenbitbar

Drag to Bitbar

I would love to drag a folder into bitbar and have it open in a text editor.

I would also love to drag a link into bitbar to save or post it to a social/cloud service.

Duplicated menu items

MBP, El Capitan, v. 1.3.1

When I wake computer from sleep multiple instances are shown in menubar.

screen shot 2015-12-27 at 10 13 21

Auto-update application and plugins

What's your opinion on providing an auto-updater (such as (sparkle)[http://sparkle-project.org]) to keep both the plugins and applications up to date ?

1.4 beta doesn't use monospace digits in the default font anymore

I'm relying on monospaced digits (meaning that all digits have the same width) in my custom stocks plugin. This is typical a font feature.

1.3.1 and 1.4beta use exactly the same font on OS X 10.11.1 El Capitan (the San Francisco system font), but while 1.3.1 uses monospaced digits, 1.4beta doesn't anymore. See screenshots:

1.3.1:
bitbar-1-3

1.4beta:
bitbar-1-4

I think monospaced digits are always preferable for BitBar use cases.

This may help to resolve it:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.