Commit graph

108 commits

Author SHA1 Message Date
Skia
a8a80eb514 Simplifications and bugfixes discovered when writing tests 2025-04-13 14:58:42 +02:00
Skia
3f61dbda90 Add some integration tests 2025-04-13 14:58:42 +02:00
Skia
f7bcdf1296 lib: refactor SwaySome::new to also have SwaySome::new_from_socket
`SwaySome::new_from_socket` takes a socket path in argument.
This allows the tests to be able to build a SwaySome instance with a
custom socket path.
2024-11-04 18:03:17 +01:00
Skia
ffc73fd832 lib: add get_tree, useful for testing 2024-11-04 17:58:24 +01:00
Skia
ab32878de5 lib: remove useless headers 2024-11-04 17:57:59 +01:00
Skia
e5c61a8694 Split the whole thing into a lib and tiny main
This is how binaries are supposed to be done in Rust, to help with
integration testing. Guess what's coming?
2024-11-02 19:46:34 +01:00
Skia
191a5ab001 man: small phrasing improvement 2024-11-02 19:46:34 +01:00
Skia
bc80f6a650 Release 2.1.2 - one bugfix and some doc 2024-10-15 17:25:13 +02:00
Skia
c5930274e5 Correctly wrap around when changing workspace group
Fix #19
2024-10-12 15:35:11 +01:00
Skia
df9b26335f Merge branch 'void' into 'master'
README: add instructions to install on Void Linux

Added in https://github.com/void-linux/void-packages/pull/49049 

See merge request hyask/swaysome!13
2024-07-29 07:59:52 +00:00
Luca Matei Pintilie
41227bac8b
README: add instructions to install on Void Linux 2024-07-26 19:11:19 +02:00
Skia
1f8ccb0207 Release 2.1.1 - documentation update only 2024-02-23 11:21:32 +01:00
Skia
a399d827de Greatly improve the man page 2024-02-16 17:07:12 +01:00
Skia
83c454cd6a Add manpage 2024-01-29 16:54:10 +01:00
Skia
f336a437c2 Improve README and put default config in a separate file 2024-01-29 16:54:10 +01:00
Skia
b36ba07d06 Release 2.1.0 2023-11-30 16:18:38 +01:00
Skia
5f2cd2b300 README: add a link to the Matrix room 2023-11-27 11:27:35 +01:00
Skia
aa3b47fbad get_current_*: don't use outdated cache is these functions
Fixes https://gitlab.com/hyask/swaysome/-/issues/18
Thanks a lot @mahieujeremy for reporting that and providing a fix so quickly!
2023-11-27 11:12:33 +01:00
Skia
9da99893c4 Improve documentation and default config 2023-11-17 17:56:17 +01:00
Skia
36c1ef68da Cargo: bump all dependencies 2023-11-17 17:55:48 +01:00
Skia
3ccf1d6eda Add WorkspaceGroup{Next,Prev}Output command 2023-11-16 15:20:54 +01:00
Skia
90ec4a2566 Rework everything to have a global SwaySome object with methods in it
This allows easily keeping state across the various function calls.
2023-11-14 09:44:36 +01:00
Skia
99a99648b1 simplify clap structures 2023-11-13 15:52:39 +01:00
Skia
6d8c19e8a7 cargo fmt 2023-11-13 15:42:25 +01:00
Skia
6d26286583 Improve socket discovery, handling, and logging
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
2023-11-07 08:36:10 +02:00
Skia
cdd5a24dc6 Merge branch 'master' into 'master'
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
2023-06-06 08:41:39 +00:00
LluisE
91f697cb42 Feature MAX_GROUP_WS constant instead of hardcoded 10 2023-06-05 20:37:19 +02:00
Skia
c24d02e284 Merge branch 'master' into 'master'
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
2023-05-02 08:37:40 +00:00
Andrei S
05ca3b8f4a Note about (un)bindcode or (un)bindsym and order numbering 2023-04-27 12:02:41 +00:00
Skia
9772931af9 get_output: always filter out inactive outputs 2023-03-09 23:50:02 +01:00
Skia
7b3de58cd9 README: improved description to include workspace groups 2023-03-03 17:50:21 +01:00
Skia
7daf8ffd77 Release 2.0.0 2023-03-03 17:13:46 +01:00
Nabos
bc8ac73ddb Adding Nabos to authors 2023-03-03 16:12:49 +01:00
Nabos
4e7eed7b99 Merge branch 'move_to_group' into 'master'
Added move-to-group

 

See merge request hyask/swaysome!10
2023-03-03 14:41:51 +00:00
Nabos
cf86c9bd22 Added move-to-group 2023-03-03 14:41:51 +00:00
Skia
2541b0aa2c README: add a mention about '$PATH' issues (#11) 2023-03-02 12:49:10 +01:00
Skia
faf309ce81 Output: set a default for 'active' instead of failing 2023-02-07 11:32:38 +01:00
Skia
13b9687c0a README: small form improvements 2023-02-07 11:16:37 +01:00
Nabos
dd22264536 Merge branch 'fix_group_index' into 'master'
Group index fix

Check group index lower limit 

See merge request hyask/swaysome!9
2023-01-17 14:50:02 +00:00
Nabos
0db1faa1c5 Check group index lower limit 2023-01-17 15:47:27 +01:00
Skia
1234264d75 Merge branch 'workspaces_groups' 2023-01-16 11:27:38 +01:00
Skia
e8fc73c5da Merge branch 'workspaces_groups' into 'master'
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
2023-01-16 10:26:23 +00:00
Skia
0566cf106e README: fix '{next,prev}-output' and add 'Breaking changes' section 2023-01-16 11:15:01 +01:00
Skia
5380131ee9 Fix 'move_container_to_next_or_prev_output' and 'current_output_index' 2023-01-16 11:11:03 +01:00
Skia
29a0afe619 Merge branch 'cli_parser_argument_types' into 'master'
Cli parser argument types

Just a little stronger typing on the CLI arguments 

See merge request hyask/swaysome!5
2023-01-13 16:09:43 +00:00
Skia
dfb6e79a3a Merge branch 'rearrange_workspaces' into 'master'
Rearrange workspaces

Based of the args parser rework, I added a feature to rearrange the missplaced workspaces.
It is useful when you unplug a screen, create a workspace then plug the screen back.
In this scenario, the screen won't move back to the correct screen when the screen is plugged back.
I don't know if there could be a way to fix this behavior instead of creating a feature to repair it each time.
Let me know what you think 

See merge request hyask/swaysome!4
2023-01-13 16:08:40 +00:00
Nabos
1c8ab4246a Fix minimum output index 2022-12-23 09:59:06 +01:00
Nabos
1334bde4bd Updated Readme 2022-12-23 09:25:13 +01:00
Nabos
a0dc360e37 Removed debug print 2022-12-23 09:10:58 +01:00
Skia
997f50c759 Merge branch 'Renner0E-master-patch-46524' into 'master'
readme: install option for arch

 

See merge request hyask/swaysome!8
2022-11-30 08:55:13 +00:00