def main(args): """ subfunction that launches the application """ sys.argv = sys.argv[0:1] from kivy.logger import Logger, logging log = Logger.getChild("KiTT") if args.verbose: Logger.setLevel(logging.DEBUG) else: Logger.setLevel(logging.ERROR) from kivy.base import EventLoop, runTouchApp, stopTouchApp from kivy.support import install_gobject_iteration from listener import Listener listener = Listener(args.config, args.gestures, EventLoop) EventLoop.add_event_listener(listener) UdevListener(install_gobject_iteration, EventLoop, listener, log).start() runTouchApp()
#!/usr/bin/env python from kivy.logger import Logger log = Logger.getChild("KiTT") import gtk import sys, dbus, subprocess, os import wnck from actions import Actions def workspace_up(): while gtk.events_pending(): gtk.main_iteration() self.screen.get_workspace_neighbor(self.screen.get_active_workspace(), wnck.MOTION_LEFT).activate(0) return True def workspace_down(): while gtk.events_pending(): gtk.main_iteration() self.screen.get_workspace_neighbor(self.screen.get_active_workspace(), wnck.MOTION_RIGHT).activate(0) return True ACTIONS = dict(workspace_up=workspace_up, workspace_down=workspace_down)
#!/usr/bin/env python from kivy.logger import Logger log = Logger.getChild("KiTT") import gtk import sys, dbus, subprocess, os import wnck from actions import Actions def workspace_up(): while gtk.events_pending(): gtk.main_iteration() self.screen.get_workspace_neighbor(self.screen.get_active_workspace(), wnck.MOTION_LEFT).activate(0) return True def workspace_down(): while gtk.events_pending(): gtk.main_iteration() self.screen.get_workspace_neighbor(self.screen.get_active_workspace(), wnck.MOTION_RIGHT).activate(0) return True ACTIONS = dict( workspace_up = workspace_up, workspace_down = workspace_down )