Last active
January 4, 2021 12:09
-
-
Save ramnes/4caa5eb019e0e01ea41be1f91944b77d to your computer and use it in GitHub Desktop.
Qtile hook to fallback to the first group with windows available when the last window of a group is killed
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
from libqtile import qtile | |
@hook.subscribe.client_killed | |
def fallback(window): | |
if window.group.windows != {window}: | |
return | |
for group in qtile.groups: | |
if group.windows: | |
qtile.current_screen.toggle_group(group) | |
return | |
qtile.current_screen.toggle_group(qtile.groups[0]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment