summaryrefslogtreecommitdiffhomepage
path: root/src/Actions.hs
diff options
context:
space:
mode:
authorMarcin Mikołajczyk <marcinmikolajcz@gmail.com>2014-02-20 15:27:43 +0100
committerMarcin Mikołajczyk <marcinmikolajcz@gmail.com>2014-02-20 15:27:43 +0100
commit6ef984e25433608183004086f21a75e51209012c (patch)
tree0c7401c21cd08b6c3a313a3dcb20562e886040ce /src/Actions.hs
parentfc240b66c24b8d257299c9ccc8e51f30129e774c (diff)
downloadxmobar-6ef984e25433608183004086f21a75e51209012c.tar.gz
xmobar-6ef984e25433608183004086f21a75e51209012c.tar.bz2
Change actions syntax
Diffstat (limited to 'src/Actions.hs')
-rw-r--r--src/Actions.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Actions.hs b/src/Actions.hs
index 2befe77..8772b07 100644
--- a/src/Actions.hs
+++ b/src/Actions.hs
@@ -17,7 +17,7 @@ import Control.Monad (void)
import Text.Regex (Regex, subRegex, mkRegex, matchRegex)
import Graphics.X11.Types (Button)
-data Action = Spawn Button String
+data Action = Spawn [Button] String
deriving (Eq)
runAction :: Action -> IO ()
@@ -28,7 +28,7 @@ stripActions s = case matchRegex actionRegex s of
Nothing -> s
Just _ -> stripActions strippedOneLevel
where
- strippedOneLevel = subRegex actionRegex s $ "[\\1=\\2]\\3[\\4]"
+ strippedOneLevel = subRegex actionRegex s $ "[action=\\1\\2]\\3[/action]"
actionRegex :: Regex
-actionRegex = mkRegex "<(action|button.)=([^>]*)>(.+)</(action|button.)>"
+actionRegex = mkRegex "<action=`?([^>`]*)`?( +button=[12345]+)?>(.+)</action>"