def on_icon_changed(settings: Gio.Settings, key: str): icon: str = settings.get_value(ICON_KEY).get_string() try: QT5CT_CONFIG_LOCK.acquire() QT5CT_CONFIG.touch(0o644) with QT5CT_CONFIG.open('r+') as file: config = ConfigParser() config.read_file(file) config.setdefault('Appearance', {}) config['Appearance']['icon_theme'] = icon file.seek(0) config.write(file) file.truncate() except Exception as error: raise error finally: QT5CT_CONFIG_LOCK.release()
def on_theme_changed(settings: Gio.Settings, key: str): theme: str = settings.get_value(THEME_KEY).get_string() try: KVANTUM_CONFIG_LOCK.acquire() KVANTUM_CONFIG.touch(0o644) with KVANTUM_CONFIG.open('r+') as file: config = ConfigParser() config.read_file(file) config.setdefault('General', {}) config['General']['theme'] = gtk_to_kv(theme) file.seek(0) config.write(file) file.truncate() except Exception as error: raise error finally: KVANTUM_CONFIG_LOCK.release()