Using xdg-utils for installing the icon and the .desktop entry will ensure
that the icon/app caches are updated properly. Once caches are current, the
icon can be simply referenced as "ckb", and extracting a copy of it to a
temporary file is no longer needed.
When not performing a system-wide install, install the icon and the .desktop
file into the user's .local directory instead.
This takes advantage of inter-key led light leakage to approximate
further color resolution. This is done by applying an ordered
dithering pattern to the quantization error produced when reducing
8-bit color to 3-bit color. This is a per-device setting.
This conditionally links to libappindicator if its pkg-config files
are present, and uses an indicator instead of QSystemTrayIcon if
we detect we are running under Unity.
This fixes the issue with QSystemTrayIcon showing up on the top left
corner in Unity, thereby obscuring the close button for maximized
windows.
The code used so far (KEY_STOP) is not related to media controls,
but is apparently a special function of Sun keyboards. Using
KEY_STOPCD instead seems to be the right thing.