Customizing Desk

The Desk App for Mac OS X – in all its simplistic glory – really is a fantastic editor for working in a non-interrupted flow with your texts.

However, for those of us with particular aesthetic contemplations, we may wish to change the default font used. Currently, it doesn’t seem that Desk supports this in a graphical user interface, which is why I bring to you this simple 9 step guide for setting the font you like!


Disclaimer: proceed at your own risk and remember to take proper backups!


Our goal is to edit the cascading style-sheet (CSS) that Desk uses for its built-in editor and configure it to use a another font installed on our Mac. To accomplish this, we’ll locate the CSS file within the Desk application package and edit it with the built-in GUI text-editor “TextEdit”.

The steps to accomplish this are as follows:

  1. Open a Finder window
  2. Navigate to the folder “Applications”
  3. Right-click on the “Desk” app icon and click “Show Package Contents”
  4. Navigate to the folder “Contents” > “Resources” > “MCE” > “css” (shown below)Screen Shot 2015-01-20 at 13.20.55
  5. Right-click on the file “iframe.css” and choose “Open With” > “TextEdit”
  6. Search for the line starting with “body {” (currently around line 20)
  7. Edit the “font-family” statement found a couple of lines below that to reflect your choice of font by placing the font name first in the list (see below for an example)
  8. Save the file (possibly needing you to authenticate as this is a restricted file)
  9. Start Desk – your changes should be visible

I have found that the font Quadon works great for me, and therefore my customized “font-family” statement in “iframe.css” has Quadon as the first font mentioned, with fallback to the usual sans serif suspects:

body{
 display: inline-block;
 overflow: hidden !important;
 border: 0 !important;
 margin: 0 !important;
 font-family: Quadon, Helvetica, Arial, sans-serif;

Happy hacking! 

Aside

Accessing a locked HSQLDB database file in read-only mode

Working a lot with the Atlassian tools (JIRA, Confluence, Crowd, Stash etc.), I often have to connect to the databases running behind them in order to perform various SQL queries on the data.

In a couple of use cases, it’s very convenient just to use the standard embedded HSQL database (HSQLDB) instead of a standalone relational database management system. However, with HSQLDB running in embedded mode, a lock file is set on the database file to inhibit other JDBC connections from writing to the database, which is, of course, very sensible (wouldn’t want any inconsistent data, now would we).

Database lock acquisition failure: lockFile: org.hsqldb.persist.LockFile@d446e57c[file =/SOME_FOLDER/database.lck, exists=true, locked=false, valid=false, ]

To remove the lock on the database file, we would have to stop the application altogether. However, in many cases I want to query the database in read-only mode while the application is running, and fortunately the HSQLDB JDBC driver provides a property that can be set to provide lock-ignoring read-only access to the database file.

My database query tool of choice is the excellent Java-based tool called DbVisualizer, and setting the property can be done very simply in the Driver Properties tab of the connection settings view, adding a parameter “readonly” with value “true”.

HSQLDB readonly property in DbVisualizerWith that set, all that is left is rock and roll – SQL style! 


Further reading

Atlassian: Connecting to HSQLDB using DBVisualizer or HSQL database manager