XMonad.Actions.TagWindows

xmonad-contrib-0.18.1: Community-maintained extensions for xmonad

Copyright | (c) Karsten Schoelzel <kuser@gmx.de>
License | BSD
Maintainer | Karsten Schoelzel <kuser@gmx.de>
Stability | unstable
Portability | unportable
Safe Haskell | None
Language | Haskell2010

XMonad.Actions.TagWindows

Contents

- Usage

Description

Functions for tagging windows and selecting them by tags.

Synopsis

- addTag :: String -> Window -> X ()
- delTag :: String -> Window -> X ()
- unTag :: Window -> X ()
- setTags :: [String] -> Window -> X ()
- getTags :: Window -> X [String]
- hasTag :: String -> Window -> X Bool
- withTaggedP :: String -> (Window -> WindowSet -> WindowSet) -> X ()
- withTaggedGlobalP :: String -> (Window -> WindowSet -> WindowSet) -> X ()
- withFocusedP :: (Window -> WindowSet -> WindowSet) -> X ()
- withTagged :: String -> (Window -> X ()) -> X ()
- withTaggedGlobal :: String -> (Window -> X ()) -> X ()
- focusUpTagged :: String -> X ()
- focusUpTaggedGlobal :: String -> X ()
- focusDownTagged :: String -> X ()
- focusDownTaggedGlobal :: String -> X ()
- shiftHere :: (Ord a, Eq s, Eq i) => a -> StackSet i l a s sd -> StackSet i l a s sd
- shiftToScreen :: (Ord a, Eq s, Eq i) => s -> a -> StackSet i l a s sd -> StackSet i l a s sd
- tagPrompt :: XPConfig -> (String -> X ()) -> X ()
- tagDelPrompt :: XPConfig -> X ()
- data TagPrompt

# Usage

To use window tags, import this module into your `xmonad.hs`:

    import XMonad.Actions.TagWindows
    import XMonad.Prompt    -- to use tagPrompt

and add keybindings such as the following:

      , ((modm,                 xK_f  ), withFocused (addTag "abc"))
      , ((modm .|. controlMask, xK_f  ), withFocused (delTag "abc"))
      , ((modm .|. shiftMask,   xK_f  ), withTaggedGlobalP "abc" W.sink)
      , ((modm,                 xK_d  ), withTaggedP "abc" (W.shiftWin "2"))
      , ((modm .|. shiftMask,   xK_d  ), withTaggedGlobalP "abc" shiftHere)
      , ((modm .|. controlMask, xK_d  ), focusUpTaggedGlobal "abc")
      , ((modm,                 xK_g  ), tagPrompt def (\s -> withFocused (addTag s)))
      , ((modm .|. controlMask, xK_g  ), tagDelPrompt def)
      , ((modm .|. shiftMask,   xK_g  ), tagPrompt def (\s -> withTaggedGlobal s float))
      , ((modWinMask,                xK_g  ), tagPrompt def (\s -> withTaggedP s (W.shiftWin "2")))
      , ((modWinMask .|. shiftMask,  xK_g  ), tagPrompt def (\s -> withTaggedGlobalP s shiftHere))
      , ((modWinMask .|. controlMask, xK_g ), tagPrompt def (\s -> focusUpTaggedGlobal s))

NOTE: Tags are saved as space separated strings and split with `unwords`. Thus if you add a tag "a b" the window will have the tags "a" and "b" but not "a b".

For detailed instructions on editing your key bindings, see the tutorial.

addTag :: String -> Window -> X () #

add a tag to the existing ones

delTag :: String -> Window -> X () #

remove a tag from a window, if it exists

unTag :: Window -> X () #

remove all tags

setTags :: [String] -> Window -> X () #

set multiple tags for a window at once (overriding any previous tags)

getTags :: Window -> X [String] #

read all tags of a window reads from the "_XMONAD_TAGS" window property

hasTag :: String -> Window -> X Bool #

check a window for the given tag

withTaggedP :: String -> (Window -> WindowSet -> WindowSet) -> X () #

apply a pure function to windows with a tag

withTaggedGlobalP :: String -> (Window -> WindowSet -> WindowSet) -> X () #

apply a pure function to windows with a tag

withFocusedP :: (Window -> WindowSet -> WindowSet) -> X () #

withTagged :: String -> (Window -> X ()) -> X () #

withTaggedGlobal :: String -> (Window -> X ()) -> X () #

focusUpTagged :: String -> X () #

Move the focus in a group of windows, which share the same given tag. The Global variants move through all workspaces, whereas the other ones operate only on the current workspace

focusUpTaggedGlobal :: String -> X () #

Move the focus in a group of windows, which share the same given tag. The Global variants move through all workspaces, whereas the other ones operate only on the current workspace

focusDownTagged :: String -> X () #

Move the focus in a group of windows, which share the same given tag. The Global variants move through all workspaces, whereas the other ones operate only on the current workspace

focusDownTaggedGlobal :: String -> X () #

Move the focus in a group of windows, which share the same given tag. The Global variants move through all workspaces, whereas the other ones operate only on the current workspace

shiftHere :: (Ord a, Eq s, Eq i) => a -> StackSet i l a s sd -> StackSet i l a s sd #

shiftToScreen :: (Ord a, Eq s, Eq i) => s -> a -> StackSet i l a s sd -> StackSet i l a s sd #

tagPrompt :: XPConfig -> (String -> X ()) -> X () #

tagDelPrompt :: XPConfig -> X () #

data TagPrompt #

#### Instances

Instances details

XPrompt TagPrompt # |
Instance details Defined in XMonad.Actions.TagWindows Methods showXPrompt :: TagPrompt -> String # nextCompletion :: TagPrompt -> String -> [String] -> String # commandToComplete :: TagPrompt -> String -> String # completionToCommand :: TagPrompt -> String -> String # completionFunction :: TagPrompt -> ComplFunction # modeAction :: TagPrompt -> String -> String -> X () #