mirror of
https://github.com/vincentbernat/i3wm-configuration.git
synced 2025-07-15 04:34:21 +02:00
i3: add a binding to move all workspaces to the next output
This commit is contained in:
parent
20c2e3789f
commit
e501d8e769
2 changed files with 20 additions and 0 deletions
|
@ -436,6 +436,25 @@ async def new_workspace(i3, event):
|
||||||
await current.command(f"move container to workspace " f'number "{num}"')
|
await current.command(f"move container to workspace " f'number "{num}"')
|
||||||
|
|
||||||
|
|
||||||
|
@on(CommandEvent("move-all-workspaces-to-next-output"))
|
||||||
|
async def move_all_workspaces_to_next_output(i3, event):
|
||||||
|
"""Move all workspaces from the current output to the next one."""
|
||||||
|
outputs = await i3.get_outputs()
|
||||||
|
if len(outputs) < 2:
|
||||||
|
return
|
||||||
|
workspaces = await i3.get_workspaces()
|
||||||
|
try:
|
||||||
|
focused = [w for w in workspaces if w.focused][0]
|
||||||
|
except IndexError:
|
||||||
|
return
|
||||||
|
output = focused.output
|
||||||
|
for workspace in workspaces:
|
||||||
|
if workspace.output == output:
|
||||||
|
await i3.command(
|
||||||
|
f"workspace number {workspace.num} ; move workspace to output next"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
@on(I3Event.WORKSPACE_INIT)
|
@on(I3Event.WORKSPACE_INIT)
|
||||||
@static(lock=asyncio.Lock())
|
@static(lock=asyncio.Lock())
|
||||||
async def workspace_rename_duplicate(i3, event):
|
async def workspace_rename_duplicate(i3, event):
|
||||||
|
|
1
config
1
config
|
@ -132,6 +132,7 @@ bindsym $mod+Shift+8 move container to workspace number 8
|
||||||
bindsym $mod+Shift+9 move container to workspace number 9
|
bindsym $mod+Shift+9 move container to workspace number 9
|
||||||
bindsym $mod+Shift+0 move container to workspace number 10
|
bindsym $mod+Shift+0 move container to workspace number 10
|
||||||
bindsym $mod+Shift+o move workspace to output next
|
bindsym $mod+Shift+o move workspace to output next
|
||||||
|
bindsym $mod+Ctrl+Shift+o nop "move-all-workspaces-to-next-output"
|
||||||
bindsym $mod+Shift+n nop "move-to-new-workspace"
|
bindsym $mod+Shift+n nop "move-to-new-workspace"
|
||||||
|
|
||||||
# lock screen
|
# lock screen
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue