diff options
| author | Josh Rahm <rahm@google.com> | 2020-02-05 16:08:14 -0700 |
|---|---|---|
| committer | Josh Rahm <rahm@google.com> | 2020-02-05 16:08:14 -0700 |
| commit | 9169597a7dcef8046f415b77e0e6cbad696ff5a2 (patch) | |
| tree | f63afe549ea89c06b3fa42aef22b38c6a386648c /src/Internal/LayoutDraw.hs | |
| parent | c57a7f0db7dba41fd6851535845077adb08da18d (diff) | |
| download | rde-9169597a7dcef8046f415b77e0e6cbad696ff5a2.tar.gz rde-9169597a7dcef8046f415b77e0e6cbad696ff5a2.tar.bz2 rde-9169597a7dcef8046f415b77e0e6cbad696ff5a2.zip | |
Add ability to fuzzy find and jump to a window based on a prompt
Diffstat (limited to 'src/Internal/LayoutDraw.hs')
| -rw-r--r-- | src/Internal/LayoutDraw.hs | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/Internal/LayoutDraw.hs b/src/Internal/LayoutDraw.hs index 5f0572d..4a980b4 100644 --- a/src/Internal/LayoutDraw.hs +++ b/src/Internal/LayoutDraw.hs @@ -1,5 +1,5 @@ {-# LANGUAGE FlexibleInstances, FlexibleContexts, MultiParamTypeClasses, -ScopedTypeVariables #-} +ScopedTypeVariables, BangPatterns #-} module Internal.LayoutDraw where import System.Process @@ -27,13 +27,18 @@ showLayout = do xpm <- drawPng layout return $ Just $ printf "<icon=%s/>" xpm +iconSize :: (Num a) => (a, a) +iconSize = (64, 32) + drawPng :: (LayoutClass layout Window) => layout Window -> X String drawPng l = do dir <- getXMonadDir let sixWindows = [1..(4 :: Window)] let stack = differentiate sixWindows (rects, _) <- - runLayout (Workspace "0" l stack) (Rectangle 0 0 (64 * 30) (32 * 30)) + runLayout + (Workspace "0" l stack) + (Rectangle 0 0 (fst iconSize * 30) (snd iconSize * 30)) return () let descr = description l @@ -80,7 +85,7 @@ drawPng l = do surfaceWriteToPNG surface filepathPng - _ <- readProcessWithExitCode + (!_) <- readProcessWithExitCode "/usr/bin/convert" [filepathPng, filepathXpm] "" @@ -88,8 +93,9 @@ drawPng l = do return filepathXpm where - padR (Rectangle x y w h) = - Rectangle x y (max 1 $ w - 120) (max 1 $ h - 120) + padR = id + -- padR (Rectangle x y w h) = + -- Rectangle x y (max 1 $ w - 120) (max 1 $ h - 120) newtype InterceptLayout l a = InterceptLayout { |