Skip to content

Commit

Permalink
Use AppIndicator on KDE5 (Ref #73)
Browse files Browse the repository at this point in the history
  • Loading branch information
kozec committed Feb 5, 2015
1 parent 806974e commit 9440825
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion syncthing_gtk/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ def setup_widgets(self):
def setup_statusicon(self):
self.statusicon = StatusIcon(self.iconpath, self["si-menu"])
self.statusicon.connect("clicked", self.cb_statusicon_click)
if IS_UNITY and HAS_INDICATOR:
if HAS_INDICATOR:
self["menu-si-show"].set_visible(True)

def setup_connection(self):
Expand Down
4 changes: 2 additions & 2 deletions syncthing_gtk/statusicon.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@

from __future__ import unicode_literals
from gi.repository import Gtk, GObject
from syncthing_gtk.tools import IS_UNITY
from syncthing_gtk.tools import IS_UNITY, IS_KDE5
import os, sys

# Why the hell does ubuntu use own notifications system?
THE_HELL, HAS_INDICATOR = False, False
if IS_UNITY:
if IS_UNITY or IS_KDE5:
THE_HELL = True
try:
from gi.repository import AppIndicator3 as appindicator
Expand Down
6 changes: 5 additions & 1 deletion syncthing_gtk/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,14 @@
log = logging.getLogger("tools.py")

IS_WINDOWS = sys.platform in ('win32', 'win64')
IS_GNOME, IS_UNITY = False, False
IS_GNOME, IS_UNITY, IS_KDE5 = False, False, False
if "XDG_CURRENT_DESKTOP" in os.environ:
IS_GNOME = (os.environ["XDG_CURRENT_DESKTOP"] == "GNOME")
IS_UNITY = (os.environ["XDG_CURRENT_DESKTOP"] == "Unity")
if os.environ["XDG_CURRENT_DESKTOP"] == "KDE":
if "KDE_SESSION_VERSION" in os.environ:
if os.environ["KDE_SESSION_VERSION"] == "5":
IS_KDE5 = True
if "DESKTOP_SESSION" in os.environ:
if os.environ["DESKTOP_SESSION"] == "gnome":
# Fedora...
Expand Down

0 comments on commit 9440825

Please sign in to comment.