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:

Mac OS X – Quickly Copy Folder & File Paths

One of the most annoying things about using Mac OS X is the difficulty in swiftly copying a file or folder’s absolute path. Yes, you can open the ‘Get Info’ popup and copy the directory, but for the lazy (like me) that’s too much work for something so simple. The alternative? Automator + Keyboard Shortcuts. For the below, I’m using OS X 10.9.3.

Automator

Step 1 – Open Automator (Spotlight -> Automator) and select ‘Service’ as per the screenshot below.

Select 'Service' from 'Choose a type of Document' screen.
Select ‘Service’ from ‘Choose a type of Document’ screen.

 

 

 

 

 

 

 

 

 

 

 

Step 2 – Search for ‘copy’ in the ‘actions’ list and drag ‘Copy to Clipboard’ to the right panel.

Select Copy to Clipboard as an action.
Select Copy to Clipboard as an action.

 

 

 

 

 

 

Step 3 – Change the ‘Service receives selected’ to ‘files and folders’ and in to ‘Finder’.

Change the settings to the above
Change the settings to the above

 

 

 

 

 

Step 4 – Save the service (File -> Save) and name it ‘Copy path to clipboard’ or something else you deem relevant.

Now we need to create a keyboard shortcut for this newly created service.

 

Keyboard Settings

Step 5 Go to ‘Keyboard’ in the ‘Settings’ menu and select the ‘Shortcuts’ tab.

Configure the Keyboard Shortcut for the new Service
Configure the Keyboard Shortcut for the new Service

 

 

 

 

 

 

 

 

 

 

 

Step 6 – Select ‘Services’ from the left list and look for the newly created service in the list on the right. Once you find it, I named mine ‘Copy Paths as Text’ assign a keyboard shortcut to it.

Configure the keyboard shortcut for the newly created service
Configure the keyboard shortcut for the newly created service

 

 

 

 

 

 

 

Now you can select any folder/file, press the keyboard shortcut combination and paste the absolute paths anywhere needed. Mind you, with this service you can select multiple folders/files and get all their paths.