Skip to content

Commit 60745c7

Browse files
chdocnriley
andauthored
[i3wm] deprecate port ... actions in favor of standard desk ... actions (#2074)
Co-authored-by: Nicholas Riley <com-github@sabi.net>
1 parent 7ada37a commit 60745c7

File tree

3 files changed

+28
-4
lines changed

3 files changed

+28
-4
lines changed

BREAKING_CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ and when the change was applied given the delay between changes being
77
submitted and the time they were reviewed and merged.
88

99
---
10+
* 2025-12-11 Deprecated i3wm commands `port [left | right | <number_small>]` in favour of standard `desk [left | right | <number_small>]` commands.
1011
* 2025-11-21 Deprecated i3wm commands `[grow | shrink | center] window` in favour of `(win | window) [grow | shrink | center] for consistency with other window commands.
1112
* 2025-10-12 Change the prefix for bitwise operators from `op bitwise` to `(bit | bitwise)`. Bitwise assignment operators have been moved to the `user.code_operators_bitwise` list.
1213
* 2025-09-04 Remove `user.c_keywords` list and capture to instead rely on the `user.code_keyword` and `user.code_keyword_unprefixed` lists for consistency.

apps/i3wm/i3wm.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,17 @@ def switcher_focus(name: str): # type: ignore
6464
# focus_on_window_activation is set to "smart" or "urgent"
6565
actions.user.i3msg('[urgent="latest"] focus')
6666

67+
# the default implementation considers desktops consecutively numbered
68+
# this would be highly confusing given the numbering of i3wm workspaces
69+
def desktop(number: int): # type: ignore
70+
actions.user.i3msg(f"workspace number {number}")
71+
72+
def desktop_next():
73+
actions.user.i3msg(f"workspace next")
74+
75+
def desktop_last():
76+
actions.user.i3msg(f"workspace prev")
77+
6778

6879
@mod.action_class
6980
class Actions:

apps/i3wm/i3wm.talon

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@
22
os: linux
33
tag: user.i3wm
44
-
5+
56
# Change the settings below, if your key combination for these actions differs from the defaults.
67
# user.i3_launch_key = "super-d"
78
# user.i3_terminal_key = "super-enter"
89

9-
port <number_small>: user.i3msg("workspace number {number_small}")
10-
(port flip | flipper): user.i3msg("workspace back_and_forth")
11-
port right: user.i3msg("workspace next")
12-
port left: user.i3msg("workspace prev")
10+
# Use the commands in desktops.talon to navigate between workspaces
11+
(desk flip | flipper): user.i3msg("workspace back_and_forth")
1312

1413
(win | window) left: user.i3msg("focus left")
1514
(win | window) right: user.i3msg("focus right")
@@ -104,3 +103,16 @@ grow window [<number>]:
104103
shrink window [<number>]:
105104
user.deprecate_command("2025-11-21", "shrink window", "(win | window) shrink")
106105
user.i3wm_resize_window("shrink", number or 4, "height width")
106+
107+
port <number_small>:
108+
user.deprecate_command("2025-12-11", "port <number_small>", "desk <number_small>")
109+
user.i3msg("workspace number {number_small}")
110+
port flip:
111+
user.deprecate_command("2025-12-11", "port flip", "(desk flip | flipper)")
112+
user.i3msg("workspace back_and_forth")
113+
port right:
114+
user.deprecate_command("2025-12-11", "port right", "desk right")
115+
user.i3msg("workspace next")
116+
port left:
117+
user.deprecate_command("2025-12-11", "port left", "desk left")
118+
user.i3msg("workspace prev")

0 commit comments

Comments
 (0)