woodenshark / Lightpack

Lightpack and Prismatik open repository (For support use support@lightpack.tv)
https://lightpack.tv/
GNU General Public License v3.0
203 stars 243 forks source link

Detect Unity DE in runtime #24

Open e-yes opened 9 years ago

e-yes commented 9 years ago

Currently, SystrayIcon classes uses Unity-compatible code when we compile Prismatik on Linux/Ubuntu platform. Instead, we should detect what class to instantiate in runtime, to avoid problems if user switched over to another DE (KDE etc) or when we deploy deb package to Ubuntu-based OS distribution that doesn't use Unity at all, for example, Mint 17 or KUbuntu.

See also #23

klamath commented 9 years ago

Is there some way to compile the project for a specific DE? For example build it specifically for Gnome Shell?

e-yes commented 9 years ago

@klamath there is no specific implementation for other desktop environments - code uses cross-platform QSystemTrayIcon which works well for most platforms (except Unity). You can disable Unity code by simple patch:

diff --git a/Software/src/src.pro b/Software/src/src.pro
index b02c16c..18e342c 100644
--- a/Software/src/src.pro
+++ b/Software/src/src.pro
@@ -65,8 +65,8 @@ unix:!macx{
     DESKTOP = $$(XDG_CURRENT_DESKTOP)

     equals(DESKTOP, "Unity") {
-        DEFINES += UNITY_DESKTOP
-        PKGCONFIG += gtk+-2.0 appindicator-0.1 libnotify
+        #DEFINES += UNITY_DESKTOP
+        #PKGCONFIG += gtk+-2.0 appindicator-0.1 libnotify
     }

     LIBS += -L../qtserialport/lib -lQt5SerialPort

Bear in mind, that if you compile the code under any DE except Unity you don't need this patch, generic QSystemTrayIcon-based implementation should be used automatically.