Bitcoin Price as an OS X Widget

There are many solutions for OS X Yosemite (open source, free or paid apps) to stay up to date with the latest BTC/USD exchange rate (the list to the Github repos can be found below). I wanted a simple solution that I can hack in a few minutes on a lazy Sunday night. The solution is a simple Today widget. To get the result in the shot below, continue reading.

today-widget-bitcoin-price

Setup

All you need is Today-Scripts (a simple OS X app that allows you to run shell scripts in your Today bar) and a small Python script and you’re set. Follow these instructions get the desired result:

  1. Download the latest build of Today-Scripts (latest build) or if you prefer, compile your own version from source code (Github Repo)
  2. Create a new python script (anywhere) from the following gist (get_data.py). The scripts calls the Coinbase REST api to get the latest price.
  3. Using Today-Scripts select the ksh shell and specify the python interpreter to use followed by the script’s absolute path (if you find a more elegant solution for this, drop a line in the comments section below)

btc-widget

 

 The Setup as a GIF

widget setup gif

Oh, and btw, the gif above was created by adopting this method: https://gist.github.com/dergachev/4627207

Alternatives

I don’t vouch for any of these options as I haven’t personally tested them

Menubar options:

Sublime Text 2 – My list of necessary plugins

Why Sublime Text 2?

A lot of developers use the hipped text editor Sublime Text 2 and I’m one of them. Multiple reasons influence such a decision and from experience the important things I look for in a text editor are the following (in no particular order):

  • Simple User Interface: Simplicity of the interface does not necessarily mean minimal features! Sublime Text 2 does a great job at maintaining an impressive list of features while not having the interface bloated with nested menus, buttons and toolbars.
  • Text Editing Features: I rely heavily on text editing features (Find/Replace with RegEx support, Multiple Selections and Batch Editing, Keyboard Shortcuts etc…) and these are very necessary to maintain a fluid / non interrupted line of thought. Not only for the sake of productivity but more importantly for the sake of focus.
  • Plugins: Plugins and their abundance either make or break a text editor. Sublime Text 2 has a great list of open-sourced and highly maintained plugins.
  • Syntax Highlight & Languages Support: My eyes are very important to me and I need to keep them functioning for a long time, I need a text editor that support intelligent syntax highlighting of multiple languages.
  • Quick File Navigation and Project Wrapping: One of the main productivity boosters in Sublime Text 2 is the ability to jump between files very quickly and wrap your projects in a project container that gives you quick access to the list of folders/files needed for a given project.
  • Compatibility with multiple OSs: I frequently switch between Operating Systems while working (from Windows to Linux to Mac sometimes) and having a tool that can jump with you is great! Sublime Text 2 is compatible with all major operating systems.

Remember, a text editor is not an IDE. While multiple IDE’s such as Visual Studio, Eclipse, Netbeans and Xcode among others provide all the above features and more (debugging capacity) they are usually memory hogs, slow and annoying to use.

Most Important Plugins (Packages)

To go back on track, I find the below list of plugins extremely necessary and part of my setup configuration before jumping to a new machine and start coding. Here they are, also, in no particular order:

1. Package Control – package_control

2. AdvancedNewFile – AdvancedNewFile

3. Alignment – alignment

4. Build Switcher – BuildSwitcher

5. DocBlockr – sublime-jsdocs

6. Github Tools – sublime-text-2-github-tools

7. Markdown Preview – sublimetext-markdown-preview

8. Gist – Gist

9. New From Selection – sublime_new_from_selection

10. Processing – processing-sublime

11. Emmet – emmet-sublime

12. Sublime Linter – SublimeLinter

These plugins are not timeless and probably in the upcoming versions of Sublime they will become obsolete. However for now, I’m going to use and abuse them.

Tip (Finding Package Documentation)

Most of the time when you install a new package from Package Control you need to see its documentation for Key Bindings (Keyboard Shortcuts). Most of the plugins have their README file in the package folder. To reach the package’s folder click Preferences and follow the below:

 Preferences - Browse Packages - (Package Name) - README.*