Skip to content

Instantly share code, notes, and snippets.

@tych0
Created March 24, 2012 16:10
Show Gist options
  • Save tych0/2184681 to your computer and use it in GitHub Desktop.
Save tych0/2184681 to your computer and use it in GitHub Desktop.
Run arbitrary python codeon keypress
diff --git a/libqtile/manager.py b/libqtile/manager.py
index 69f1c61..8034430 100644
--- a/libqtile/manager.py
+++ b/libqtile/manager.py
@@ -1597,6 +1597,12 @@ class Qtile(command.CommandObject):
"""
return "OK"
+ def cmd_run(self, closure):
+ """
+ Run closure with the qtile object as a single argument.
+ """
+ return closure(self)
+
def cmd_sync(self):
"""
Sync the X display. Should only be used for development.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment