Workspaces groups This feature brings a lot of new possibilities. A workspace group is group of ten workspaces inside a decimal range (ex: from 10 to 19). It introduces `relative` and `absolute` scopes. For a move or a focus, if the target index is only one digit it will focus the wanted workspace relative to the current group focused. But if the target index is above 9, it will directly focus the workspace inside the group if it is already opened, if not, it will open the group on the current screen. Example 1: I'm focused on 21. If I do `swaysome focus 5` it's going to focus the workspace 25 on the same output than the other 20s. Example 2: I'm focused on 21. If I do `swaysome focus 35` it's going to focus the workspace 35. If there is no 30s opened yet, it's going to open it on my current screen, but I already have 32 opened on another screen, so it's going to open the workspace 35 on it. It also brings the `next-group` and `prev-group` features to switch focus from 21 to 31 or 21 to 11 for example. There is the `focus-group` action that allows you to directly focus a specified group and so creating multiple workspace groups on one output (For example, 20s for work and 30s for private stuff). There is one breaking behavior: I had to edit the `init` function to begin from 10 and not from 1. So with `swaysome init 1`, a triple screen is now initialized like this: 11, 21, 31 instead of 1, 11, 21. See merge request hyask/swaysome!6 |
||
|---|---|---|
| pkgbuild | ||
| src | ||
| .gitignore | ||
| .gitlab-ci.yml | ||
| Cargo.lock | ||
| Cargo.toml | ||
| LICENSE | ||
| README.md | ||
Swaysome
This binary helps you configure sway to work a bit more like Awesome. This currently means workspaces that are name-spaced on a per-screen basis.
It may also work with i3, but this is untested.
swaysome is compatible with sworkstyle.
Installation
Arch Linux: Found on the AUR as swaysome-git.
If you have Rust installed, then you can just cargo install swaysome and you're good to go.
Otherwise, you may grab a pre-built
binary from the
CI and put it in your $PATH.
Usage
Then create the file (and the directory if needed) "~/.config/sway/config.d/swaysome.conf" and paste this inside:
# Change focus between workspaces
unbindsym $mod+1
unbindsym $mod+2
unbindsym $mod+3
unbindsym $mod+4
unbindsym $mod+5
unbindsym $mod+6
unbindsym $mod+7
unbindsym $mod+8
unbindsym $mod+9
unbindsym $mod+0
bindsym $mod+1 exec "swaysome focus 1"
bindsym $mod+2 exec "swaysome focus 2"
bindsym $mod+3 exec "swaysome focus 3"
bindsym $mod+4 exec "swaysome focus 4"
bindsym $mod+5 exec "swaysome focus 5"
bindsym $mod+6 exec "swaysome focus 6"
bindsym $mod+7 exec "swaysome focus 7"
bindsym $mod+8 exec "swaysome focus 8"
bindsym $mod+9 exec "swaysome focus 9"
bindsym $mod+0 exec "swaysome focus 0"
# Move containers between workspaces
unbindsym $mod+Shift+1
unbindsym $mod+Shift+2
unbindsym $mod+Shift+3
unbindsym $mod+Shift+4
unbindsym $mod+Shift+5
unbindsym $mod+Shift+6
unbindsym $mod+Shift+7
unbindsym $mod+Shift+8
unbindsym $mod+Shift+9
unbindsym $mod+Shift+0
bindsym $mod+Shift+1 exec "swaysome move 1"
bindsym $mod+Shift+2 exec "swaysome move 2"
bindsym $mod+Shift+3 exec "swaysome move 3"
bindsym $mod+Shift+4 exec "swaysome move 4"
bindsym $mod+Shift+5 exec "swaysome move 5"
bindsym $mod+Shift+6 exec "swaysome move 6"
bindsym $mod+Shift+7 exec "swaysome move 7"
bindsym $mod+Shift+8 exec "swaysome move 8"
bindsym $mod+Shift+9 exec "swaysome move 9"
bindsym $mod+Shift+0 exec "swaysome move 0"
# Focus workspace groups
bindcode --to-code $mod+Ctrl+1 exec "swaysome focus-group 1"
bindcode --to-code $mod+Ctrl+2 exec "swaysome focus-group 2"
bindcode --to-code $mod+Ctrl+3 exec "swaysome focus-group 3"
bindcode --to-code $mod+Ctrl+4 exec "swaysome focus-group 4"
bindcode --to-code $mod+Ctrl+5 exec "swaysome focus-group 5"
bindcode --to-code $mod+Ctrl+6 exec "swaysome focus-group 6"
bindcode --to-code $mod+Ctrl+7 exec "swaysome focus-group 7"
bindcode --to-code $mod+Ctrl+8 exec "swaysome focus-group 8"
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"
# Move focused container to previous output
bindsym $mod+Shift+o exec "swaysome prev_output"
# Init workspaces for every screen
exec "swaysome init 1"
Finally append your sway configuration with this:
include ~/.config/sway/config.d/*.conf
You should end-up with workspaces from 1 to 0, prefixed with a screen index,
giving you workspace 01 on the first screen, and workspace 11 on the second
one, both accessible with shortcut $mod+1.
The init command simply walks through every screen to initialize a prefixed
workspace. It does it backwards so that you end-up focused on the first screen,
as usual.
Exhaustive swaysome commands list
move [name]: move the focused container to[name]on the same groupnext-output: move the focused container to the next outputprev-output: move the focused container to the previous outputfocus [name]: change focus to[name]on the same groupfocus-all-outputs [name]: change all outputs focus to[name]focus-group [id]: change focus to group[id]next-group: change focus to the next workspace groupprevious-group: change focus to the previous workspace groupinit [name]: cycle all outputs to create a default workspace with name[name]rearrange-workspacesRearrange already opened workspaces to the correct outputs