def __init__(self): FvwmModule.__init__(self, sys.argv) info = self.get_configinfo() print 'IconPath ==', info.get_iconpath() print 'PixmapPath ==', info.get_pixmappath() print 'ClickTime ==', info.get_clicktime() print '1 ==========' for line in info.get_infolines(): print line print '2 ==========' for line in info.get_infolines('FvwmIdent'): print line
def __init__(self, argv): FvwmModule.__init__(self, argv) self.set_mask() self.send("Set_Mask 4294967295") self.send("Move 2963p 178p", window=0x3e00004) # pager sends this ## SetMessageMask(fd, ## M_VISIBLE_NAME | ## M_ADD_WINDOW| ## M_CONFIGURE_WINDOW| ## M_DESTROY_WINDOW| ## M_FOCUS_CHANGE| ## M_NEW_PAGE| ## M_NEW_DESK| ## M_RAISE_WINDOW| ## M_LOWER_WINDOW| ## M_ICONIFY| ## M_ICON_LOCATION| ## M_DEICONIFY| ## M_RES_NAME| ## M_RES_CLASS| ## M_CONFIG_INFO| ## M_END_CONFIG_INFO| ## M_MINI_ICON| ## M_END_WINDOWLIST| ## M_RESTACK); ## SetMessageMask(fd, ## MX_VISIBLE_ICON_NAME| ## MX_PROPERTY_CHANGE); self.register("M_CONFIGURE_WINDOW", self.ConfigureWindow) log("windowlist") #self.tracker = self.get_windowlist() self.tracker = Tracker() log("windowlist done") # for win in self.tracker.get_windows(): # log((win, win.name, win.x, win.y, win.width, win.height, win.desk)) self.send("Send_WindowList") # pager sends this self.send("NOP FINISHED STARTUP") self.lastSend = None
__version__ = '1.1' import os import sys from Fvwm import FvwmModule def error(msg, exit=0): print '[Snap] <<ERROR>>', msg if exit: sys.exit(exit) if __name__ == '__main__': # create the module to interface with Fvwm m = FvwmModule(sys.argv) # read configuration lines. We're only looking for those that # start with `*Snap' snappers = {} for config in m.get_configinfo().get_infolines('Snap'): try: [ignore, snapper, x, y, w, h] = config.split() snappers[snapper] = [x, y, w, h] except ValueError: error('Ignoring badly formed line: %s' % config) # now figure out where you want to snap to snapto = m.args[0] try: [x, y, w, h] = snappers[snapto] window = int(m.appcontext, 16) except KeyError:
def send(self, command, window=WINDOW_NONE, cont=1): log("send: %s" % command) return FvwmModule.send(self, command, window, cont)
import os import sys import string from Fvwm import FvwmModule def error(msg, exit=0): print '[Snap] <<ERROR>>', msg if exit: sys.exit(exit) if __name__ == '__main__': # create the module to interface with Fvwm m = FvwmModule(sys.argv) # read configuration lines. We're only looking for those that # start with `*Snap' snappers = {} for config in m.get_configinfo().get_infolines('Snap'): try: [ignore, snapper, x, y, w, h] = string.split(config) snappers[snapper] = [x, y, w, h] except ValueError: error('Ignoring badly formed line: %s' % config) # now figure out where you want to snap to snapto = m.args[0] try: [x, y, w, h] = snappers[snapto] window = string.atoi(m.appcontext, 16) except KeyError: