Maintainer | Toshio Ito <debug.ito@gmail.com> |
---|---|
Safe Haskell | None |
Language | Haskell2010 |
This module exports everything you probably need to use WildBind in X11 environments.
- wildNumPad :: (NumPadPosition i, XKeyInput i, Describable i, Ord i, Enum i, Bounded i) => Binding ActiveWindow i -> IO ()
- wildNumPad' :: (NumPadPosition i, XKeyInput i, Describable i, Ord i, Enum i, Bounded i) => (Indicator ActiveWindow i -> Binding ActiveWindow i) -> IO ()
- module WildBind.Binding
- module WildBind.Description
- module WildBind.Input.NumPad
- module Control.Monad.IO.Class
- module Control.Monad.Trans.State
- module Data.Monoid
- data Text :: *
- data Window :: *
- type ActiveWindow = Window
- winInstance :: Window -> Text
- winClass :: Window -> Text
- winName :: Window -> Text
- data Indicator s i :: * -> * -> *
- class NumPadPosition a where
- updateDescription :: Indicator s i -> i -> ActionDescription -> IO ()
- getPresence :: Indicator s i -> IO Bool
- setPresence :: Indicator s i -> Bool -> IO ()
- togglePresence :: Indicator s i -> IO ()
- quit :: Indicator s i -> IO ()
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
module WildBind.Binding
module WildBind.Description
module WildBind.Input.NumPad
From basic modules
module Control.Monad.IO.Class
module Control.Monad.Trans.State
module Data.Monoid
From WindBind.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 #
Use this type especially when the Window
is active.
winInstance :: Window -> Text #
name of the application instance (part of WM_CLASS
property)
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.
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.