Convert gnome settings between binary conf files and json
Project description
Dconf Json
Convert linux gnome config to json and back
To get the gnome .conf file use:
dconf dump / > FILENAME.conf
Example usage to convert conf and store as json file and take json and store as conf file
import dconfjson
dconfjson.json_writer("FILENAME.conf", dest="FILENAME.json")
dconfjson.dconf_writer("FILENAME.json", dest="FILENAME_2.conf")
To load new dconf parameters into gnome use (bash):
dconf load / < FILENAME_2.conf
To get the gnome config out as a python dict use:
import dconfjson
with open(dconf_path, "rb") as fin:
dconf = fin.read().decode("utf-8")
config_dict = dconfjson.dconf_json(dconf)
Without using files
To get the dconf out as dict without using files:
import dconfjson
import subprocess
def dconf_get():
spath = "/org/gnome/terminal/legacy/profiles:/"
cmd = "dconf dump %s /" % spath
tmp = subprocess.Popen( cmd, shell=True, stdout=subprocess.PIPE )
(out, err) = tmp.communicate()
return out
s_out = dconf_get().decode("utf-8")
config_dict = dconfjson.dconf_json(s_out)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
dconfjson-0.2.2.tar.gz
(3.1 kB
view hashes)
Built Distribution
Close
Hashes for dconfjson-0.2.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 53cb321f9c863360478ff3346c0220f6fa325962ba0060a4c154d4108e542d1e |
|
MD5 | 850a4f5eac48ddad06f165384a0a4079 |
|
BLAKE2b-256 | 48ae6b2fa83ab50c6cfdfeb7af4435f0b49bc836f4779387f29fd593c7ac0dbc |