bkerby

Untitled

Jul 24th, 2012
294
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.54 KB | None | 0 0
  1. $> git diff
  2. diff --git a/src/XMonad/Util/WorkspaceScreenshot.hs b/src/XMonad/Util/WorkspaceScreenshot.hs
  3. index 22080fc..1e938c5 100644
  4. --- a/src/XMonad/Util/WorkspaceScreenshot.hs
  5. +++ b/src/XMonad/Util/WorkspaceScreenshot.hs
  6. @@ -15,12 +15,12 @@ module XMonad.Util.WorkspaceScreenshot
  7.  
  8.  import Control.Applicative ((<$>))
  9.  import Control.Concurrent (threadDelay)
  10. -import Control.Monad (filterM, foldM_, (>=>))
  11. +import Control.Monad (filterM, foldM_, (>=>), void)
  12.  import Data.Maybe (catMaybes)
  13.  import System.Directory (getAppUserDataDirectory)
  14.  import System.FilePath ((</>), (<.>))
  15.  
  16. -import Graphics.UI.Gtk (Rectangle(..), drawableGetSize, drawWindowGetDefaultRootWindow)
  17. +import Graphics.UI.Gtk (initGUI, Rectangle(..), drawableGetSize, drawWindowGetDefaultRootWindow)
  18.  import Graphics.UI.Gtk.Gdk.Pixbuf (Colorspace(ColorspaceRgb), Pixbuf, pixbufCopyArea, pixbufGetFromDrawable, pixbufGetHeight, pixbufGetWidth, pixbufNew, pixbufSave)
  19.  import XMonad hiding (Image, Rectangle)
  20.  import qualified XMonad.StackSet as S
  21. @@ -36,6 +36,7 @@ captureWorkspacesWhen p hook = captureWorkspacesWhenId (workspaceIdToWindowSpace
  22.  -- | Capture screens from workspaces which id satisfies given predicate.
  23.  captureWorkspacesWhenId ∷ (WorkspaceId → X Bool)(FilePath → IO ()) → CapturingLayout → X ()
  24.  captureWorkspacesWhenId p hook mode = do
  25. +  xfork $ void initGUI
  26.    c ← gets $ S.currentTag . windowset
  27.    ps ← catMaybes <$> (mapM (\t → windows (S.view t) >> captureScreen) =<< filterM p =<< asks (workspaces . config))
  28.    windows $ S.view c
Advertisement
Add Comment
Please, Sign In to add comment