Cycle through active groups in the current screen #4722
-
Hi and thank you. I have two monitors with different groups for each as specified in FAQ and would be very useful to have a keyboard shorcut to cycle through the active groups only in the current screen. I have searched, read documentation, examples and discussions, but I am new to python and haven't found something simple that I can use. Any recommendations? |
Beta Was this translation helpful? Give feedback.
Answered by
elParaguayo
Mar 12, 2024
Replies: 1 comment 11 replies
-
Something like this: @lazy.function
def loop_screen_groups(qtile):
# Get the current screen index
screen = qtile.current_screen.index
# Find all groups marked for that screen or that have no affinity
screen_groups = [g for g in qtile.groups if g.screen_affinity in [screen, None]]
# Get the index of the next group
current = screen_groups.index(qtile.current_group)
next_index = (current + 1) % len(screen_groups)
# Show that group
screen_groups[next_index].toscreen() |
Beta Was this translation helpful? Give feedback.
11 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What do you mean by active? That the group has windows? If so, change this line: