diff --git a/README.md b/README.md index 631cb26..20c1c2f 100644 --- a/README.md +++ b/README.md @@ -80,10 +80,10 @@ bindcode --to-code $mod+Ctrl+9 exec "swaysome focus-group 9" bindcode --to-code $mod+Ctrl+0 exec "swaysome focus-group 0" # Move focused container to next output -bindsym $mod+o exec "swaysome next_output" +bindsym $mod+o exec "swaysome next-output" # Move focused container to previous output -bindsym $mod+Shift+o exec "swaysome prev_output" +bindsym $mod+Shift+o exec "swaysome prev-output" # Init workspaces for every screen exec "swaysome init 1" @@ -116,3 +116,6 @@ as usual. * `init [name]`: cycle all outputs to create a default workspace with name `[name]` * `rearrange-workspaces` Rearrange already opened workspaces to the correct outputs +## Breaking changes + +* Starting with 1.1.6, `next_output` and `prev_output` have been changed to `next-output` and `prev-output`. diff --git a/src/main.rs b/src/main.rs index 9581223..67c9a31 100644 --- a/src/main.rs +++ b/src/main.rs @@ -204,7 +204,7 @@ fn get_current_output_index(stream: &UnixStream) -> usize { let outputs = get_outputs(stream); match outputs.iter().position(|x| x.focused) { - Some(i) => i + 1, + Some(i) => i, None => panic!("WTF! No focused output???"), } } @@ -494,9 +494,9 @@ fn move_container_to_next_or_prev_output(stream: &UnixStream, go_to_prev: bool) let focused_output_index = get_current_output_index(stream); let target_output = if go_to_prev { - &outputs[(focused_output_index + outputs.len() - 1) % outputs.len() - 1] + &outputs[(focused_output_index + outputs.len() - 1) % outputs.len()] } else { - &outputs[(focused_output_index + 1) % outputs.len() - 1] + &outputs[(focused_output_index + 1) % outputs.len()] }; let workspaces = get_workspaces(stream); @@ -545,9 +545,13 @@ fn init_workspaces(stream: &UnixStream, workspace_index: usize) { send_command(stream, &cmd); let mut cmd: String = "workspace number ".to_string(); - let full_ws_name = format!("{}{}", get_current_output_index(stream), &workspace_index) - .parse::() - .unwrap(); + let full_ws_name = format!( + "{}{}", + get_current_output_index(stream) + 1, + &workspace_index + ) + .parse::() + .unwrap(); cmd.push_str(&full_ws_name.to_string()); send_command(stream, &cmd); }