Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Workspaces screenshooting utility for XMonad.
Haskell
branch: master

This branch is 1 commit ahead, 19 commits behind supki:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
src/XMonad/Util
.gitignore
LICENSE
README.markdown
Setup.hs
xmonad-screenshot.cabal

README.markdown

XMonad-screenshot

Simple gtk-based screen capturing utility for XMonad window manager.
It's flexible enough to give a user options for comprehensive captured workspaces' filtering and post-capture processing.
By default it captures all existing workspaces and places resulting screenshot in ~/.xmonad/screenshot.png

You probably do not want to use me: used improperly you will get XMonad dead!

Screenshots examples

Caution

You need to initialize capturing before using (this is due to gtk contraints).
Place call to initCapturing before you call xmonad:

main :: IO ()
main = do
  initCapturing
  xmonad defaultConfig { ... }

Usage examples

The most simple usage example:

import import XMonad.Util.WorkspaceScreenshot

myKeys conf@(XConfig {XMonad.modMask = modm}) = M.fromList $
  [ ...
  , ((modm .|. shiftMask, xK_u), captureWorkspacesWhen defaultPredicate defaultHook horizontally)
  , ...
  ]

You can filter some blacklisted workspaces from capturing using predicates:

import import XMonad.Util.WorkspaceScreenshot

predicate x = return $ x `notElem` ["blacklistedWorkspace1", "blacklistedWorkspace2"]

myKeys conf@(XConfig {XMonad.modMask = modm}) = M.fromList $
  [ ...
  , ((modm .|. shiftMask, xK_u), captureWorkspacesWhen predicate defaultHook horizontally)
  , ...
  ]

You can move screenshot file somewhere using post-processing hook:

import Control.Monad.Trans
import System.FilePath
import System.Directory
import XMonad.Util.WorkspaceScreenshot

hook filepath =
  do hd <- getHomeDirectory
     renameFile filepath (hd </> "Pictures" </> filepath)

myKeys conf@(XConfig {XMonad.modMask = modm}) = M.fromList $
  [ ...
  , ((modm .|. shiftMask, xK_u), captureWorkspacesWhen defaultPredicate hook horizontally)
  , ...
  ]
Something went wrong with that request. Please try again.