Skip to content

Instantly share code, notes, and snippets.

@ramnes
Last active January 4, 2021 12:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ramnes/4caa5eb019e0e01ea41be1f91944b77d to your computer and use it in GitHub Desktop.
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
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