From e2d6f8412465cac0cdfe07f4e1a3eb26199eaee0 Mon Sep 17 00:00:00 2001 From: Osmo Salomaa Date: Sun, 15 Jan 2023 03:30:55 +0200 Subject: [PATCH] Add Wayland to debug dialog environment section Part of #202 --- gaupol/dialogs/debug.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gaupol/dialogs/debug.py b/gaupol/dialogs/debug.py index 799c65ad..279f6cbb 100644 --- a/gaupol/dialogs/debug.py +++ b/gaupol/dialogs/debug.py @@ -20,6 +20,7 @@ import aeidon import gaupol import linecache +import os import platform import sys import traceback @@ -84,8 +85,13 @@ def _insert_environment(self): """Insert information about user's platform and environment.""" locale = aeidon.locales.get_system_code() encoding = aeidon.encodings.get_locale_code() + wayland = "yes" if ( + os.getenv("XDG_SESSION_TYPE", "") == "wayland" or + os.getenv("WAYLAND_DISPLAY", "") + ) else "no" self._insert_text("Platform: {}\n".format(platform.platform(True))) - self._insert_text("Locale: {}.{}\n\n".format(locale, encoding)) + self._insert_text("Locale: {}.{}\n".format(locale, encoding)) + self._insert_text("Wayland: {}\n\n".format(wayland)) def _insert_dependencies(self): """Insert version numbers of selected dependencies."""