summaryrefslogtreecommitdiffhomepage
path: root/src/Bitmap.hs
diff options
context:
space:
mode:
authorAlexander Polakov <plhk@sdf.org>2013-02-07 16:08:56 +0400
committerJose Antonio Ortega Ruiz <jao@gnu.org>2013-03-13 21:11:46 +0100
commitfcdc939572cfece0a8ce99f9164aa85f217ef369 (patch)
tree68841ad65e3e7e33ca247bd9c1ef1cb02f1428a5 /src/Bitmap.hs
parent8dffc6e722a58924ea65b50dc0e1471b3dd3976b (diff)
downloadxmobar-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.hs9
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