* Added some tests, and discovered some bugs along the way
* Fixed those afformentioned bugs 🎉
* Some codebase rework, needed to add the afformentioned tests
This branch adds a whole bunch of rework and now has integration tests.
The coverage might not be perfect, but it's a pretty good start that
should give some confidence in case of any sort of rework.
Implement the following logic:
* first try SWAYSOCK
* if failed, then try I3SOCK, the legacy one coming from i3
* if failed, then we abort with an error
Added constant for maximum workspaces per group instead of hardcoded 10
Hello creators of swaysome.
I love this program, its quite nice, thank you for sharing it ^.^
However, I can't live with just 10 workspaces per group, I need more.
So, instead of having the base 10 hard-coded all around, I created a constant, which I named `MAX_GROUP_WS` due to my super creative naming skills. This way, anyone could change the groups naming and the limit of workspaces with just modifying a simple constant.
Examples:
```
MAX Naming
10 → 17, 27
100 → 107, 207
1000 → 1007, 2007
15 → 22, 37
```
On my local setup I use 100, so its easy to know which group I'm in, and I recommend others to either use 10 or 100. That said, nothing prevents you from using other bases, such as hexadecimal (16), or 69...
To keep backwards compatibility, and not break any setup, I kept the default as `10`.
If you like my change, feel free to merge it!
See merge request hyask/swaysome!12
Note about (un)bindcode or (un)bindsym and order numbering
Added a note about using either (un)bindcode or (un)bindsym and re-ordered numbering to use single digits instead of double digits in the README.
See merge request hyask/swaysome!11
Workspaces groups
This feature brings a lot of new possibilities.
A workspace group is group of ten workspaces inside a decimal range (ex: from 10 to 19).
It introduces `relative` and `absolute` scopes.
For a move or a focus, if the target index is only one digit it will focus the wanted workspace relative to the current group focused.
But if the target index is above 9, it will directly focus the workspace inside the group if it is already opened, if not, it will open the group on the current screen.
Example 1: I'm focused on 21. If I do `swaysome focus 5` it's going to focus the workspace 25 on the same output than the other 20s.
Example 2: I'm focused on 21. If I do `swaysome focus 35` it's going to focus the workspace 35. If there is no 30s opened yet, it's going to open it on my current screen, but I already have 32 opened on another screen, so it's going to open the workspace 35 on it.
It also brings the `next-group` and `prev-group` features to switch focus from 21 to 31 or 21 to 11 for example.
There is the `focus-group` action that allows you to directly focus a specified group and so creating multiple workspace groups on one output (For example, 20s for work and 30s for private stuff).
There is one breaking behavior: I had to edit the `init` function to begin from 10 and not from 1.
So with `swaysome init 1`, a triple screen is now initialized like this: 11, 21, 31 instead of 1, 11, 21.
See merge request hyask/swaysome!6