mirror of
https://github.com/grassmunk/Chicago95.git
synced 2025-07-23 13:45:20 +02:00
fixing xfconf checks to fail gracefully
This commit is contained in:
parent
8fe09c856e
commit
3c7dd56bb7
@ -3058,6 +3058,7 @@ class ChicagoPlus:
|
|||||||
self.get_font_list()
|
self.get_font_list()
|
||||||
if 'nonclientmetrics' in self.theme_config:
|
if 'nonclientmetrics' in self.theme_config:
|
||||||
|
|
||||||
|
try:
|
||||||
xfconf_query_path = subprocess.check_output(["which", "xfconf-query"]).strip()
|
xfconf_query_path = subprocess.check_output(["which", "xfconf-query"]).strip()
|
||||||
self.logger.debug("Getting DPI")
|
self.logger.debug("Getting DPI")
|
||||||
args = [
|
args = [
|
||||||
@ -3067,6 +3068,10 @@ class ChicagoPlus:
|
|||||||
]
|
]
|
||||||
dpi = subprocess.check_output(args).split()[1]
|
dpi = subprocess.check_output(args).split()[1]
|
||||||
|
|
||||||
|
except subprocess.CalledProcessError:
|
||||||
|
self.logger.info("xfconf not installed, enable theme manually")
|
||||||
|
return
|
||||||
|
|
||||||
self.logger.debug("Getting MenuFont and CaptionFont")
|
self.logger.debug("Getting MenuFont and CaptionFont")
|
||||||
for logfont in ['lfcaptionfont', 'lfMenuFont']:
|
for logfont in ['lfcaptionfont', 'lfMenuFont']:
|
||||||
if isinstance(self.theme_config['nonclientmetrics'][logfont], dict) and 'lfFaceName[32]' in self.theme_config['nonclientmetrics'][logfont]:
|
if isinstance(self.theme_config['nonclientmetrics'][logfont], dict) and 'lfFaceName[32]' in self.theme_config['nonclientmetrics'][logfont]:
|
||||||
@ -3123,6 +3128,7 @@ class ChicagoPlus:
|
|||||||
|
|
||||||
## Enable Helper functions
|
## Enable Helper functions
|
||||||
def xfconf_query(self, channel, prop, new_value):
|
def xfconf_query(self, channel, prop, new_value):
|
||||||
|
try:
|
||||||
xfconf_query_path = subprocess.check_output(["which", "xfconf-query"]).strip()
|
xfconf_query_path = subprocess.check_output(["which", "xfconf-query"]).strip()
|
||||||
self.logger.debug("Changing xfconf setting {}/{} to {}".format(channel, prop, new_value))
|
self.logger.debug("Changing xfconf setting {}/{} to {}".format(channel, prop, new_value))
|
||||||
args = [
|
args = [
|
||||||
@ -3132,7 +3138,8 @@ class ChicagoPlus:
|
|||||||
"--set", new_value
|
"--set", new_value
|
||||||
]
|
]
|
||||||
subprocess.check_call(args, stdout=subprocess.DEVNULL)
|
subprocess.check_call(args, stdout=subprocess.DEVNULL)
|
||||||
|
except subprocess.CalledProcessError:
|
||||||
|
self.logger.info("xfconf not installed, enable theme manually")
|
||||||
|
|
||||||
def get_font_list(self):
|
def get_font_list(self):
|
||||||
fc_list = subprocess.check_output(["which", "fc-list"]).strip()
|
fc_list = subprocess.check_output(["which", "fc-list"]).strip()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user