Package: i3configger
i3configgerDisclaimer:this is a tool aimed at users who already know how the configuration ofi3works (as described in theexcellent docs).i3configgeris an independent add-on, not directly affiliated with the project and in no way necessary to use i3 productively.NOTEusingi3configgerwill replace your existing config files (configand optional status bar configs), but it will move them to<original-name>.bakif no backup exists yet, so that you can easily revert the damage if you want to go back to your old files.Why?I wanted to be able to switch between different color themes and do things like hide the i3bar with a keyboard shortcut.i3configgermakes this and other dynamic changes possible without changing i3wm itself.Main characteristicssame config language as i3with these differences:possibility to spread config over several filespossibility to assign variables to variablesvariables in i3status configs are also resolved (set them anywhere in the sources)additional configuration ofi3configgeritself and persistence of changes to the i3 configuration is achieved by sprinkling a bit of json on top of the config files.command line driven - activities can be bound to keyboard shortcuts directly or as part of abinding modeHow?In the end i3wm needs a config file it can cope with and it needs to reload or restart, when something changes.This is realized by adding a build step that can be triggered by callingi3configgerdirectly or by running it as a [daemonized] watcher process that automatically rebuilds and reloads when source files change or messages are sent.What can I do with it?Switch between arbitrary "schemes"You can switch sub configurations (e.g. different color schemes) that conform with a simple naming convention (config.d/<key>.<value1>.conf,config.d/<key>.<value2>.conf, etc.) by invoking e.g.i3configger select-next <key>ori3configger select <key> <value2>.To get an idea what can be done, have a look at theexamplesandread the docs.Override any variableYou can change any variable you have defined in the configuration by invokingi3configger set <variable name> <new value>. These changes are persisted not in the config itself but in an additional file.Seei3configger docsfor a detailed explanation of the concept and other possible commands.Usage exampleHere is a snippet from an i3 config that uses a mode to alter itself by sending messages toi3configger:set $i3cBin ~/.virtualenvs/i3/bin/i3configger

bindsym $win+w mode "i3configger"
mode "i3configger" {
    bindsym Right exec "$i3cBin select-next colors --i3-refresh-msg restart"
    bindsym Left exec "$i3cBin select-previous colors --i3-refresh-msg restart"
    bindsym Up exec "$i3cBin shadow bars:targets:laptop:mode dock"
    bindsym Down exec "$i3cBin shadow bars:targets:laptop:mode hide"
    bindsym Return mode "default"
    bindsym Escape mode "default"
}Explanation of the messages used:select[...]integrates different config partials and can therefore make broad changes. In this case for example there are differentcolors.<value>.confpartials that activate different color schemesshadowadds an overlay that in this case changes the mode of the laptop bar betweenhideanddockInstallation$ pip install i3configgerSeedocsFor more details and different ways of installation.Some inspiration from the i3 project... that I would also like to heed for this project:Never break configuration files or existing workflows. Breaking changes require a major version bump (v4 → v5).Keep mental complexity low: once you know i3’s key features, other features should be easy to understand.Only add features which benefit many people, instead of going to great lengths to support rarely used workflows.Only documented behavior is supported. Clear documentation is a requirement for contributions.CHANGELOG0.9.1.post1 (Never too late to botch up the changelog) - 2018-12-28Fixedbroken changelog0.9.1 (Never too late to make stupid mistakes) - 2018-12-28Fixedcrash when executing command due to forgotten explicit self0.9.0 (A new beginning) - 2018-12-19Addedwhere it makes sense, defaults for command line settings can be changed in i3configger.json (command line overrides settings in config)make status command configurable (for refresh)off-switch for ipc configuration (for easier testing)functional tests for main cli functionalityChangedkeep Python version in sync with Arch system Python: test with Python 3.7breaking changes in i3configger.json - check examples to see what is different. Easiest way to upgrade is to move your old config to the side, run i3configger to generate a new default config and add your settings from the old config back in.terminology: i3status -> i3barterminology: value -> selectinternal modernization and refactoringFixedwrong use of reversed in select-next/previousRemovedoption for different config has no real use and unnecessarily complicates things0.8.0 (Naming things is hard) - 2017-06-20ChangedName for i3bar key is fixed toi3bar- no need to be configurableFixeddon't crash if no i3bar config file was yet generatedterminology i3status -> i3bar0.7.7 (It's just getting better and better) - 2017-06-16Addedresolve variables with as many levels of indirections as you wantif resolving fails proper feedback about the failing path is givenbetter error handling/notification, when config is brokentests for resolving contextsFixedwatch process does not crash anymore but gives proper feedbackdon't crash if switching without a default in .messages.json0.7.6 (The devil is in the detail) - 2017-06-11Changeddo not add partial into config if it purely contains set statementsstrip empty lines from beginning and end of partials0.7.5 (Time to make an -git AUR?) - 2017-06-11Changedmake checks more forgiving if no i3 is installed - for testing a complete run after a PKGBUILD0.7.4 (Packaging is fun and good for testing) - 2017-06-11Changedimprove ipc handling - fix setting methods too late0.7.3 (Do the right thing) - 2017-06-11Fixeduse actual partials path for initialization instead of assuming that parent of config path == partials path0.7.2 (Need for speed) - 2017-06-11Changedshave off a few hundred precious milliseconds startup time, by moving the very expensive version fetching into a function that is only called, when the version is really needed.help the user, when they use a non existing commandremove unwanted side effects from messagewhen config.d already exists, but no i3configger.json exists yet, it is automatically created nowbetter examples/tests0.7.1 (The great packaging adventure begins) - 2017-06-10Changed(internal) vendor in a different inotify library that  makes it easier to package for Archlinux0.7.0 (Better safe than sorry) - 2017-06-10Changedalways create a backup of the users files if it does not exist already. Donotclobber it on subsequent builds to make sure you can always go back to your old files if needed, even if they have no external backups or SCM in place.0.6.0 (Command & Conquer) - 2017-06-10Fixedwrong ordering of context merges (set was not working in all cases)Addednew command: shadow - shadow arbitrary entries ini3configger.jsonnew command: merge - merge a.jsonfile into.messages.jsonnew command: prune - opposite of merge: remove all keys from a given.jsonfile in.messages.jsonChangedrenamed file containing frozen messages from.state.jsonto.messages.json0.5.3 (KISS) - 2017-06-09Changedde-rocket-science release processchange description of tool0.5.2 (Releasing correctly is hard) - 2017-06-09Fixedwrong CHANGELOG :)0.5.1 (Maybe I should test more) - 2017-06-09Fixed#4 repair watch and daemon mode0.5.0 (Half way there) - 2017-06-08Addedproper documentation athttp://oliver.bestwalter.de/i3configger/copy user or default config intoconfig.don initializationRemovedend of line comments are not supported anymore (too much bug potential - would need some form of parsing already to make it work -> not worth the fuzz)Changedcomments are not stripped from the build anymorenotification is off by default: cli arg changed from--no-notify-to--notifyFixedchecking the config withi3 -Cdid not work because-c(small c) was not passed and the passed path to the new config was silently ignored and the active config was checked instead0.4.4 (I am not alone) - 2017-06-05Fixed#2 - fails if not using i3status. Fixed by making the refresh call ignore any errors - not nice, just a quick fix.0.4.3 - (The Curious Incident of the Dog in the Night-Time) - 2017-06-04Addedexamples that are used as test casesFixedsome small fixes regarding selection0.4.2 (The answer) - 2017-06-03Basic implementationbuild main config and one or several i3status configs from the same sourcesvariables are handled slightly more intelligently than i3 does it (variables assigned to other variables are resolved)end of line comments are possible (removed at build time)variables in i3status configs are also resolved (set anywhere in the sources)reload or restart i3 when a change has been done (usingi3-msg)notify when new config has been created and activated (usingnotify-send)simple way to render partials based on key value pairs in file namesimple way to change the configuration by sending messagesbuild config as one shot script or watch for changessend messages to watching i3configger processifi3 -C failswith the newly rendered config, the old config will be kept, no harm doneNote:format based on:Keep a Changelogproject adheres toSemantic Versioning.