Maintainer | Toshio Ito <debug.ito@gmail.com> |
---|---|
Safe Haskell | None |
Language | Haskell2010 |
This module exports a FrontEnd
for X11 environments.
- withFrontEnd :: (KeySymLike i, ModifierLike i, Describable i) => (FrontEnd ActiveWindow i -> IO a) -> IO a
- data Window
- type ActiveWindow = Window
- winInstance :: Window -> Text
- winClass :: Window -> Text
- winName :: Window -> Text
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
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)