Commit graph

50 commits

Author SHA1 Message Date
Skia
9772931af9 get_output: always filter out inactive outputs 2023-03-09 23:50:02 +01:00
Nabos
cf86c9bd22 Added move-to-group 2023-03-03 14:41:51 +00:00
Skia
faf309ce81 Output: set a default for 'active' instead of failing 2023-02-07 11:32:38 +01: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
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
Nabos
1c8ab4246a Fix minimum output index 2022-12-23 09:59:06 +01:00
Nabos
a0dc360e37 Removed debug print 2022-12-23 09:10:58 +01:00
Nabos
4620e8ab2c Fix focus to group when already existing group 2022-08-25 15:25:32 +02:00
Nabos
4ec989ed72 Fix focus to group when no existing workspace 2022-08-23 15:14:19 +02:00
Nabos
72c34cb5e5 Fix focus next/prev group 2022-08-17 14:14:48 +02:00
Nabos
b6f81aa7bb Finished workspace groups 2022-08-17 11:17:47 +02:00
Nabos
286760ade6 Added Groups 2022-08-11 17:36:34 +02:00
Nabos
dd848dfe04 Strongly typed workspace indexes and output indexes 2022-08-05 12:58:39 +02:00
Nabos
6fe7ca7bc3 Check for screen number 2022-08-05 12:56:00 +02:00
Nabos
b39b51ad58 Added a rearrange workspaces feature 2022-08-03 16:05:38 +02:00
Nabos
90e1e46fb2 Reworked argument parsing 2022-08-03 16:04:56 +02:00
Daniel Albert
2497f0519f Fix #4: Add workaround for missing focused property in outputs
If there is an inactive input, then the `focused` property may be missing in sway's response to a `get_output` message.
This fix uses a feature of serde where default values for missing fields can be defined.
Here, the `Default::default` for booleans is used, which is `false`.
2022-05-22 21:15:00 +02:00
Skia
1e6986558d Fix underflow in 'prev_output' calculation 2022-04-12 23:53:58 +02:00
Skia
465a4aff84 Fix all cargo clippy reports 2022-04-12 23:53:27 +02:00
Skia
9af265efbe Use clap's 'crate_version' macro to avoid further mess 2022-04-12 23:33:17 +02:00
Skia
57272671ed Always sort lists of objects returned by sway
Fixes #2
2021-11-07 00:54:32 +01:00
Skia
aa2a232320 Use more strongly typed JSON for Output and Workspace 2021-11-07 00:53:16 +01:00
Skia
ae9eb161fe Release 1.1.2
New repository, homepage, install instruction, etc...
No code change.
2021-10-16 14:15:14 +02:00
Skia
6f72380643 Release 1.1.1
Fix crash with disabled outputs
2021-10-15 10:21:02 +02:00
Skia
81fb306aec init: ignore disabled outputs 2021-10-15 10:14:44 +02:00
Skia
780e54abd4 Release 1.1.0
Many code improvements, plus add compatibility with sworkstyle.
2021-09-07 17:13:40 +02:00
Skia
ee9750fc57 Use 'workspace number' feature of sway
This allows compatibility with e.g. `sworkstyle`, as we don't rely on
workspace names any more.
2021-09-07 17:13:40 +02:00
Skia
25c7a2cc62 cargo fmt 2021-09-07 17:13:40 +02:00
Skia
b9d67f5975 Clean build warnings and improve log output 2021-09-07 17:13:40 +02:00
Skia
21ea0166f7 Factorize to a 'send_command' function 2021-09-07 15:09:55 +02:00
Skia
dc5aff5bd8 Make use of stderr 2021-09-07 15:09:37 +02:00
Skia
7653a4cad2 Use 'clap' for better argument parsing 2021-09-07 14:14:54 +02:00
Skia
dcb5222ee2 Add argument to init, to avoir hardcoded default workspace 2021-03-02 18:08:36 +01:00
Skia
dfee3d9bbb Add 'focus_all_outputs_to_workspace' 2021-03-02 18:06:10 +01:00
Skia
50ed528df7 Rename 'get_current_output_name' -> 'get_current_output_index' 2021-02-19 11:33:42 +01:00
Skia
9200db526a Don't use well-typed structs anymore
This can lead to maintainance problems if `sway` decides to change a
structure by only a field that we don't even use.
This seems to already happen if you have an output declared in your `sway`
configuration that is unplugged.
2021-02-11 11:59:34 +01:00
Skia
e2f59801d0 Allow moving focused container across outputs 2021-01-15 01:15:29 +01:00
Skia
776bf3aaf0 Remove unused 'get_current_workspace_name' 2021-01-15 01:12:26 +01:00
Skia
8a6a727b69 Move 'get_workspaces' to its own function 2021-01-15 01:11:32 +01:00
Skia
84820a07d0 Move 'get_outputs' to a separate function 2021-01-15 01:07:17 +01:00
Skia
38d685b252 Add debugging capabilities to the structs 2021-01-15 01:06:43 +01:00
Skia
efc0fe474f Add 'init' command 2021-01-06 11:40:27 +01:00
Skia
81d3d6f2d4 Improve a bit error handling 2021-01-06 11:40:00 +01:00
Skia
9b8a86dbe3 Make some clean up 2021-01-06 11:39:44 +01:00
Skia
992800800b First 'working' version 2020-12-26 04:28:06 +01:00
Skia
2a7a77b0ab Add read_msg 2020-12-26 03:13:37 +01:00
Skia
7ef8a7ccc1 First 2020-12-23 18:29:31 +01:00