diff options
-rw-r--r-- | lvc/widgets/gtk/__init__.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lvc/widgets/gtk/__init__.py b/lvc/widgets/gtk/__init__.py index 6c39151..9fd9007 100644 --- a/lvc/widgets/gtk/__init__.py +++ b/lvc/widgets/gtk/__init__.py @@ -48,10 +48,16 @@ def check_kde(): return os.environ.get("KDE_FULL_SESSION", None) is not None +def check_xorg(): + return os.environ.get("XDG_SESSION_ID", None) is not None + + def open_file_linux(filename): if check_kde(): os.spawnlp(os.P_NOWAIT, "kfmclient", "kfmclient", "exec", "file://" + filename) + elif check_xorg(): + os.spawnlp(os.P_NOWAIT, "xdg-open", "xdg-open", filename) else: os.spawnlp(os.P_NOWAIT, "gnome-open", "gnome-open", filename) |