Last active
July 9, 2020 18:08
-
-
Save m-col/bb5630f17ed2bddef82bc78a1926c4d5 to your computer and use it in GitHub Desktop.
Go to group on different screen
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
The idea here is that we've split the groups across 2 monitors, 0 and 1, | |
and each group is locked to one of these monitors. The groups here are | |
named '1', '2', '3', 'q', 'w', 'e', and 3 of these are locked to each | |
screen (see line 9). These can be changed of course, but update lines 9, 13 and 19. | |
""" | |
def _go_to_group(group): | |
if group in '123': | |
def _inner(qtile): | |
old = qtile.current_screen.group.name | |
qtile.focus_screen(0) | |
if old in '123' or qtile.current_screen.group.name != group: | |
qtile.groups_map[group].cmd_toscreen() | |
else: | |
def _inner(qtile): | |
old = qtile.current_screen.group.name | |
qtile.focus_screen(1) | |
if old in 'qwe' or qtile.current_screen.group.name != group: | |
qtile.groups_map[group].cmd_toscreen() | |
return _inner | |
for i in groups: | |
keys.extend([ | |
Key([mod], i.name, lazy.function(_go_to_group(i.name))), | |
]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment