Created
May 24, 2016 11:28
-
-
Save nicoe/ba64067548faa61940a68a873c7f72bb to your computer and use it in GitHub Desktop.
This file contains hidden or 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
def scratchpad(window): | |
window.floating = True | |
screen = window.group.screen | |
window.tweak_float( | |
x=int(screen.width / 4), | |
y=int(screen.height / 4), | |
w=int(screen.width / 2), | |
h=int(screen.height / 2), | |
) | |
window.togroup('scratchpad') | |
window.scratchpadded = True | |
def show_scratchpad(qtile): | |
scratchpad = qtile.groupMap['scratchpad'] | |
last_window = (scratchpad.focusHistory[-1] | |
if scratchpad.focusHistory else None) | |
for w in list(qtile.currentGroup.windows): | |
if w.scratchpadded: | |
w.togroup('scratchpad') | |
if last_window: | |
last_window.togroup(qtile.currentGroup.name) | |
@hook.subscribe.setgroup | |
def remove_scratchpadded(): | |
previous_group = hook.qtile.currentScreen.previous_group | |
if not previous_group: | |
return | |
for w in list(previous_group.windows): | |
if w.scratchpadded: | |
w.togroup('scratchpad') | |
@hook.subscribe.client_new | |
def set_scratchpadded(w): | |
w.scratchpadded = False |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment