Skip to main content

i3 config generation tool

Project description

Project Status: Active – The project has reached a stable, usable state and is being actively developed.

Generate i3 config files from a set of partials in a config folder. Do some nifty conditional integration and variable resolution (also for i3status configs). This makes switching of themes (optical or via key binding or whatever) possible.

Why?

  • To be able to switch parts of the config dynamically depending on selectors

  • To be able to assign variables to variables and use variables in the status bar configurations

  • To be able to split my long and messy config file in many short, aptly named, messy config partials

How?

This can best be understood by how I use this to generate my own i3 config - here are the config partials: .i3/config.d

The call

$ i3configger --select-host=$(hostname) --select-theme=solarized-dark

creates config and i3status.main.conf from the sources.

The idea is simple:

Config partials that follow the naming scheme <selector>.<name>.conf are only rendered into the config if explicitly requested.

  • The partial host.ob1.conf will be rendered if the option --select-host=ob1 is passed to i3configger.

  • The partial theme.solaris-dark.conf will only be rendered if --select-theme=solaris-dark is passed.

host and theme are selector names I chose for my use case, but they can be freely chosen as long as the naming scheme is adhered to.

Features

  • build main config and one or several i3status configs from the same sources

  • render variables slightly more intelligently than i3 does it

  • also render variables in i3status configs (set anywhere in the sources)

  • reload or restart i3 when a change has been done (using i3-msg)

  • notify when new config has been created and activated (using notify-send)

  • simple way to render partials based on selectors (see example above)

  • simple way to communicate settings to renderer ($i3configger_key value)

  • build config as one shot script or watch for changes (foreground and daemon)

Some things are still in the air - see notes.

Installation

You should install this into a Python 3.6 interpreter.

i3configger is released on the Python Package Index. The standard installation method is:

$ pip install i3configger

Usage

Default renders and merges ``.config`` files in ``~/.i3/config.d`` and writes to ``~/.i3/config`` and to i3status files determined by ``$i3configger_i3status`` settings.

one shot:

$ i3configger

as daemon:

$ i3configger --daemon

more info:

$ i3configger --help

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

i3configger-0.2.2.tar.gz (12.4 kB view details)

Uploaded Source

File details

Details for the file i3configger-0.2.2.tar.gz.

File metadata

  • Download URL: i3configger-0.2.2.tar.gz
  • Upload date:
  • Size: 12.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for i3configger-0.2.2.tar.gz
Algorithm Hash digest
SHA256 5fa423629c5b4d58c2a9d1e9ba725e7dd1cacdaa11e10306d20d5e2248adc882
MD5 96d87d20413340b25be14b3052844e3f
BLAKE2b-256 be4cdbc34bce4fbc499ba9bbf0f5d396c0fd03c175719dd18f39351c58137907

See more details on using hashes here.

Supported by

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