Sunday, 13 October 2013

Cinnamon Applet Development

Having been back from travelling and before strting my new job I've had some from time. Over the last week I have been playing around and looking into improving an old project which is an Cinnamon Applet which interacts with GitHub's API and displays details on a persons public repositories. Written in JavaScript and utilizing any underlining Cinnamon code via GObjectIntrospection its reasonably pleasant to work with, given a nice editor such as gedit with a few plug-ins. I do have a few gripes with Cinnamon Applet development but I will get to this later in the post.

The applet is can be installed via the new applet management console in Cinnamon 1.8 which now displays published applets from the Cinnamon website as well as installation and configuration. Along with other improvements Cinnamon 1.8 now has a fully baked in Settings API which means that developers like me don't have to have a home brew solution to this issues, previously I was using GTK Glade and some custom JavaScript code to control this, the addition of the Settings API makes it a much easier and hassle free even if its not got all the features I wanted.

The Applet has improved after a few rounds of re-factoring plus the additions of a few features such as correctly using the HTTP headers and hopefully not exceeding your free public API limit which did happen occasionally. I have also added change notifications which means that if the number of issues, forks and watchers changes for each repository then I pop a notification to the user about the change with a link to the repository, its basic but can be useful, I plan to improve/expand on this in a future release.

Next on my list of things to do is to give the option for users to use GitHub 0Auth Token authentication and to increase the complexity of the plug-in. I would like to give users more options for what they see and use in the applet, expanding the controls. Its nice to learn new things especially something community driven like Linux Mint development. Having used Linux Mint for 18 months solid as my main desktop and development environment I feel it was a wise move and one I don't regret. I use Windows 7 and Ubuntu in my day to day job as a Software Engineer and they don’t feel as nice to work with and don’t give me what I want from a desktop experience. I believe Cinnamon and Linux Mint have a good future and look forward to seeing whats new. N.B. Cinnamon 2.0 has just been released.

The application can be seen in more detail on the Cinnamon website and all code and further information can be found in the GitHub repository. Let me know what you think.

Gripes and Grimes

Settings API

The Settings API is nice to work with and even has some good documentation and a few example can be found online which is good. I would how ever like more controls available for what options would be displayed. For example in a normal configuration option I would tend to put links to various websites, display version numbers and also have small blocks of text highlight things and or simple displaying help etc. 


This is just a general wine about the state of documentation for Seed and GJS, I know there are sites available such as this but when you have never done things before it would be nice to have an example of how to interact with the API's and how to overcome some basic coding problems. On a good note the Linux Mint development time are always on IRC and always try to help if they can.

Unit Testing
Coming from a Java background and writing unit tests and aiming to be test driven at work everyday I find it hard writing code without tests. In essence what happens when combined with the lack of documentation is, I write some code which I don’t know even compiles, install it, restart Cinnamon and see what happens. On several occasions I have got myself into issues and even and to restart my machine. Maybe there is a better way to develop these applets and extensions but I'm not sure what that is, there certainly isn’t first class support for it yet.

I know that in reality since its all Open Source I should really try fixing the grips I have raised., maybe this will be next on my list of projects.