aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorLibravatar sommerfeld <sommerfeld@sommerfeld.dev>2026-05-14 10:58:38 +0100
committerLibravatar sommerfeld <sommerfeld@sommerfeld.dev>2026-05-14 10:58:38 +0100
commit13547308fba1eacb8996ebfb9db56f2127a2e70f (patch)
tree7335a2bbbede2fa97ba714da2fd5483d9b95819a
parentec3fa96850ff534a241f7ebf2e4cdc13efdf3891 (diff)
downloaddotfiles-13547308fba1eacb8996ebfb9db56f2127a2e70f.tar.gz
dotfiles-13547308fba1eacb8996ebfb9db56f2127a2e70f.tar.bz2
dotfiles-13547308fba1eacb8996ebfb9db56f2127a2e70f.zip
feat(sway): bspwm-style workspace back-and-forth toggle
workspace_auto_back_and_forth yes makes `workspace number N` jump back to the previously focused workspace when N is already current. Applies to both $mod+N keybinds and waybar workspace clicks.
-rw-r--r--KEYBINDS.md1
-rw-r--r--dot_config/sway/config4
2 files changed, 5 insertions, 0 deletions
diff --git a/KEYBINDS.md b/KEYBINDS.md
index d7f8143..9b0a863 100644
--- a/KEYBINDS.md
+++ b/KEYBINDS.md
@@ -348,6 +348,7 @@ Mod key: `Super` (Mod4). Only personal additions beyond sway defaults listed.
| `Super+period` | Emoji picker (bemoji → wofi; types + copies) |
| `Super+Tab` | Next workspace |
| `Super+Shift+Tab` | Previous workspace |
+| `Super+1`…`Super+0` | Switch to workspace N; re-press jumps back to previous one |
| `Super+]` | Focus next window in container (monocle cycling) |
| `Super+[` | Focus prev window in container (monocle cycling) |
| `XF86Display` | Toggle display mode (laptop-off/side-by-side) |
diff --git a/dot_config/sway/config b/dot_config/sway/config
index 86a75e1..742e8ab 100644
--- a/dot_config/sway/config
+++ b/dot_config/sway/config
@@ -79,6 +79,10 @@ bindsym $mod+Shift+k move up
bindsym $mod+Shift+l move right
# Workspaces
+# Re-pressing $mod+N (or clicking the active workspace in waybar) jumps back
+# to the previously focused workspace — bspwm-style toggle.
+workspace_auto_back_and_forth yes
+
bindsym $mod+1 workspace number 1
bindsym $mod+2 workspace number 2
bindsym $mod+3 workspace number 3