diff options
author | Alexander Polakov <plhk@sdf.org> | 2013-02-07 16:08:56 +0400 |
---|---|---|
committer | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2013-03-13 21:11:46 +0100 |
commit | fcdc939572cfece0a8ce99f9164aa85f217ef369 (patch) | |
tree | 68841ad65e3e7e33ca247bd9c1ef1cb02f1428a5 /src/Bitmap.hs | |
parent | 8dffc6e722a58924ea65b50dc0e1471b3dd3976b (diff) | |
download | xmobar-fcdc939572cfece0a8ce99f9164aa85f217ef369.tar.gz xmobar-fcdc939572cfece0a8ce99f9164aa85f217ef369.tar.bz2 |
Introduce Actions
Actions are event re-actions.
Currently only ButtonPress event is handled by Actions and only
one action is defined, which is called Spawn (run external command).
Type (and parser) can be extended to EWMH actions (switch to desktop,
close window, whatever).
Diffstat (limited to 'src/Bitmap.hs')
-rw-r--r-- | src/Bitmap.hs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/Bitmap.hs b/src/Bitmap.hs index b073c9b..2045e1a 100644 --- a/src/Bitmap.hs +++ b/src/Bitmap.hs @@ -22,17 +22,18 @@ import System.Directory (doesFileExist) import System.Mem.Weak ( addFinalizer ) import ColorCache import Parsers (Widget(..)) +import Actions (Action) data Bitmap = Bitmap { width :: Dimension , height :: Dimension , pixmap :: Pixmap } -updateCache :: Display -> Window -> Map FilePath Bitmap -> [[(Widget, String)]] - -> IO (Map FilePath Bitmap) +updateCache :: Display -> Window -> Map FilePath Bitmap -> + [[(Widget, String, Maybe Action)]] -> IO (Map FilePath Bitmap) updateCache dpy win cache ps = do - let paths = map (\(Icon p, _) -> p) . concatMap (filter icons) $ ps - icons (Icon _, _) = True + let paths = map (\(Icon p, _, _) -> p) . concatMap (filter icons) $ ps + icons (Icon _, _, _) = True icons _ = False go m path = if member path m then return m |