Great! It works now. Thank you. I have tested it both on Debian and Kubuntu (fresh install in VM). There are some minor issues though.
One of the issues is cosmetic. Leap Motion icon in tray is very low resolution, so it does not look good on my system, especially in comparison with other KDE icons (I recently upgraded my monitor, so perhaps it was a problem in the past too, I just did not notice it on my old low res monitor where I used much smaller icons in the tray).
Other issues are because of bugs in leap.postinst. I made a patch to fix them. Below I explain what's wrong and how I solved issues I have found.
When installing Leap-2.3.1+33747-x64.deb on my system, I get these messages:
/var/lib/dpkg/info/leap.postinst: line 10: [: too many arguments
Allow Leap Motion in the system tray with the following command:
gsettings set com.canonical.Unity.Panel systray-whitelist "$(gsettings get com.canonical.Unity.Panel systray-whitelist | sed -e "s/]$/, 'LeapControlPanel']/")"
The reason why first error is happening is because this line in leap.postinst has errors:
if [ "${DISTID}" = "Debian" ] && [ $(echo ${DISTVER} \< 8.0) -eq 1 ]; then
Bash cannot handle floats on its own, so it does not work. Also, $DISTVER can be a string like "testing". This is how I fixed it:
if [ "${DISTID}" = "Debian" ] && [ $(echo "if(${DISTVER} > 0) ${DISTVER} < 8.0 else 0" | bc) -eq 1 ]; then
if(${DISTVER} > 0)
tests if $DISTVER is a number (returns false if it is a string like "testing"), and if it is, then it compares it with 8.0. So the line above will correctly handle any $DISTVER: "8.0", "9.0" and even "testing" or "unstable"
Another issue is in this line:
USING_TRAY_WHITELIST=$(echo ${DISTVER} \< 13.04 | bc)
It must check $DISTID to work as expected. Please download the patch to see how I fixed it.