Improve README and put default config in a separate file

This commit is contained in:
Skia 2024-01-29 16:52:26 +01:00
parent b36ba07d06
commit f336a437c2
2 changed files with 72 additions and 70 deletions

View file

@ -69,81 +69,17 @@ to check that everything works before fixing your `$PATH` issue.
## Usage
Then create the file (and the directory if needed) `~/.config/sway/config.d/swaysome.conf` and paste this inside:
> Use (un)bindcode or (un)bindsym, depending on what you used in your main sway config file.
> The `--no-warn` setting is only added to shortcuts that exist in the default config. You may want to add or remove
> that flag on some bindings depending on your config.
```
# Change focus between workspaces
bindsym --no-warn $mod+1 exec "swaysome focus 1"
bindsym --no-warn $mod+2 exec "swaysome focus 2"
bindsym --no-warn $mod+3 exec "swaysome focus 3"
bindsym --no-warn $mod+4 exec "swaysome focus 4"
bindsym --no-warn $mod+5 exec "swaysome focus 5"
bindsym --no-warn $mod+6 exec "swaysome focus 6"
bindsym --no-warn $mod+7 exec "swaysome focus 7"
bindsym --no-warn $mod+8 exec "swaysome focus 8"
bindsym --no-warn $mod+9 exec "swaysome focus 9"
bindsym --no-warn $mod+0 exec "swaysome focus 0"
Copy the `swaysome.conf` file in `~/.config/sway/config.d/swaysome.conf`.
# Move containers between workspaces
bindsym --no-warn $mod+Shift+1 exec "swaysome move 1"
bindsym --no-warn $mod+Shift+2 exec "swaysome move 2"
bindsym --no-warn $mod+Shift+3 exec "swaysome move 3"
bindsym --no-warn $mod+Shift+4 exec "swaysome move 4"
bindsym --no-warn $mod+Shift+5 exec "swaysome move 5"
bindsym --no-warn $mod+Shift+6 exec "swaysome move 6"
bindsym --no-warn $mod+Shift+7 exec "swaysome move 7"
bindsym --no-warn $mod+Shift+8 exec "swaysome move 8"
bindsym --no-warn $mod+Shift+9 exec "swaysome move 9"
bindsym --no-warn $mod+Shift+0 exec "swaysome move 0"
# Focus workspace groups
bindsym $mod+Alt+1 exec "swaysome focus-group 1"
bindsym $mod+Alt+2 exec "swaysome focus-group 2"
bindsym $mod+Alt+3 exec "swaysome focus-group 3"
bindsym $mod+Alt+4 exec "swaysome focus-group 4"
bindsym $mod+Alt+5 exec "swaysome focus-group 5"
bindsym $mod+Alt+6 exec "swaysome focus-group 6"
bindsym $mod+Alt+7 exec "swaysome focus-group 7"
bindsym $mod+Alt+8 exec "swaysome focus-group 8"
bindsym $mod+Alt+9 exec "swaysome focus-group 9"
bindsym $mod+Alt+0 exec "swaysome focus-group 0"
# Move containers to other workspace groups
bindsym $mod+Alt+Shift+1 exec "swaysome move-to-group 1"
bindsym $mod+Alt+Shift+2 exec "swaysome move-to-group 2"
bindsym $mod+Alt+Shift+3 exec "swaysome move-to-group 3"
bindsym $mod+Alt+Shift+4 exec "swaysome move-to-group 4"
bindsym $mod+Alt+Shift+5 exec "swaysome move-to-group 5"
bindsym $mod+Alt+Shift+6 exec "swaysome move-to-group 6"
bindsym $mod+Alt+Shift+7 exec "swaysome move-to-group 7"
bindsym $mod+Alt+Shift+8 exec "swaysome move-to-group 8"
bindsym $mod+Alt+Shift+9 exec "swaysome move-to-group 9"
bindsym $mod+Alt+Shift+0 exec "swaysome move-to-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"
# Move focused workspace group to next output
bindsym $mod+Alt+o exec "swaysome workspace-group-next-output"
# Move focused workspace group to previous output
bindsym $mod+Alt+Shift+o exec "swaysome workspace-group-prev-output"
# Init workspaces for every screen
exec "swaysome init 1"
```
Finally append your `sway` configuration with this:
Then 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 `11` on the first screen, and workspace `21` on the second
one, both accessible with shortcut `$mod+1` when focused on the right output.
On next startup of `sway`, you should end-up with workspaces from `1` to `0`,
prefixed with a screen index, giving you workspace `11` on the first screen, and
workspace `21` on the second one, both accessible with shortcut `$mod+1` when
focused on the right output.
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,

66
swaysome.conf Normal file
View file

@ -0,0 +1,66 @@
# Use (un)bindcode or (un)bindsym, depending on what you used in your main sway config file.
# The `--no-warn` setting is only added to shortcuts that exist in the default config. You may want to add or remove
# that flag on some bindings depending on your config.
# Change focus between workspaces
bindsym --no-warn $mod+1 exec "swaysome focus 1"
bindsym --no-warn $mod+2 exec "swaysome focus 2"
bindsym --no-warn $mod+3 exec "swaysome focus 3"
bindsym --no-warn $mod+4 exec "swaysome focus 4"
bindsym --no-warn $mod+5 exec "swaysome focus 5"
bindsym --no-warn $mod+6 exec "swaysome focus 6"
bindsym --no-warn $mod+7 exec "swaysome focus 7"
bindsym --no-warn $mod+8 exec "swaysome focus 8"
bindsym --no-warn $mod+9 exec "swaysome focus 9"
bindsym --no-warn $mod+0 exec "swaysome focus 0"
# Move containers between workspaces
bindsym --no-warn $mod+Shift+1 exec "swaysome move 1"
bindsym --no-warn $mod+Shift+2 exec "swaysome move 2"
bindsym --no-warn $mod+Shift+3 exec "swaysome move 3"
bindsym --no-warn $mod+Shift+4 exec "swaysome move 4"
bindsym --no-warn $mod+Shift+5 exec "swaysome move 5"
bindsym --no-warn $mod+Shift+6 exec "swaysome move 6"
bindsym --no-warn $mod+Shift+7 exec "swaysome move 7"
bindsym --no-warn $mod+Shift+8 exec "swaysome move 8"
bindsym --no-warn $mod+Shift+9 exec "swaysome move 9"
bindsym --no-warn $mod+Shift+0 exec "swaysome move 0"
# Focus workspace groups
bindsym $mod+Alt+1 exec "swaysome focus-group 1"
bindsym $mod+Alt+2 exec "swaysome focus-group 2"
bindsym $mod+Alt+3 exec "swaysome focus-group 3"
bindsym $mod+Alt+4 exec "swaysome focus-group 4"
bindsym $mod+Alt+5 exec "swaysome focus-group 5"
bindsym $mod+Alt+6 exec "swaysome focus-group 6"
bindsym $mod+Alt+7 exec "swaysome focus-group 7"
bindsym $mod+Alt+8 exec "swaysome focus-group 8"
bindsym $mod+Alt+9 exec "swaysome focus-group 9"
bindsym $mod+Alt+0 exec "swaysome focus-group 0"
# Move containers to other workspace groups
bindsym $mod+Alt+Shift+1 exec "swaysome move-to-group 1"
bindsym $mod+Alt+Shift+2 exec "swaysome move-to-group 2"
bindsym $mod+Alt+Shift+3 exec "swaysome move-to-group 3"
bindsym $mod+Alt+Shift+4 exec "swaysome move-to-group 4"
bindsym $mod+Alt+Shift+5 exec "swaysome move-to-group 5"
bindsym $mod+Alt+Shift+6 exec "swaysome move-to-group 6"
bindsym $mod+Alt+Shift+7 exec "swaysome move-to-group 7"
bindsym $mod+Alt+Shift+8 exec "swaysome move-to-group 8"
bindsym $mod+Alt+Shift+9 exec "swaysome move-to-group 9"
bindsym $mod+Alt+Shift+0 exec "swaysome move-to-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"
# Move focused workspace group to next output
bindsym $mod+Alt+o exec "swaysome workspace-group-next-output"
# Move focused workspace group to previous output
bindsym $mod+Alt+Shift+o exec "swaysome workspace-group-prev-output"
# Init workspaces for every screen
exec "swaysome init 1"