Beispiel #1
0
def mainloop():
    wm = Manager(Xconn)
    wm.register_handlers()
    bind_launcher_keys()
    #Should move these to Manager.register_handlers()
    keybind.bind_global_key('KeyRelease', 'Mod4-x', quit)
    try:
        while True:
            if exit:
                break
            event.read()
            for e in event.queue():
                #print e
                w = None
                if wm.no_window(e):
                    w = None
                elif hasattr(e, 'window'):
                    w = e.window
                elif hasattr(e, 'event'):
                    w = e.event
                elif hasattr(e, 'requestor'):
                    w = e.requestor
                key = (e.__class__, w)
                for cb in event.__callbacks.get(key, []):
                    cb(e)
                wm.conn.flush()
    except xcb.Exception:
        traceback.print_exc()
        sys.exit(1)
Beispiel #2
0
def mainloop():
    wm = Manager(Xconn)
    wm.register_handlers()
    bind_launcher_keys()
    #Should move these to Manager.register_handlers()
    keybind.bind_global_key('KeyRelease', 'Mod4-x', quit)
    try:
        while True:
            if exit:
                break
            event.read()
            for e in event.queue():
                #print e
                w = None
                if wm.no_window(e):
                    w = None
                elif hasattr(e, 'window'):
                    w = e.window
                elif hasattr(e, 'event'):
                    w = e.event
                elif hasattr(e, 'requestor'):
                    w = e.requestor
                key = (e.__class__, w)
                for cb in event.__callbacks.get(key, []):
                    cb(e)
                wm.conn.flush()
    except xcb.Exception:
        traceback.print_exc()
        sys.exit(1)
Beispiel #3
0
 def register_handlers(self):
     '''
     Adds handlers for no_window_events, binds workspace moving
     keys and grabs the mouse actions we care about
     '''
     print "Registering Handlers"
     event.connect('MapRequest', None, self.handle_map_event)
     event.connect('ConfigureRequest', None, self.handle_configure_event)
     keybind.bind_global_key('KeyRelease', 'Mod4-Right', self.next_workspace)
     keybind.bind_global_key('KeyRelease', 'Mod4-Left', self.prev_workspace)
     keybind.bind_global_key('KeyRelease',   'Mod4-k', self.destroy_window)
     self.grab_mouse()
Beispiel #4
0
 def register_handlers(self):
     '''
     Adds handlers for no_window_events, binds workspace moving
     keys and grabs the mouse actions we care about
     '''
     print "Registering Handlers"
     event.connect('MapRequest', None, self.handle_map_event)
     event.connect('ConfigureRequest', None, self.handle_configure_event)
     keybind.bind_global_key('KeyRelease', 'Mod4-Right',
                             self.next_workspace)
     keybind.bind_global_key('KeyRelease', 'Mod4-Left', self.prev_workspace)
     keybind.bind_global_key('KeyRelease', 'Mod4-k', self.destroy_window)
     self.grab_mouse()
Beispiel #5
0
def bind_launcher_keys():
    keybind.bind_global_key('KeyRelease', 'Mod4-e', scite)
    keybind.bind_global_key('KeyRelease', 'Mod4-f', spacefm)
    keybind.bind_global_key('KeyRelease', 'Mod4-w', chromium)
    keybind.bind_global_key('KeyRelease', 'Mod4-m', quodlibet)
    keybind.bind_global_key('KeyRelease', 'Mod4-b', blender)
    keybind.bind_global_key('KeyRelease', 'Mod4-Return', sakura)
    #keybind.bind_global_key('KeyRelease', 'Mod4-k', kill_window)
    keybind.bind_global_key('KeyRelease', 'Mod4-space', dmenu)
Beispiel #6
0
import os.path
import sys

# from xpybutil import conn, root 
# import xpybutil.event as event 
import xpybutil.keybind as keybind

bindings = None

#####################
# Get key bindings
xdg = os.getenv('XDG_CONFIG_HOME') or os.path.join(os.getenv('HOME'), '.config')
conffile = os.path.join(xdg, 'pytyle3', 'keybind.py')

if not os.access(conffile, os.R_OK):
    conffile = os.path.join('/', 'etc', 'xdg', 'pytyle3', 'keybind.py')
    if not os.access(conffile, os.R_OK):
        print >> sys.stderr, 'UNRECOVERABLE ERROR: ' \
                             'No configuration file found at %s' % conffile
        sys.exit(1)

execfile(conffile)
#####################

assert bindings is not None

for key_string, fun in bindings.iteritems():
    if not keybind.bind_global_key('KeyPress', key_string, fun):
        print >> sys.stderr, 'Could not bind %s' % key_string

Beispiel #7
0
conffile = os.path.join(xdg, 'pytyle3', 'keybind.py')

if not os.access(conffile, os.R_OK):
    conffile = os.path.join('/', 'etc', 'xdg', 'pytyle3', 'keybind.py')
    if not os.access(conffile, os.R_OK):
        print >> sys.stderr, 'UNRECOVERABLE ERROR: ' \
                             'No configuration file found at %s' % conffile
        sys.exit(1)

execfile(conffile)
#####################

assert bindings is not None

for key_string, fun in bindings.iteritems():
    if not keybind.bind_global_key('KeyPress', key_string, fun):
        print >> sys.stderr, 'Could not bind %s' % key_string


########NEW FILE########
__FILENAME__ = layout_vert_horz
import xpybutil

from pt3.debug import debug

import pt3.config as config
import pt3.client as client
import pt3.state as state
from pt3.layouts import Layout

import store
Beispiel #8
0
import sys

# from xpybutil import conn, root
# import xpybutil.event as event
import xpybutil.keybind as keybind

bindings = None

#####################
# Get key bindings
xdg = os.getenv("XDG_CONFIG_HOME") or os.path.join(os.getenv("HOME"), ".config")
conffile = os.path.join(xdg, "pytyle3", "keybind.py")

if not os.access(conffile, os.R_OK):
    conffile = os.path.join("/", "etc", "xdg", "pytyle3", "keybind.py")
    if not os.access(conffile, os.R_OK):
        print(
            "UNRECOVERABLE ERROR: " "No configuration file found at %s" % conffile,
            file=sys.stderr,
        )
        sys.exit(1)

exec(compile(open(conffile, "rb").read(), conffile, "exec"))
#####################

assert bindings is not None

for key_string, fun in bindings.items():
    if not keybind.bind_global_key("KeyPress", key_string, fun):
        print("Could not bind %s" % key_string, file=sys.stderr)
Beispiel #9
0
def bind_launcher_keys():
    keybind.bind_global_key('KeyRelease', 'Mod4-e', scite)
    keybind.bind_global_key('KeyRelease', 'Mod4-f', spacefm)
    keybind.bind_global_key('KeyRelease', 'Mod4-w', chromium)
    keybind.bind_global_key('KeyRelease', 'Mod4-m', quodlibet)
    keybind.bind_global_key('KeyRelease', 'Mod4-b', blender)
    keybind.bind_global_key('KeyRelease', 'Mod4-Return', sakura)
    #keybind.bind_global_key('KeyRelease', 'Mod4-k', kill_window)
    keybind.bind_global_key('KeyRelease', 'Mod4-space', dmenu)