Copyright | (c) José A. Romero L. |
---|---|
License | BSD3-style (see LICENSE) |
Maintainer | José A. Romero L. <escherdragon@gmail.com> |
Stability | unstable |
Portability | unportable |
Safe Haskell | None |
Language | Haskell2010 |
Low-level functions to access data provided by the X11 desktop via window
properties. One of them (getVisibleTags
) depends on the PagerHints hook
being installed in your ~/.xmonad/xmonad.hs
configuration:
import System.Taffybar.Support.PagerHints (pagerHints) main = xmonad $ ewmh $ pagerHints $ ...
Synopsis
- data X11Context = X11Context {
- contextDisplay :: Display
- _contextRoot :: Window
- atomCache :: MVar [(String, Atom)]
- type X11Property a = ReaderT X11Context IO a
- type X11Window = Window
- doLowerWindow :: X11Window -> X11Property ()
- eventLoop :: (Event -> IO ()) -> X11Property ()
- getAtom :: String -> X11Property Atom
- getDefaultCtx :: IO X11Context
- getDisplay :: X11Property Display
- getPrimaryOutputNumber :: X11Property (Maybe Int)
- getVisibleTags :: X11Property [String]
- getWindowState :: X11Window -> [String] -> X11Property [String]
- getWindowStateProperty :: X11Window -> String -> X11Property Bool
- isWindowUrgent :: X11Window -> X11Property Bool
- postX11RequestSyncProp :: X11Property a -> a -> X11Property a
- readAsInt :: Maybe X11Window -> String -> X11Property Int
- readAsListOfInt :: Maybe X11Window -> String -> X11Property [Int]
- readAsListOfString :: Maybe X11Window -> String -> X11Property [String]
- readAsListOfWindow :: Maybe X11Window -> String -> X11Property [X11Window]
- readAsString :: Maybe X11Window -> String -> X11Property String
- sendCommandEvent :: Atom -> Atom -> X11Property ()
- sendWindowEvent :: Atom -> X11Window -> X11Property ()
- withDefaultCtx :: X11Property a -> IO a
Documentation
data X11Context Source #
X11Context | |
|
type X11Property a = ReaderT X11Context IO a Source #
doLowerWindow :: X11Window -> X11Property () Source #
eventLoop :: (Event -> IO ()) -> X11Property () Source #
Spawn a new thread and listen inside it to all incoming events,
invoking the given function to every event of type MapNotifyEvent
that
arrives, and subscribing to all events of this type emitted by newly
created windows.
getAtom :: String -> X11Property Atom Source #
Return the Atom with the given name.
getDefaultCtx :: IO X11Context Source #
Build a new X11Context containing the current X11 display and its root window.
getDisplay :: X11Property Display Source #
getPrimaryOutputNumber :: X11Property (Maybe Int) Source #
Get the index of the primary monitor as set and ordered by Xrandr.
getVisibleTags :: X11Property [String] Source #
Retrieve the value of the special _XMONAD_VISIBLE_WORKSPACES hint set by the PagerHints hook provided by Taffybar (see module documentation for instructions on how to do this), or an empty list of strings if the PagerHints hook is not available.
getWindowState :: X11Window -> [String] -> X11Property [String] Source #
getWindowStateProperty :: X11Window -> String -> X11Property Bool Source #
isWindowUrgent :: X11Window -> X11Property Bool Source #
Determine whether the "urgent" flag is set in the WM_HINTS of the given window.
postX11RequestSyncProp :: X11Property a -> a -> X11Property a Source #
:: Maybe X11Window | window to read from. Nothing means the root window. |
-> String | name of the property to retrieve |
-> X11Property Int |
Retrieve the property of the given window (or the root window, if Nothing) with the given name as a value of type Int. If that property hasn't been set, then return -1.
:: Maybe X11Window | window to read from. Nothing means the root window. |
-> String | name of the property to retrieve |
-> X11Property [Int] |
Retrieve the property of the given window (or the root window, if Nothing) with the given name as a list of Ints. If that property hasn't been set, then return an empty list.
:: Maybe X11Window | window to read from. Nothing means the root window. |
-> String | name of the property to retrieve |
-> X11Property [String] |
Retrieve the property of the given window (or the root window, if Nothing) with the given name as a list of Strings. If the property hasn't been set, then return an empty list.
:: Maybe X11Window | window to read from. Nothing means the root window. |
-> String | name of the property to retrieve |
-> X11Property [X11Window] |
Retrieve the property of the given window (or the root window, if Nothing) with the given name as a list of X11 Window IDs. If the property hasn't been set, then return an empty list.
:: Maybe X11Window | window to read from. Nothing means the root window. |
-> String | name of the property to retrieve |
-> X11Property String |
Retrieve the property of the given window (or the root window, if Nothing) with the given name as a String. If the property hasn't been set, then return an empty string.
sendCommandEvent :: Atom -> Atom -> X11Property () Source #
Emit a "command" event with one argument for the X server. This is used to send events that can be received by event hooks in the XMonad process and acted upon in that context.
sendWindowEvent :: Atom -> X11Window -> X11Property () Source #
Similar to sendCommandEvent
, but with an argument of type Window.
withDefaultCtx :: X11Property a -> IO a Source #
Put the current display and root window objects inside a Reader transformer for further computation.