Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
berezowski authored Sep 22, 2024
1 parent 72708da commit adeda6d
Showing 1 changed file with 58 additions and 56 deletions.
114 changes: 58 additions & 56 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Also it seconds as a binary for selecting, or renaming workspaces in rofi.

##### e.g. Next Workspace while multiple monitors are connected
```
/usr/bin/swaymsg_workspace next
~/.cargo/bin/swaymsg_workspace next
```
```mermaid
block-beta
Expand Down Expand Up @@ -56,7 +56,7 @@ block-beta

##### Select Workspace
```
/usr/bin/swaymsg_workspace next
~/.cargo/bin/swaymsg_workspace next
```
```mermaid
block-beta
Expand Down Expand Up @@ -85,7 +85,7 @@ block-beta
style G fill:#ccc,stroke:#333,stroke-width:4px
```
```
/usr/bin/swaymsg_workspace prev
~/.cargo/bin/swaymsg_workspace prev
```
```mermaid
block-beta
Expand All @@ -108,7 +108,7 @@ block-beta
```
##### Swap Workspace
```
/usr/bin/swaymsg_workspace swap_with_next
~/.cargo/bin/swaymsg_workspace swap_with_next
```
```mermaid
block-beta
Expand Down Expand Up @@ -137,7 +137,7 @@ block-beta
style G fill:#ccc,stroke:#333,stroke-width:4px
```
```
/usr/bin/swaymsg_workspace swap_with_prev
~/.cargo/bin/swaymsg_workspace swap_with_prev
```
```mermaid
block-beta
Expand All @@ -159,7 +159,7 @@ block-beta
```
##### Index Workspace
```
/usr/bin/swaymsg_workspace increase
~/.cargo/bin/swaymsg_workspace increase
```
```mermaid
block-beta
Expand Down Expand Up @@ -188,7 +188,7 @@ block-beta
style I fill:#ccc,stroke:#333,stroke-width:4px
```
```
/usr/bin/swaymsg_workspace decrease
~/.cargo/bin/swaymsg_workspace decrease
```
```mermaid
block-beta
Expand All @@ -211,7 +211,7 @@ block-beta
```
##### Rename Workspace
```
/usr/bin/swaymsg_workspace rename_to movies
~/.cargo/bin/swaymsg_workspace rename_to movies
```
```mermaid
block-beta
Expand All @@ -233,7 +233,7 @@ block-beta
```
##### Select Workspace while multiple monitors are connected
```
/usr/bin/swaymsg_workspace number 5
~/.cargo/bin/swaymsg_workspace number 5
```
```mermaid
block-beta
Expand Down Expand Up @@ -273,68 +273,70 @@ https://github.com/user-attachments/assets/7169c4ec-6c15-4ab4-a7ec-35b221379996

## Installation

#### Clone repo and go to Project directory
```
git clone https://github.com/berezowski/swaymsg_workspace.git
cd swaymsg_workspace
```
1. #### install Rust
https://www.rust-lang.org/tools/install

#### Switch to rust nightly channel
```
rustup override set nightly
```
The Rust installer comes with 'rustup' and 'cargo'.

#### Build an install binary
```
cargo install --path .
```
2. #### switch to rust nightly channel
```
rustup override set nightly
```

3. #### Build and install binary
```
cargo install --git https://github.com/berezowski/swaymsg_workspace
```
the compiled binary should be in
```~/.cargo/bin/swaymsg_workspace```

#### sway config
```

> cat ~/.config/sway/config |grep swaymsg_workspace
4. #### edit sway config
```
bindsym Mod1+Ctrl+Shift+n exec /usr/bin/swaymsg_workspace swap_with_next
bindsym Mod1+Ctrl+Shift+p exec /usr/bin/swaymsg_workspace swap_with_prev
bindsym Mod1+Ctrl+f exec /usr/bin/swaymsg_workspace decrease
bindsym Mod1+Ctrl+g exec /usr/bin/swaymsg_workspace increase
bindsym Mod1+Ctrl+n exec /usr/bin/swaymsg_workspace next
bindsym Mod1+Ctrl+p exec /usr/bin/swaymsg_workspace prev
> cat ~/.config/sway/config |grep swaymsg_workspace
bindsym --release Mod1+Ctrl+r exec /usr/bin/swaymsg_workspace rename_to $(rofi -dmenu -l 0 -P "rename workspace $(/usr/bin/swaymsg_workspace print_focused_name) to")
bindsym --release Mod1+Ctrl+space exec /usr/bin/rofi -show combi
bindsym Mod1+Ctrl+Shift+n exec ~/.cargo/bin/swaymsg_workspace swap_with_next
bindsym Mod1+Ctrl+Shift+p exec ~/.cargo/bin/swaymsg_workspace swap_with_prev
bindsym Mod1+Ctrl+f exec ~/.cargo/bin/swaymsg_workspace decrease
bindsym Mod1+Ctrl+g exec ~/.cargo/bin/swaymsg_workspace increase
bindsym Mod1+Ctrl+n exec ~/.cargo/bin/swaymsg_workspace next
bindsym Mod1+Ctrl+p exec ~/.cargo/bin/swaymsg_workspace prev
bindsym Mod1+Ctrl+0 exec /usr/bin/swaymsg_workspace number 10
bindsym Mod1+Ctrl+1 exec /usr/bin/swaymsg_workspace number 1
bindsym Mod1+Ctrl+2 exec /usr/bin/swaymsg_workspace number 2
bindsym Mod1+Ctrl+3 exec /usr/bin/swaymsg_workspace number 3
bindsym Mod1+Ctrl+4 exec /usr/bin/swaymsg_workspace number 4
bindsym Mod1+Ctrl+5 exec /usr/bin/swaymsg_workspace number 5
bindsym Mod1+Ctrl+6 exec /usr/bin/swaymsg_workspace number 6
bindsym Mod1+Ctrl+7 exec /usr/bin/swaymsg_workspace number 7
bindsym Mod1+Ctrl+8 exec /usr/bin/swaymsg_workspace number 8
bindsym Mod1+Ctrl+9 exec /usr/bin/swaymsg_workspace number 9
bindsym Mod1+Ctrl+Shift+0 exec /usr/bin/swaymsg_workspace move_container_to_workspace_number 10
bindsym Mod1+Ctrl+Shift+1 exec /usr/bin/swaymsg_workspace move_container_to_workspace_number 1
bindsym Mod1+Ctrl+Shift+2 exec /usr/bin/swaymsg_workspace move_container_to_workspace_number 2
bindsym Mod1+Ctrl+Shift+3 exec /usr/bin/swaymsg_workspace move_container_to_workspace_number 3
bindsym Mod1+Ctrl+Shift+4 exec /usr/bin/swaymsg_workspace move_container_to_workspace_number 4
bindsym Mod1+Ctrl+Shift+5 exec /usr/bin/swaymsg_workspace move_container_to_workspace_number 5
bindsym Mod1+Ctrl+Shift+6 exec /usr/bin/swaymsg_workspace move_container_to_workspace_number 6
bindsym Mod1+Ctrl+Shift+7 exec /usr/bin/swaymsg_workspace move_container_to_workspace_number 7
bindsym Mod1+Ctrl+Shift+8 exec /usr/bin/swaymsg_workspace move_container_to_workspace_number 8
bindsym Mod1+Ctrl+Shift+9 exec /usr/bin/swaymsg_workspace move_container_to_workspace_number 9
bindsym --release Mod1+Ctrl+r exec ~/.cargo/bin/swaymsg_workspace rename_to $(rofi -dmenu -l 0 -P "rename workspace $(~/.cargo/bin/swaymsg_workspace print_focused_name) to")
bindsym --release Mod1+Ctrl+space exec /usr/bin/rofi -show combi
```
bindsym Mod1+Ctrl+0 exec ~/.cargo/bin/swaymsg_workspace number 10
bindsym Mod1+Ctrl+1 exec ~/.cargo/bin/swaymsg_workspace number 1
bindsym Mod1+Ctrl+2 exec ~/.cargo/bin/swaymsg_workspace number 2
bindsym Mod1+Ctrl+3 exec ~/.cargo/bin/swaymsg_workspace number 3
bindsym Mod1+Ctrl+4 exec ~/.cargo/bin/swaymsg_workspace number 4
bindsym Mod1+Ctrl+5 exec ~/.cargo/bin/swaymsg_workspace number 5
bindsym Mod1+Ctrl+6 exec ~/.cargo/bin/swaymsg_workspace number 6
bindsym Mod1+Ctrl+7 exec ~/.cargo/bin/swaymsg_workspace number 7
bindsym Mod1+Ctrl+8 exec ~/.cargo/bin/swaymsg_workspace number 8
bindsym Mod1+Ctrl+9 exec ~/.cargo/bin/swaymsg_workspace number 9
bindsym Mod1+Ctrl+Shift+0 exec ~/.cargo/bin/swaymsg_workspace move_container_to_workspace_number 10
bindsym Mod1+Ctrl+Shift+1 exec ~/.cargo/bin/swaymsg_workspace move_container_to_workspace_number 1
bindsym Mod1+Ctrl+Shift+2 exec ~/.cargo/bin/swaymsg_workspace move_container_to_workspace_number 2
bindsym Mod1+Ctrl+Shift+3 exec ~/.cargo/bin/swaymsg_workspace move_container_to_workspace_number 3
bindsym Mod1+Ctrl+Shift+4 exec ~/.cargo/bin/swaymsg_workspace move_container_to_workspace_number 4
bindsym Mod1+Ctrl+Shift+5 exec ~/.cargo/bin/swaymsg_workspace move_container_to_workspace_number 5
bindsym Mod1+Ctrl+Shift+6 exec ~/.cargo/bin/swaymsg_workspace move_container_to_workspace_number 6
bindsym Mod1+Ctrl+Shift+7 exec ~/.cargo/bin/swaymsg_workspace move_container_to_workspace_number 7
bindsym Mod1+Ctrl+Shift+8 exec ~/.cargo/bin/swaymsg_workspace move_container_to_workspace_number 8
bindsym Mod1+Ctrl+Shift+9 exec ~/.cargo/bin/swaymsg_workspace move_container_to_workspace_number 9
```

#### rofi config

```
> cat ~/.config/rofi/config.rasi
configuration {
modi: "combi,move to workspace:/usr/bin/swaymsg_workspace rofi_move_window";
modi: "combi,move to workspace:~/.cargo/bin/swaymsg_workspace rofi_move_window";
font: "M+CodeLat60 Nerd Font Mono 12";
combi-modi: "workspaces:/usr/bin/swaymsg_workspace rofi_select_workspace,window,drun,ssh";
combi-modi: "workspaces:~/.cargo/bin/swaymsg_workspace rofi_select_workspace,window,drun,ssh";
kb-mode-next: "Control+Alt+space";
}
Expand Down

0 comments on commit adeda6d

Please sign in to comment.