Location-aware Functional Keys

The problem

The problem with the Apple Media Keys is that they hide the standard function keys. This is great for media consumption, as I can adjust the display brightness or sound volume with just one hand.
However in Eclipse, the current IDE I spend most of my working hours in, the F-keys are mapped to often used actions, such as debug stepping and running code. This is great, as I can debug my code step by step with just a few keys with my eyes staying on the display.

The solution

OS X provides a setting for either one of the two modes directly accessible without touching the Fn key, but this is tedious doing it everytime I switch from home to work or vice versa.

Enter ControlPlane. This app lets you do Actions based on your Context. For instance, most of my Contexts are activated, when my MacBook is connected to a certain monitor or sees a certain WiFi network, but other Evidence Sources are also possible.

The missing link between the automatically detected environment (work or home) and the correct setting (media keys or function keys) is the often neglected, because miserably documented, AppleScript.

I found a script for toggling the setting in a forum post. I took it and created two separate scripts, one for activating the setting (at work) and one for deactivating (at home).

Next I created a Shell Execution Action for each of the scripts (osascript path/to/script), one when entering the work Context, and one when leaving.

But wait! We are not done yet.

Mavericks introduced fine-granular settings for Accessibility. Each Accessibility feature has to be enabled for specific apps, when Apps request those features. But ControlPlane does not request the feature to script UI elements, so it does not get added to the list, thus our AppleScript execution fails. Giving the AppleScript Editor the rights is not enough, because when ControlPlane is executing the script the AppleScript Editor is no longer the executing app.

So, how to get the some executing app listed there?

The trick is to wrap both scripts in an Automator app; and so I wrapped both scripts and told ControlPlane to execute both apps and hide them (just to be sure I do not see them executing).

I put the code and the basic instructions into a gist:

Migrating a private repository from GitHub to Bitbucket

Today my GitHub student coupon expires, which gave me the Micro plan for free for two years.

Everything I use private repositories for, currently, is storing my bachelors thesis and occasionally collaborating with a friend.

Bitbucket offers unlimited private repositories with up to five collaborators for free, without applying for a student coupon. So that's exactly what I need right now.

To migrate my private repositories from GitHub to Bitbucket, I used the GitHub Importer Page on Bitbucket.

To migrate all my Issues I had in the GitHub repository, I used the great gem git2bit. Pro-tip: use a Personal Access Token to authenticate the gem with your GitHub Account, unfortunately Bitbucket does not have these currently.

Update 25.11.2013

After applying for two additional years of student discount, GitHub immediately granted my request.
Blimey, I did not leave an empty private repo there to watch what happens with it in the time I could not have had private repositories.

Hello World!

puts 'Hello World!'
echo 'Hello World';
System.out.println("Hello World!");
LOGGER.info("Hello World!");

This seems like a really nice environment. Not fond of the database backend, but we'll see how this compares to my previous content files in a git repository approach.

One advantage is the editor (especially for mobile postings). It is nicer than having to git push everything to the server (toto) or having a built environment for the site (jekyll/prose.io).

bp #1

Für alle, die sich fragen, was ich gerade so mache: Ich male diese lustigen Matrix-Visualisierungen für mein Bachelor-Projekt, in dem es um Diskurs-Visualisierung anhand konzeptueller Rekurrenz geht.


Wir durften ein wenig Text crawlen und mit Wordle rumspielen. Weil das aber ein etwas unpraktisch zu bedienendes Applet ist, was mir mehrmals den Safari in die Knie zwang, fand ich dann WordCram, mit dem man sich auch selber solche Word Clouds bauen kann.