add script to manage focus on devel workspace
This commit is contained in:
parent
63330cbe42
commit
39f04b8a2e
3 changed files with 39 additions and 20 deletions
bin
19
bin/sway-focus
Executable file
19
bin/sway-focus
Executable file
|
@ -0,0 +1,19 @@
|
|||
#!/usr/bin/env python
|
||||
from i3ipc import Connection
|
||||
import sys
|
||||
|
||||
try:
|
||||
mark=sys.argv[1]
|
||||
except IndexError:
|
||||
mark=None
|
||||
|
||||
c = Connection()
|
||||
c.command('workspace 1')
|
||||
|
||||
# Focus on widest window
|
||||
windows = c.get_tree().find_focused().workspace().descendants()
|
||||
w = sorted(windows, key=lambda w: w.window_rect.width)[-1]
|
||||
w.command('focus')
|
||||
|
||||
if mark:
|
||||
w.command(f'swap container with mark {mark}')
|
Loading…
Add table
Add a link
Reference in a new issue