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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dconfjson-0.2.4.tar.gz.
File metadata
- Download URL: dconfjson-0.2.4.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
15e7494641df6b3346e38de02a355d755906672650efee2f28c2012feec9e444
|
|
| MD5 |
79536f25c07259915e77a435ba7c638e
|
|
| BLAKE2b-256 |
a9a3294e3a72f7398d083ebecfa6a17a31f92eea0a141a96ece755e3f740a40c
|
File details
Details for the file dconfjson-0.2.4-py3-none-any.whl.
File metadata
- Download URL: dconfjson-0.2.4-py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8611738919dcfa4af93072304b5604a2c49ab1d75b7c4f73d0bf68f3badc6f94
|
|
| MD5 |
084c51d5de588a067ef3c85bd80e774b
|
|
| BLAKE2b-256 |
f46ade979ef2ea3eab606f89d1e7050d8d7635217b164341321464d114f3f324
|