updated readme

This commit is contained in:
Tomas Baca 2018-09-03 00:36:33 +02:00
parent 56ab02d2c5
commit 2b391d075c

View file

@ -5,6 +5,12 @@ Video:
[![Play video](https://img.youtube.com/vi/Q0qlUfG_lZ0/0.jpg)](https://www.youtube.com/watch?v=Q0qlUfG_lZ0)
Features:
* saving a layout (including floating windows)
* restoring the layout on any workspace
* rearranging existing windows as well as preparing the layout for new windows
* layout management using _rofi_
## Preamble - don't worry, I solved all of this
i3 window manager supports saving and loading of window layouts, however, the features are bare-bone and partially missing.
@ -30,14 +36,15 @@ Currently, its a hacky-type of a shell script, but feel free to contribute :-).
2. The tree for all workspaces on the currently focused monitor exported using ```i3-save-tree --output ...```
3. The location of the current workspace in the all-tree is found by matching the workspace-tree file on the monitor-tree file.
4. The parameters of the root split are extracted, and the workspace tree is wrapped in a new split.
5. The user is then asked about how should the windows be matched. The options are:
5. The floating windows are extreacted from within and appended behind the root split.
6. The user is then asked about how should the windows be matched. The options are:
* All by _instance_ (instance will be uncommented for all windows)
* Match any window to any placeholder
* Choose an option for each window. The user will be asked to choose between the _class_, _instance_ and _title_ for each window. The tree file will be modified automatically according to the selected options.
![matching](misc/choice_matching.jpg)
6. After that, the tree is saved and ready to be loaded.
7. The user can load the layout either before opening windows, which creates placeholders, or after, which adds the existing windows to the layout. The second part normally does not work.
8. To apply a layout, we first move all windows containing a process from the workspace using `xdotool`, which leaves only placeholders. Then we kill all the old placeholders before we apply the layout, which spawns new placeholders in the correct places. Lastly, we move the windows back, which triggers the _swallow_ mechanism in the same way, as newly create windows do.
7. After that, the tree is saved and ready to be loaded.
8. The user can load the layout either before opening windows, which creates placeholders, or after, which adds the existing windows to the layout. The second part normally does not work.
9. To apply a layout, we first move all windows containing a process from the workspace using `xdotool`, which leaves only placeholders. Then we kill all the old placeholders before we apply the layout, which spawns new placeholders in the correct places. Lastly, we move the windows back, which triggers the _swallow_ mechanism in the same way, as newly create windows do.
## How to use it?
@ -73,7 +80,19 @@ sudo apt-install jq vim rofi xdotool x11-xserver-utils
## FAQ
* Why do you use vim for the automated file editing?
* **Does it work on floating windows?**
`Vim is great for this kind of work. A simple one-liner can do complex edits which would be difficult to program even using, e.g., python. Thanks to this, the layout manager was hacked up in a single day.`
Yes
* **Will it run the programs for me?**
Nope. It is not intended to do that. The layout manager only automates the already built-in features of i3. Running programs is a different matter than applying layout.
* **Does it move windows across workspaces?**
No, it only affects the current workspace. However, layouts can be used on another workspace than they had been created on.
* **Why do you use vim for the automated file editing?**
Vim is great for this kind of work. A simple one-liner can do complex edits which would be difficult to program even using, e.g., python. Thanks to this, the layout manager was hacked up in a single day.