Skip to main content

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.4.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

dconfjson-0.2.4-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

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

Hashes for dconfjson-0.2.4.tar.gz
Algorithm Hash digest
SHA256 15e7494641df6b3346e38de02a355d755906672650efee2f28c2012feec9e444
MD5 79536f25c07259915e77a435ba7c638e
BLAKE2b-256 a9a3294e3a72f7398d083ebecfa6a17a31f92eea0a141a96ece755e3f740a40c

See more details on using hashes here.

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

Hashes for dconfjson-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 8611738919dcfa4af93072304b5604a2c49ab1d75b7c4f73d0bf68f3badc6f94
MD5 084c51d5de588a067ef3c85bd80e774b
BLAKE2b-256 f46ade979ef2ea3eab606f89d1e7050d8d7635217b164341321464d114f3f324

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page