diff options
| author | Josh Rahm <rahm@google.com> | 2022-04-21 17:04:08 -0600 |
|---|---|---|
| committer | Josh Rahm <joshuarahm@gmail.com> | 2022-10-09 12:19:46 -0600 |
| commit | a45cfc63c66b2f85768df0eba77e9460a75e6215 (patch) | |
| tree | 349db2c923963b719a76e967ecf1bda94a649c95 /src/Rahm/Desktop/Layout | |
| parent | 4319bde78b32d42d20b43c1ebd79095409db399e (diff) | |
| download | rde-a45cfc63c66b2f85768df0eba77e9460a75e6215.tar.gz rde-a45cfc63c66b2f85768df0eba77e9460a75e6215.tar.bz2 rde-a45cfc63c66b2f85768df0eba77e9460a75e6215.zip | |
Some changes to XMobar look and feel
Diffstat (limited to 'src/Rahm/Desktop/Layout')
| -rw-r--r-- | src/Rahm/Desktop/Layout/Draw.hs | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/src/Rahm/Desktop/Layout/Draw.hs b/src/Rahm/Desktop/Layout/Draw.hs index aa4dba3..8380e98 100644 --- a/src/Rahm/Desktop/Layout/Draw.hs +++ b/src/Rahm/Desktop/Layout/Draw.hs @@ -130,23 +130,29 @@ drawXpm :: drawXpm (w, h) rects' shrinkAmt = execWriter $ do tell "/* XPM */\n" tell "static char *out[] = {\n" - tell $ printf "\"%d %d %d 1 \",\n" w h (length rects + 1) + tell $ printf "\"%d %d %d 1 \",\n" (w + 7) (h + 7) (length rects + 1) let zipRects = zip ['A' .. 'Z'] rects forM_ zipRects $ \(char, (color, _)) -> do tell $ printf "\"%c c %s\",\n" char color - tell "\"% c None\",\n" - - forM_ [0 .. h - 1] $ \y -> do - tell "\"" - forM_ [0 .. w - 1] $ \x -> + tell "\"% c #000000\",\n" + + forM_ [0..2] $ \_ -> do + tell "\"%%%" + forM_ [0 .. w] $ \_ -> tell "%" + tell "%%%\"\n" + forM_ [0 .. h] $ \y -> do + tell "\"%%%" + forM_ [0 .. w] $ \x -> (case find (matches x y) zipRects of Nothing -> tell "%" Just (chr, _) -> tell [chr]) - tell "\"" - when (y /= h - 1 - shrinkAmt) (tell ",") - tell "\n" + tell "%%%\"\n" + forM_ [0..2] $ \_ -> do + tell "\"%%%" + forM_ [0 .. w] $ \_ -> tell "%" + tell "%%%\"\n" tell "};\n" where |