wild-bind-task-x11-0.2.0.1: Task to install and export everything you need to use WildBind in X11

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

WildBind.Task.X11

Contents

Description

This module exports everything you probably need to use WildBind in X11 environments.

Synopsis

Execution

wildNumPad :: (NumPadPosition i, XKeyInput i, Describable i, Ord i, Enum i, Bounded i) => Binding ActiveWindow i -> IO () Source #

A convenient function to create an executable action with X11 FrontEnd and Indicator for a number pad.

main :: IO ()
main = wildNumPad $ binds $ do
  on NumCenter `run` putStrLn "You pushed center."

Note that the executable must be compiled by ghc with -threaded option enabled.

With this function, the "/" (divide) key on the numpad is bound to toggling the Indicator, ignoring the binding you provide.

For the input type i, you can use NumPadUnlocked or NumPadLocked.

wildNumPad' :: (NumPadPosition i, XKeyInput i, Describable i, Ord i, Enum i, Bounded i) => (Indicator ActiveWindow i -> Binding ActiveWindow i) -> IO () Source #

A more flexible version of wildNumPad. It passes you an Indicator, and uses the Binding you return as-is.

Re-exports

From basic modules

data Text :: * #

A space efficient, packed, unboxed Unicode text type.

Instances

type Item Text 
type Item Text = Char

From WindBind.X11

data Window :: * #

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.

Instances

type ActiveWindow = Window #

Use this type especially when the Window is active.

winInstance :: Window -> Text #

name of the application instance (part of WM_CLASS property)

winClass :: Window -> Text #

name of the application class (part of WM_CLASS property)

winName :: Window -> Text #

what's shown in the title bar

From WildBind.Indicator

data Indicator s i :: * -> * -> * #

Indicator interface. s is the front-end state, i is the input type.

class NumPadPosition a where #

Something that can be mapped to number pad's key positions.

Minimal complete definition

toNumPad

Methods

toNumPad :: a -> NumPadLocked #

updateDescription :: Indicator s i -> i -> ActionDescription -> IO () #

Update and show the description for the current binding.

getPresence :: Indicator s i -> IO Bool #

Get the current presence of the indicator. Returns True if it's present.

setPresence :: Indicator s i -> Bool -> IO () #

Set the presence of the indicator.

togglePresence :: Indicator s i -> IO () #

Toggle the presence of the indicator.

quit :: Indicator s i -> IO () #

Destroy the indicator. This usually means quitting the entire application.