Morning Widget

09 May 2015

Backstory

A few days ago, I stumbled across the wonderful world of CoffeeScript. I really wanted to dive right into this wonderful annoying language and felt that the best way to go about it was to make something. I’ve always been a fan of open source widget engines, and wanted to make a widget of my own. This was a great little project for me to kill two birds with one stone.

Übersicht is an open source widget engine built for OSX. What’s great is that it lets you run system commands and display their output on your desktop using CSS HTML5 and CoffeeScript (or JS).

I decided to learn the basics of CoffeeScript syntax by building a small (yet useful) Übersicht widget called, Morning.

What is it?

Morning is a Übersicht widget that displays the time, and greets the current logged in user with a brief salutation. It is a very minimal, which I like.

It is a desktop clone of the popular Google Chrome extension, Momentum.

How can I install it?

First, you’ll need to install Übersicht. Once that’s installed, head on over to the widget gallery and download Morning.

After you’ve unzipped the package, place the morning.widget directory into your Übersicht widget directory. If needed, open morning.coffee and adjust the .container margins to position the widget on your screen.

How does it work?

Morning is nothing special. Simply put, it grabs the current time, figures out what part of the day it is and spits out a string. Realizing the date logic was not difficult and fairly easy to code.

The name of the current user is not hard coded, but is found by executing the following command:

'finger 'whoam' | awk -F: '{ print $3 }' | head -n1 | sed 's/^ // '

Since we only need the first name, the output is split and the first element in the array is used. I made sure to comment every section of the code, and have pushed it to GitHub for those who would like to follow along. You can check out the source here

Update

Morning was featured in Lifehacker’s Winter Desktop. Check it out here :)

1. zsh

Last updated: Sun May 31 17:29:48 on ttys000
Rohan-Likhites-MacBook-Pro:~ rohanlikhite$ cd Documents
Rohan-Likhites-MacBook-Pro:Documents rohanlikhite$ cat myBio.txt

About
-----/
>Toronto-based Software Engineer specializing in product-driven architecture and distributed systems. My technical background spans from engineering secure biometric authentication frameworks to architecting high-availability logistics and fulfillment engines for national-scale e-commerce platforms. A dedicated contributor to the open-source ecosystem, I focus on building scalable, community-driven code. Beyond the IDE, I’m an avid tennis player, F1 enthusiast, and family man.

Skills
------/
> Languages: Ruby, Rust, Typescript, GoLang
> Security: Biometric Auth, OAuth, JWT, OWASP

Other Interests
---------------/
-Tennis
-Reading
-Formula One
-Architecture
-Music
-Cooking

Links
-----/
Email: rohan[at]likhite.email
Github: imRohan
LinkedIn: rohan-likhite


>Press ESC to close window


Rohan-Likhites-MacBook-Pro:Documents rohanlikhite$