wild-bind-x11-0.1.0.3: X11-specific implementation for WildBind

MaintainerToshio Ito <debug.ito@gmail.com>
Safe HaskellNone
LanguageHaskell2010

WildBind.X11

Contents

Description

This module exports a FrontEnd for X11 environments.

Synopsis

X11 front-end

withFrontEnd :: (KeySymLike i, ModifierLike i, Describable i) => (FrontEnd ActiveWindow i -> IO a) -> IO a Source #

Initialize and obtain FrontEnd for X11, and run the given action.

The X11 FrontEnd watches and provides ActiveWindow as the front-end state. ActiveWindow keeps information about the window currently active. As for the input type i, NumPadUnlocked and NumPadLocked are currently supported.

Code using this function must be compiled with -threaded option enabled in ghc. Otherwise, it aborts.

Note that bound actions are executed when the key is released. That way, you can deliver events to the window that originally has the keyboard focus.

Windows in X11

data Window Source #

Information about window. You can inspect properties winInstance and winClass by wmctrl command.

$ wmctrl -lx
0x01400004 -1 xfce4-panel.Xfce4-panel  mydesktop xfce4-panel
0x01800003 -1 xfdesktop.Xfdesktop   mydesktop desktop
0x03800004  0 xfce4-terminal.Xfce4-terminal  mydesktop Terminal - toshio@mydesktop - byobu
0x03a000a7  0 emacs.Emacs23         mydesktop emacs@mydesktop
0x03e010fc  0 Navigator.Firefox     mydesktop debug-ito (Toshio Ito) - Mozilla Firefox
0x02600003  0 totem.Totem           mydesktop Movie Player

In the above example, the third column shows winInstance.winClass.

type ActiveWindow = Window Source #

Use this type especially when the Window is active.

Accessor functions for Window

winInstance :: Window -> Text Source #

name of the application instance (part of WM_CLASS property)

winClass :: Window -> Text Source #

name of the application class (part of WM_CLASS property)

winName :: Window -> Text Source #

what's shown in the title bar