mirror of
https://gitlab.com/hyask/swaysome.git
synced 2025-12-10 07:44:43 +01:00
Merge branch 'workspaces_groups'
This commit is contained in:
commit
1234264d75
2 changed files with 15 additions and 8 deletions
|
|
@ -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`.
|
||||
|
|
|
|||
16
src/main.rs
16
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::<i32>()
|
||||
.unwrap();
|
||||
let full_ws_name = format!(
|
||||
"{}{}",
|
||||
get_current_output_index(stream) + 1,
|
||||
&workspace_index
|
||||
)
|
||||
.parse::<i32>()
|
||||
.unwrap();
|
||||
cmd.push_str(&full_ws_name.to_string());
|
||||
send_command(stream, &cmd);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue