It is amazing how time flies. Since the first version of Diodon more than 10 years pasted already. Lately because of lack of time I haven’t shown Diodon too much love. I have kept using it on my machine all way long though and addressed all issues which bothered me on my setup. Those issues mainly affected packaging. I know though that there have been two very annoying bugs dating back to 2015 and 2016. Those have been fairly frustrating especially for new users. I finally got around to look into those in more detail. With this post I want to give you some background story and show you how you can install the new version 1.12.0 which hopefully fixes those long outstanding issues for you as well.
Menu pops up very rarely on hotkey press
In version 1.4.0 registering of a keybinding to open Diodon per shortcut has been moved to use the functionality available in the respective desktop environment (see previous post). This worked very well at the time for Gnome and Unity but unfortunately not always that well with other desktop environments. Through the years Unity basically disappeared and Gnome made changes which made using keybinding with Diodon unstable.
Basically the issue is that there is a race condition between Gtk and X11 events. So depending which one will be faster the clipboard history pops up or not. In the past I tried to overcome this with a sleep of the process as I assumed the X11 events are happening outside the Diodon process. This somewhat improved the situation but not always. So what I’ve now did is to use a timeout handler instead of a sleep which allows other events to be processed before the clipboard history opens. I have tested this and the hotkey press worked without any problems. I hope it will work for you as well. If you still have issues with clipboard history rarely poping up on hotkey press with version 1.12.0 or higher, let me know in below comments. Do not forget to mention what desktop environment you use.
No clipboard items shown on the very first run
I haven’t paid much attention to this issue because I thought there is an easy workaround. After the installation a simple restart of Diodon is enough and clipboard items will appear in the clipboard history from that point onward. When looking at the reviews in Gnome Software I noticed though that for new users this has been a very frustrating issue. It seemed Diodon did not work and they quickly uninstalled it.
This issue had been a complicated one to fix as well as the error was not in Diodon itself but in the library Zeitgeist which we use to store clipboard items. The issue occurred when Diodon started and the Zeitgeist database file at ~/.local/share/zeitgeist/activity.sqlite had not been initialized yet. In such a situation Zeitgeist Daemon did notify Diodon of new events but when Diodon wanted to read those new events (aka clipboard items) it would get none.
It turned out that libzeitgeist has a local database reader per default enabled. This means the Diodon process directly read from the sqlite database file. Because on the very first run the database schema had not been initialized yet by the Zeitgeist Daemon Diodon got an empty database and not notice the changes which came after it. Thankfully there is an environment variable ZEITGEIST_LOG_DIRECT_READ when set to 0 disables the local reader and the error disappears.
Diodon Version 1.12.0
To get the version with the above mentioned bug fixes applied you can either download the new release per tarball or install it through the ppa with the following commands:
sudo apt-add-repository ppa:diodon-team/stable sudo apt-get update sudo apt-get install diodon # and for all Unity users there is also a scope sudo apt-get install unity-scope-diodon
As always any feedback is very welcome. And if you feel like you would like to help maintain Diodon please contact me by leaving a comment below. Any help is very appreciated.