Skip to main content

JSON interface to Xfconf

Project description

Xion is a JSON interface to Xfconf, using a slightly modified xfconf-query bin. Backup and restore Xfce settings in VCS-friendly files.

This can be useful to synchronise custom keybinds across several Xfce installations.

Usage

`bash # Export custom commands to JSON. $ xion -e xfce4-keyboard-shortcuts /commands/custom commands.json # Import them on another machine. $ xion -i commands.json # Want to clear existing commands to keep only those in commands.json? $ xion -i commands.json -r `

More info with xion –help.

Features

  • Export channel settings, filtering on user-provided root, to JSON files.

  • Import channel settings from those JSON files.

  • Imported settings are immediately applied to your session.

  • Replace entire channel setting trees, or just update with provided values.

  • JSON files have a predictable formatting for easy versioning.

Context

Xion comes from the need to share parts of the Xfce settings between several computers.

> Why don’t you just version the Xfconf XML files?

I got frustrated with the way Xfconf stored settings on disk: its XML files have unpredictable tag sorting and some volatile values, and Xfconf does not read those settings unless you log back in, and this is if you don’t overwrite them in the process. This makes diffing modifications cumbersome, especially when trying to share parts of my settings in a Git repository. I needed a way to dump and restore only some parts of my settings.

Xfconf is the daemon storing and providing most Xfce configuration values, called properties. Sadly, it is not possible to manipulate these values without building against libxfconf, which itself uses Glib, which I simply don’t know and don’t want to use, either as a C program or using FFI. The lazy way is to use xion-query, a modified build of the xfconf-query CLI tool.

> Why don’t you just use xfconf-query?

It simply does not have a very machine-readable interface, so Xion uses a modified build to work smoothly, removing some output aimed at humans and adding value types to its output. I tried to make it easy to get xion-query.

Installation

### Get xion-query

Go to my [Xfconf fork](https://github.com/Dece/xfconf/releases/) to get a build or find instructions on how to build it.

If you want to build it manually, checkout the tags named “xion-<VERSION>”. It is possible to build xion-query with Docker if you don’t want to mess around finding the various dependencies.

Once you have your build, name it xion-query, make it executable and place it somewhere in your path, e.g. in /usr/local/bin/.

### Get xion

Xion is available on PyPI:

`bash # Install system-wide. $ sudo pip3 install xion # Install for your user. $ pip3 install xion --user `

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

xion-0.0.2-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file xion-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: xion-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 7.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.7.3

File hashes

Hashes for xion-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a8123972590511ac66f285a4f1bd5d4edc33ba2b7551d2a9eee3eeabaa54be9c
MD5 96d92d93b16fb7110b9a738c32f7949d
BLAKE2b-256 28476d31929ed09cf03a7f5be11fb5b312c40a6e454a04040821bd3f14cc92df

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