add script to manage focus on devel workspace

This commit is contained in:
Daniel Lundin 2020-06-13 15:24:05 +02:00
parent 63330cbe42
commit 39f04b8a2e
No known key found for this signature in database
GPG key ID: 6AB527C9196ACDCC
3 changed files with 39 additions and 20 deletions

View file

@ -1,9 +1,9 @@
font=IBM Plex Sans Condensed 20
width=800
font=IBM Plex Sans Condensed 16
width=600
height=400
padding=20
padding=10
margin=10,0,2
anchor=bottom-right
anchor=bottom-left
background-color=#000000ff
border-color=#e65100ff
text-color=#ff6f00ff

View file

@ -33,22 +33,22 @@ bindsym XF86AudioPlay exec playerctl play-pause
bindsym XF86AudioNext exec playerctl next
bindsym XF86AudioPrev exec playerctl previous
bindsym F1 swap container with mark F1
bindsym F2 swap container with mark F2
bindsym F3 swap container with mark F3
bindsym F4 swap container with mark F4
bindsym F5 swap container with mark F5
bindsym F6 swap container with mark F6
bindsym F7 swap container with mark F7
bindsym F8 swap container with mark F8
bindsym Shift+F1 mark F1
bindsym Shift+F2 mark F2
bindsym Shift+F3 mark F3
bindsym Shift+F4 mark F4
bindsym Shift+F5 mark F5
bindsym Shift+F6 mark F6
bindsym Shift+F7 mark F7
bindsym Shift+F8 mark F8
bindsym F1 exec sway-focus F1
bindsym F2 exec sway-focus F2
bindsym F3 exec sway-focus F3
bindsym F4 exec sway-focus F4
bindsym F5 workspace 5
bindsym F6 workspace 6
bindsym F7 workspace 7
bindsym F8 workspace 8
bindsym Shift+F1 mark F1; exec sway-focus F1
bindsym Shift+F2 mark F2; exec sway-focus F2
bindsym Shift+F3 mark F3; exec sway-focus F3
bindsym Shift+F4 mark F4; exec sway-focus F4
bindsym Shift+F5 move container to workspace 5
bindsym Shift+F6 move container to workspace 6
bindsym Shift+F7 move container to workspace 7
bindsym Shift+F8 move container to workspace 8
bindsym Mod4+1 workspace 1
bindsym Mod4+2 workspace 2

19
bin/sway-focus Executable file
View 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}')