From 3782f6483ec94b759095e568857259d9a62bbb27 Mon Sep 17 00:00:00 2001 From: Grassmunk Date: Fri, 26 Jun 2020 10:53:15 -0700 Subject: [PATCH] adding --create to xfconf-query if that setting does not exist --- installer.py | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/installer.py b/installer.py index 512b2cf..324a62a 100755 --- a/installer.py +++ b/installer.py @@ -405,15 +405,30 @@ class InstallGUI: def xfconf_query(self, channel, prop, new_value): - xfconf_query_path = subprocess.check_output(["which", "xfconf-query"]).strip() - print("Changing xfconf setting {}/{} to {}".format(channel, prop, new_value)) - args = [ - xfconf_query_path, - "--channel", channel, - "--property", prop, - "--set", new_value - ] - subprocess.check_call(args, stdout=subprocess.DEVNULL) + + try: + xfconf_query_path = subprocess.check_output(["which", "xfconf-query"]).strip() + print("Changing xfconf setting {}/{} to {}".format(channel, prop, new_value)) + args = [ + xfconf_query_path, + "--channel", channel, + "--property", prop, + "--set", new_value + ] + subprocess.check_call(args, stdout=subprocess.DEVNULL) + + except subprocess.CalledProcessError: + + xfconf_query_path = subprocess.check_output(["which", "xfconf-query"]).strip() + print("Changing xfconf setting {}/{} to {}".format(channel, prop, new_value)) + args = [ + xfconf_query_path, + "--channel", channel, + "--property", prop, + "--create", + "--set", new_value + ] + subprocess.check_call(args, stdout=subprocess.DEVNULL) def cancel_install(self, button): print("cancelling install")