xmonad-screenshot 0.1.1.0 → 0.1.2
raw patch · 4 files changed
+134/−7 lines, 4 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- XMonad.Util.WorkspaceScreenshot: dimensions :: CapturingLayout -> [Pixbuf] -> IO (Int, Int)
- XMonad.Util.WorkspaceScreenshot: fill :: CapturingLayout -> [Pixbuf] -> Pixbuf -> IO ()
+ XMonad.Util.WorkspaceScreenshot: [dimensions] :: CapturingLayout -> [Pixbuf] -> IO (Int, Int)
+ XMonad.Util.WorkspaceScreenshot: [fill] :: CapturingLayout -> [Pixbuf] -> Pixbuf -> IO ()
Files
- CHANGELOG.markdown +9/−0
- README.markdown +93/−0
- src/XMonad/Util/WorkspaceScreenshot/Internal.hs +1/−0
- xmonad-screenshot.cabal +31/−7
+ CHANGELOG.markdown view
@@ -0,0 +1,9 @@+0.1.2+=====++ * GHC 7.10 compatibility.++< 0.1.2+=======++ Prehistory.
+ README.markdown view
@@ -0,0 +1,93 @@+# XMonad-screenshot+[](https://hackage.haskell.org/package/xmonad-screenshot)+[](https://travis-ci.org/supki/xmonad-screenshot)++[gtk][1]-based screen capturing utility for the [XMonad][2] 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`++## Example screenshots++ * [Horizontal][3] layout+ * [Vertical][4] layout+++## Caveats++### Installation++You may want to make sure you have [`gtk2hs-buildtools`][5] package installed and+its binaries are in `PATH` before installing `xmonad-screenshot`:++```+$ type gtk2hsC2hs+gtk2hsC2hs is /home/user/.cabal/bin/gtk2hsC2hs+```++If you do not see any encouraging output, try `cabal install gtk2hs-buildtools` and/or check+`PATH` contains `/home/user/.cabal/bin` directory++### Initialization++Due to gtk (and XMonad) constraints you need to initialize the capturing before using it.+Place call to `initCapturing` before you call `xmonad`:++```haskell+main :: IO ()+main = do+ initCapturing+ xmonad defaultConfig { ... }+```+++## Usage examples+The most simple usage example:++```haskell+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:++```haskell+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:++```haskell+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)+ , ...+ ]+```++ [1]: https://hackage.haskell.org/package/gtk+ [2]: http://xmonad.org+ [3]: http://i.imgur.com/s9nbOaZ.png+ [4]: https://vsegda.budueba.com/img/20dacff202bb7660bae3a16250e0b3e9.jpg+ [5]: https://hackage.haskell.org/package/gtk2hs-buildtools
src/XMonad/Util/WorkspaceScreenshot/Internal.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE FlexibleContexts #-} {-# OPTIONS_HADDOCK hide #-} -- | Provides an utility functions for easy and robust workspaces' screen capturing. module XMonad.Util.WorkspaceScreenshot.Internal
xmonad-screenshot.cabal view
@@ -1,17 +1,41 @@ name: xmonad-screenshot-version: 0.1.1.0+version: 0.1.2 synopsis: Workspaces screenshooting utility for XMonad.-homepage: http://github.com/supki/xmonad-screenshot+description:+ See README.markdown+homepage: https://github.com/supki/xmonad-screenshot license: MIT license-file: LICENSE author: Matvey Aksenov maintainer: Dmitry Malikov, malikov.d.y@gmail.com category: XMonad build-type: Simple-cabal-version: >=1.8+cabal-version: >= 1.10+extra-source-files:+ CHANGELOG.markdown+ README.markdown +source-repository head+ type: git+ location: https://github.com/supki/xmonad-screenshot++source-repository this+ type: git+ location: https://github.com/supki/xmonad-screenshot+ tag: 0.1.2+ library- build-depends: base >= 3 && < 5, xmonad >= 0.9, gtk >= 0.12.3- exposed-modules: XMonad.Util.WorkspaceScreenshot- other-modules: XMonad.Util.WorkspaceScreenshot.Internal- hs-source-dirs: src+ default-language:+ Haskell2010+ build-depends:+ base >= 3 && < 5+ , xmonad >= 0.9+ , gtk >= 0.12.3+ hs-source-dirs:+ src+ exposed-modules:+ XMonad.Util.WorkspaceScreenshot+ other-modules:+ XMonad.Util.WorkspaceScreenshot.Internal+ ghc-options:+ -Wall