mirror of
https://gitlab.com/hyask/swaysome.git
synced 2025-12-10 07:44:43 +01:00
cargo fmt
This commit is contained in:
parent
6d26286583
commit
6d8c19e8a7
1 changed files with 24 additions and 6 deletions
30
src/main.rs
30
src/main.rs
|
|
@ -283,7 +283,10 @@ fn move_container_to_workspace_absolute(stream: &UnixStream, workspace_index: us
|
|||
let group_index = (workspace_index / MAX_GROUP_WS) as usize;
|
||||
let outputs = get_outputs(stream);
|
||||
let workspaces = get_workspaces(stream);
|
||||
let full_ws_name = format!("{}", group_index * MAX_GROUP_WS + workspace_index % MAX_GROUP_WS);
|
||||
let full_ws_name = format!(
|
||||
"{}",
|
||||
group_index * MAX_GROUP_WS + workspace_index % MAX_GROUP_WS
|
||||
);
|
||||
|
||||
// If the workspace already exists
|
||||
match workspaces.iter().find(|w| w.num == workspace_index) {
|
||||
|
|
@ -294,7 +297,10 @@ fn move_container_to_workspace_absolute(stream: &UnixStream, workspace_index: us
|
|||
}
|
||||
None => {
|
||||
let target_group = workspace_index / MAX_GROUP_WS;
|
||||
let target_screen_index = match workspaces.iter().find(|w| w.num / MAX_GROUP_WS == target_group) {
|
||||
let target_screen_index = match workspaces
|
||||
.iter()
|
||||
.find(|w| w.num / MAX_GROUP_WS == target_group)
|
||||
{
|
||||
// If other workspaces on the same group exists
|
||||
Some(other_workspace) => Some(
|
||||
outputs
|
||||
|
|
@ -400,7 +406,10 @@ fn focus_to_workspace_absolute(stream: &UnixStream, workspace_index: usize) {
|
|||
}
|
||||
None => {
|
||||
let target_group = workspace_index / MAX_GROUP_WS;
|
||||
let target_screen_index = match workspaces.iter().find(|w| w.num / MAX_GROUP_WS == target_group) {
|
||||
let target_screen_index = match workspaces
|
||||
.iter()
|
||||
.find(|w| w.num / MAX_GROUP_WS == target_group)
|
||||
{
|
||||
// If other workspaces on the same group exists
|
||||
Some(other_workspace) => Some(
|
||||
outputs
|
||||
|
|
@ -457,7 +466,10 @@ fn focus_to_group(stream: &UnixStream, group_index: usize) {
|
|||
let target_workspace_relative_index = current_workspace_index % MAX_GROUP_WS;
|
||||
|
||||
let target_workspace_index = group_index * MAX_GROUP_WS + target_workspace_relative_index;
|
||||
let full_ws_name = format!("{}", group_index * MAX_GROUP_WS + target_workspace_relative_index);
|
||||
let full_ws_name = format!(
|
||||
"{}",
|
||||
group_index * MAX_GROUP_WS + target_workspace_relative_index
|
||||
);
|
||||
|
||||
// If the workspace already exists
|
||||
match workspaces.iter().find(|w| w.num == target_workspace_index) {
|
||||
|
|
@ -467,7 +479,10 @@ fn focus_to_group(stream: &UnixStream, group_index: usize) {
|
|||
send_command(stream, &focus_cmd);
|
||||
}
|
||||
None => {
|
||||
let target_screen_index = match workspaces.iter().find(|w| w.num / MAX_GROUP_WS == group_index) {
|
||||
let target_screen_index = match workspaces
|
||||
.iter()
|
||||
.find(|w| w.num / MAX_GROUP_WS == group_index)
|
||||
{
|
||||
// If other workspaces on the same group exists
|
||||
Some(other_workspace) => Some(
|
||||
outputs
|
||||
|
|
@ -550,7 +565,10 @@ fn move_container_to_next_or_prev_output(stream: &UnixStream, go_to_prev: bool)
|
|||
.find(|x| x.output == target_output.name && x.visible)
|
||||
.unwrap();
|
||||
let group_index = (target_workspace.num / MAX_GROUP_WS) as usize;
|
||||
let full_ws_name = format!("{}", group_index * MAX_GROUP_WS + target_workspace.num % MAX_GROUP_WS);
|
||||
let full_ws_name = format!(
|
||||
"{}",
|
||||
group_index * MAX_GROUP_WS + target_workspace.num % MAX_GROUP_WS
|
||||
);
|
||||
|
||||
// Move container to target workspace
|
||||
let mut cmd: String = "move container to workspace number ".to_string();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue