From e0344eaa72b6bb0589732d42045e7d79dd4ed9ef Mon Sep 17 00:00:00 2001 From: Ben Reaves Date: Wed, 11 Nov 2020 22:49:47 -0600 Subject: [PATCH 1/3] - Added overlay warning to setup. #315 --- xkeysnail-config/gui/kinto-gui.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xkeysnail-config/gui/kinto-gui.py b/xkeysnail-config/gui/kinto-gui.py index bd0aab4..3465e9d 100755 --- a/xkeysnail-config/gui/kinto-gui.py +++ b/xkeysnail-config/gui/kinto-gui.py @@ -1221,7 +1221,8 @@ class SecondPage(Gtk.Box): scroller.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.ALWAYS) label_start = Gtk.Label() - label_start.set_markup('Identifying your Keyboard...\n\nPress the 2nd key Left of the spacebar.') + + label_start.set_markup('Identifying your Keyboard...\n\nPress the 2nd key Left of the spacebar.\n\nIf stuck here then unset Overlay (Super) key on your DE.') label_start.set_alignment(0,0) label_start.set_line_wrap(True) vbox.add(label_start) From 1406e3bea558164e01ba5ff0b8f6e0bb1dd85d59 Mon Sep 17 00:00:00 2001 From: Ben Reaves Date: Wed, 11 Nov 2020 23:06:12 -0600 Subject: [PATCH 2/3] - Added 2 additional default text editors. #317 --- xkeysnail-config/gui/kinto-gui.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/xkeysnail-config/gui/kinto-gui.py b/xkeysnail-config/gui/kinto-gui.py index 3465e9d..555f386 100755 --- a/xkeysnail-config/gui/kinto-gui.py +++ b/xkeysnail-config/gui/kinto-gui.py @@ -922,6 +922,10 @@ class MyWindow(Gtk.Window): Popen(['gedit',os.environ['HOME']+'/.config/kinto/kinto.py']) elif which(mousepad) is not None: Popen(['mousepad',os.environ['HOME']+'/.config/kinto/kinto.py']) + elif which(kate) is not None: + Popen(['kate',os.environ['HOME']+'/.config/kinto/kinto.py']) + elif which(kwrite) is not None: + Popen(['kwrite',os.environ['HOME']+'/.config/kinto/kinto.py']) except CalledProcessError: # Notify user about error on running restart commands. Popen(['notify-send','Kinto: Error could not open config file!']) @@ -934,6 +938,10 @@ class MyWindow(Gtk.Window): Popen(['gedit','/lib/systemd/system/xkeysnail.service']) elif which(mousepad) is not None: Popen(['mousepad','/lib/systemd/system/xkeysnail.service']) + elif which(kate) is not None: + Popen(['kate','/lib/systemd/system/xkeysnail.service']) + elif which(kwrite) is not None: + Popen(['kwrite','/lib/systemd/system/xkeysnail.service']) except CalledProcessError: # Notify user about error on running restart commands. Popen(['notify-send','Kinto: Error could not open config file!']) From fe0346ea639ce07c5c11398a7f93371d1aaa2810 Mon Sep 17 00:00:00 2001 From: Ben Reaves Date: Thu, 12 Nov 2020 14:48:41 -0600 Subject: [PATCH 3/3] - Corrected text editors to open config files, also properly linked system options for KDE. Closes #317 --- xkeysnail-config/gui/kinto-gui.py | 21 ++++++++++++------- .../trayapps/appindicator/kintotray.py | 20 ++++++++++++++---- 2 files changed, 29 insertions(+), 12 deletions(-) diff --git a/xkeysnail-config/gui/kinto-gui.py b/xkeysnail-config/gui/kinto-gui.py index 555f386..5136833 100755 --- a/xkeysnail-config/gui/kinto-gui.py +++ b/xkeysnail-config/gui/kinto-gui.py @@ -5,6 +5,7 @@ gi.require_version('Gtk', '3.0') gi.require_version('Vte', '2.91') from gi.repository import Gtk,Gdk,GdkPixbuf from gi.repository import Vte,GLib +from shutil import which from subprocess import Popen,PIPE,CalledProcessError from distutils.util import strtobool @@ -918,13 +919,13 @@ class MyWindow(Gtk.Window): try: if os.path.exists('/opt/sublime_text/sublime_text'): Popen(['/opt/sublime_text/sublime_text',os.environ['HOME']+'/.config/kinto/kinto.py']) - elif which(gedit) is not None: + elif which('gedit') is not None: Popen(['gedit',os.environ['HOME']+'/.config/kinto/kinto.py']) - elif which(mousepad) is not None: + elif which('mousepad') is not None: Popen(['mousepad',os.environ['HOME']+'/.config/kinto/kinto.py']) - elif which(kate) is not None: + elif which('kate') is not None: Popen(['kate',os.environ['HOME']+'/.config/kinto/kinto.py']) - elif which(kwrite) is not None: + elif which('kwrite') is not None: Popen(['kwrite',os.environ['HOME']+'/.config/kinto/kinto.py']) except CalledProcessError: # Notify user about error on running restart commands. @@ -934,13 +935,13 @@ class MyWindow(Gtk.Window): try: if os.path.exists('/opt/sublime_text/sublime_text'): Popen(['/opt/sublime_text/sublime_text','/lib/systemd/system/xkeysnail.service']) - elif which(gedit) is not None: + elif which('gedit') is not None: Popen(['gedit','/lib/systemd/system/xkeysnail.service']) - elif which(mousepad) is not None: + elif which('mousepad') is not None: Popen(['mousepad','/lib/systemd/system/xkeysnail.service']) - elif which(kate) is not None: + elif which('kate') is not None: Popen(['kate','/lib/systemd/system/xkeysnail.service']) - elif which(kwrite) is not None: + elif which('kwrite') is not None: Popen(['kwrite','/lib/systemd/system/xkeysnail.service']) except CalledProcessError: # Notify user about error on running restart commands. @@ -949,12 +950,16 @@ class MyWindow(Gtk.Window): def setSysKB(self,button): if self.ostype == "XFCE": Popen(['xfce4-keyboard-settings']) + elif self.ostype == "KDE": + self.queryConfig('systemsettings >/dev/null 2>&1 || systemsettings5 >/dev/null 2>&1') else: Popen(['gnome-control-center','keyboard']) def setRegion(self,button): if self.ostype == "XFCE": Popen(['gnome-language-selector']) + elif self.ostype == "KDE": + self.queryConfig('kcmshell4 kcm_translations >/dev/null 2>&1 || kcmshell5 kcm_translations >/dev/null 2>&1') else: Popen(['gnome-control-center','region']) diff --git a/xkeysnail-config/trayapps/appindicator/kintotray.py b/xkeysnail-config/trayapps/appindicator/kintotray.py index 4401106..2eeeb06 100755 --- a/xkeysnail-config/trayapps/appindicator/kintotray.py +++ b/xkeysnail-config/trayapps/appindicator/kintotray.py @@ -620,10 +620,14 @@ class Indicator(): try: if os.path.exists('/opt/sublime_text/sublime_text'): Popen(['/opt/sublime_text/sublime_text',os.environ['HOME']+'/.config/kinto/kinto.py']) - elif which(gedit) is not None: + elif which('gedit') is not None: Popen(['gedit',os.environ['HOME']+'/.config/kinto/kinto.py']) - elif which(mousepad) is not None: + elif which('mousepad') is not None: Popen(['mousepad',os.environ['HOME']+'/.config/kinto/kinto.py']) + elif which('kate') is not None: + Popen(['kate',os.environ['HOME']+'/.config/kinto/kinto.py']) + elif which('kwrite') is not None: + Popen(['kwrite',os.environ['HOME']+'/.config/kinto/kinto.py']) except CalledProcessError: # Notify user about error on running restart commands. Popen(['notify-send','Kinto: Error could not open config file!']) @@ -632,10 +636,14 @@ class Indicator(): try: if os.path.exists('/opt/sublime_text/sublime_text'): Popen(['/opt/sublime_text/sublime_text','/lib/systemd/system/xkeysnail.service']) - elif which(gedit) is not None: + elif which('gedit') is not None: Popen(['gedit','/lib/systemd/system/xkeysnail.service']) - elif which(mousepad) is not None: + elif which('mousepad') is not None: Popen(['mousepad','/lib/systemd/system/xkeysnail.service']) + elif which('kate') is not None: + Popen(['kate','/lib/systemd/system/xkeysnail.service']) + elif which('kwrite') is not None: + Popen(['kwrite','/lib/systemd/system/xkeysnail.service']) except CalledProcessError: # Notify user about error on running restart commands. Popen(['notify-send','Kinto: Error could not open config file!']) @@ -690,12 +698,16 @@ class Indicator(): def setSysKB(self,button): if self.ostype == "XFCE": Popen(['xfce4-keyboard-settings']) + elif self.ostype == "KDE": + self.queryConfig('systemsettings >/dev/null 2>&1 || systemsettings5 >/dev/null 2>&1') else: Popen(['gnome-control-center','keyboard']) def setRegion(self,button): if self.ostype == "XFCE": Popen(['gnome-language-selector']) + elif self.ostype == "KDE": + self.queryConfig('kcmshell4 kcm_translations >/dev/null 2>&1 || kcmshell5 kcm_translations >/dev/null 2>&1') else: Popen(['gnome-control-center','region'])