Skip to content

Instantly share code, notes, and snippets.

@m-col
Last active July 9, 2020 18:08
Show Gist options
  • Save m-col/bb5630f17ed2bddef82bc78a1926c4d5 to your computer and use it in GitHub Desktop.
Save m-col/bb5630f17ed2bddef82bc78a1926c4d5 to your computer and use it in GitHub Desktop.
Go to group on different screen
"""
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