Merge branch 'fix_group_index' into 'master'

Group index fix

Check group index lower limit 

See merge request hyask/swaysome!9
This commit is contained in:
Nabos 2023-01-17 14:50:02 +00:00
commit dd22264536

View file

@ -413,6 +413,7 @@ fn focus_to_group(stream: &UnixStream, group_index: usize) {
current_workspace_index - (current_workspace_index / 10) * 10;
let target_workspace_index = group_index * 10 + contextual_target_workspace_index;
println!("{target_workspace_index}");
// If the workspace already exists
match workspaces.iter().find(|w| w.num == target_workspace_index) {
@ -435,7 +436,7 @@ fn focus_to_group(stream: &UnixStream, group_index: usize) {
),
None => {
// Or if the targeted output is currently connected
if group_index <= outputs.len() {
if group_index != 0 && group_index <= outputs.len() {
Some(group_index)
} else {
None