xmonad-contrib-bluetilebranch-0.8.1.2: Third party extensions for xmonadSource codeContentsIndex
XMonad.Actions.GridSelect
Portabilityunportable
Stabilityunstable
MaintainerClemens Fruhwirth <clemens@endorphin.org>
Contents
Usage
Description
GridSelect displays items(e.g. the opened windows) in a 2D grid and lets the user select from it with the cursor/hjkl keys or the mouse.
Synopsis
data GSConfig a = GSConfig {
gs_cellheight :: Integer
gs_cellwidth :: Integer
gs_cellpadding :: Integer
gs_colorizer :: a -> Bool -> X (String, String)
gs_font :: String
gs_originFractX :: Double
gs_originFractY :: Double
}
defaultGSConfig :: GSConfig Window
defaultGSSpawnConfig :: GSConfig String
buildDefaultGSConfig :: (a -> Bool -> X (String, String)) -> GSConfig a
gridselect :: forall a. GSConfig a -> [(String, a)] -> X (Maybe a)
gridselectWindow :: GSConfig Window -> X (Maybe Window)
withSelectedWindow :: (Window -> X ()) -> GSConfig Window -> X ()
bringSelected :: GSConfig Window -> X ()
goToSelected :: GSConfig Window -> X ()
spawnSelected :: GSConfig String -> [String] -> X ()
runSelectedAction :: GSConfig (X ()) -> [(String, X ())] -> X ()
fromClassName :: Window -> Bool -> X (String, String)
defaultColorizer :: String -> Bool -> X (String, String)
colorRangeFromClassName :: (Word8, Word8, Word8) -> (Word8, Word8, Word8) -> (Word8, Word8, Word8) -> (Word8, Word8, Word8) -> (Word8, Word8, Word8) -> Window -> Bool -> X (String, String)
Usage

You can use this module with the following in your ~/.xmonad/xmonad.hs:

    import XMonad.Actions.GridSelect

Then add a keybinding, e.g.

    , ((modMask x, xK_g), goToSelected defaultGSConfig)

Screenshot: http://clemens.endorphin.org/gridselect.png

This module also supports displaying arbitrary information in a grid and letting the user select from it. E.g. to spawn an application from a given list, you can use the following:

   , ((modMask x, xK_s), spawnSelected defaultGSSpawnConfig ["xterm","gmplayer","gvim"])
data GSConfig a Source
Constructors
GSConfig
gs_cellheight :: Integer
gs_cellwidth :: Integer
gs_cellpadding :: Integer
gs_colorizer :: a -> Bool -> X (String, String)
gs_font :: String
gs_originFractX :: Double
gs_originFractY :: Double
defaultGSConfig :: GSConfig WindowSource
defaultGSSpawnConfig :: GSConfig StringSource
buildDefaultGSConfig :: (a -> Bool -> X (String, String)) -> GSConfig aSource
Builds a default gs config from a colorizer function.
gridselect :: forall a. GSConfig a -> [(String, a)] -> X (Maybe a)Source
Brings up a 2D grid of elements in the center of the screen, and one can select an element with cursors keys. The selected element is returned.
gridselectWindow :: GSConfig Window -> X (Maybe Window)Source
Like gridSelect but with the current windows and their titles as elements
withSelectedWindow :: (Window -> X ()) -> GSConfig Window -> X ()Source
Brings up a 2D grid of windows in the center of the screen, and one can select a window with cursors keys. The selected window is then passed to a callback function.
bringSelected :: GSConfig Window -> X ()Source
Brings selected window to the current workspace.
goToSelected :: GSConfig Window -> X ()Source
Switches to selected window's workspace and focuses that window.
spawnSelected :: GSConfig String -> [String] -> X ()Source
Select an application to spawn from a given list
runSelectedAction :: GSConfig (X ()) -> [(String, X ())] -> X ()Source
Select an action and run it in the X monad
fromClassName :: Window -> Bool -> X (String, String)Source
Colorize a window depending on it's className.
defaultColorizer :: String -> Bool -> X (String, String)Source
Default colorizer for Strings
colorRangeFromClassNameSource
:: (Word8, Word8, Word8)Beginning of the color range
-> (Word8, Word8, Word8)End of the color range
-> (Word8, Word8, Word8)Background of the active window
-> (Word8, Word8, Word8)Inactive text color
-> (Word8, Word8, Word8)Active text color
-> Window
-> Bool
-> X (String, String)
A colorizer that picks a color inside a range, and depending on the window's class.
Produced by Haddock version 2.4.2