How does one go to the next unused group? #3667
Replies: 3 comments 2 replies
-
I don't think we have a built-in command for this so something like this might work: @lazy.function
def go_to_empty_group(qtile):
for group in qtile.groups:
if not group.windows:
qtile.current_screen.set_group(group)
break
# Then just bind go_to_empty_group() to a key |
Beta Was this translation helpful? Give feedback.
-
Hi, I was searching and was about to ask when I found this discussion. Would recommend to change title to group instead of tag so others can find this in google and avoid same questions. Thank you. |
Beta Was this translation helpful? Give feedback.
-
I have set different groups per monitor as specified here, and mixing the answer in here with the logic proposed in my own question I came up to this version for going to the first unused group in current screen: @lazy.function
def go_to_first_empty_group_in_same_screen(qtile):
# Get the current screen index
screen = qtile.current_screen.index
# Find all groups marked for that screen or that have no affinity and that not have windows
screen_groups = [g for g in qtile.groups if g.screen_affinity in [screen, None] and not g.windows]
# Go to first of that groups
for group in screen_groups:
qtile.current_screen.set_group(group)
break |
Beta Was this translation helpful? Give feedback.
-
Let's suppose I have a terminal open in tag 1. I would like to assign a keybinding to go to the first unused tag, in this case, the tag 2. If I had tags 1 to 5 filled with apps, I would like the same keybinding to jump to tag 6.
Beta Was this translation helpful? Give feedback.
All reactions