mirror of
https://github.com/kbumsik/VirtScreen.git
synced 2025-02-12 11:21:53 +00:00
Fixed parsing of configuration file so that desktop environment is correctly correlated with the display setting app, according to the data.json configuration.
This commit is contained in:
parent
3e997c596a
commit
9047091dd0
2 changed files with 3 additions and 4 deletions
|
@ -34,7 +34,7 @@
|
|||
"value": "arandr",
|
||||
"name": "ARandR",
|
||||
"args": "arandr",
|
||||
"XDG_CURRENT_DESKTOP": []
|
||||
"XDG_CURRENT_DESKTOP": [""]
|
||||
}
|
||||
}
|
||||
}
|
|
@ -87,9 +87,8 @@ class Backend(QObject):
|
|||
# Default Display settings app for a Desktop Environment
|
||||
desktop_environ = os.environ.get('XDG_CURRENT_DESKTOP', '').lower()
|
||||
for key, value in data['displaySettingApps'].items():
|
||||
for de in value['XDG_CURRENT_DESKTOP']:
|
||||
if de in desktop_environ:
|
||||
config["displaySettingApp"] = key
|
||||
if desktop_environ in value['XDG_CURRENT_DESKTOP']:
|
||||
config["displaySettingApp"] = key
|
||||
# Save the new config
|
||||
with open(CONFIG_PATH, 'w') as f:
|
||||
f.write(json.dumps(config, indent=4, sort_keys=True))
|
||||
|
|
Loading…
Reference in a new issue