xmonad-contrib-bluetilebranch-0.8.1.2: Third party extensions for xmonadSource codeContentsIndex
XMonad.Util.NamedScratchpad
Portabilityunportable
Stabilityunstable
MaintainerKonstantin Sobolev <konstantin.sobolev@gmail.com>
Contents
Usage
Description
Named scratchpads that support several arbitrary applications at the same time.
Synopsis
data NamedScratchpad = NS {
name :: String
cmd :: String
query :: Query Bool
rect :: Maybe RationalRect
}
type NamedScratchpads = [NamedScratchpad]
namedScratchpadAction :: NamedScratchpads -> String -> X ()
namedScratchpadManageHook :: NamedScratchpads -> ManageHook
namedScratchpadFilterOutWorkspace :: [WindowSpace] -> [WindowSpace]
Usage

Allows to have several floating scratchpads running different applications. Bind a key to namedScratchpadSpawnAction. Pressing it will spawn configured application, or bring it to the current workspace if it already exists. Pressing the key with the application on the current workspace will send it to a hidden workspace called NSP.

If you already have a workspace called NSP, it will use that. NSP will also appear in xmobar and dzen status bars. You can tweak your dynamicLog settings to filter it out if you like.

Create named scratchpads configuration in your xmonad.hs like this:

 import XMonad.StackSet as W
 import XMonad.ManageHook
 import XMonad.Util.NamedScratchpad

 scratchpads = [
 -- run htop in xterm, find it by title, use default geometry
     NS "htop" "xterm -e htop" (title =? "htop") Nothing ,
 -- run stardict, find it by class name, place the window
 -- 1/6 of screen width from the left, 1/6 of screen height
 -- from the top, 2/3 of screen width by 2/3 of screen height
     NS "stardict" "stardict" (className =? "Stardict")
         (Just $ W.RationalRect (1/6) (1/6) (2/3) (2/3))
 ]

Add keybindings:

  , ((modMask x .|. controlMask .|. shiftMask, xK_t), namedScratchpadAction scratchpads "htop")
  , ((modMask x .|. controlMask .|. shiftMask, xK_s), namedScratchpadAction scratchpads "stardict")

... and a manage hook:

  , manageHook = namedScratchpadManageHook scratchpads

For detailed instruction on editing the key binding see XMonad.Doc.Extending

data NamedScratchpad Source
Single named scratchpad configuration
Constructors
NS
name :: StringScratchpad name
cmd :: StringCommand used to run application
query :: Query BoolQuery to find already running application
rect :: Maybe RationalRectFloating window geometry
type NamedScratchpads = [NamedScratchpad]Source
Named scratchpads configuration
namedScratchpadActionSource
:: NamedScratchpadsNamed scratchpads configuration
-> StringScratchpad name
-> X ()
Action to pop up specified named scratchpad
namedScratchpadManageHookSource
:: NamedScratchpadsNamed scratchpads configuration
-> ManageHook
Manage hook to use with named scratchpads
namedScratchpadFilterOutWorkspace :: [WindowSpace] -> [WindowSpace]Source
Transforms a workspace list containing the NSP workspace into one that doesn't contain it. Intended for use with logHooks.
Produced by Haddock version 2.4.2