summaryrefslogtreecommitdiffhomepage
path: root/src/Xmobar/X11
diff options
context:
space:
mode:
Diffstat (limited to 'src/Xmobar/X11')
-rw-r--r--src/Xmobar/X11/Actions.hs34
-rw-r--r--src/Xmobar/X11/Bitmap.hs4
-rw-r--r--src/Xmobar/X11/Draw.hs2
-rw-r--r--src/Xmobar/X11/Parsers.hs3
4 files changed, 4 insertions, 39 deletions
diff --git a/src/Xmobar/X11/Actions.hs b/src/Xmobar/X11/Actions.hs
deleted file mode 100644
index 87c03ed..0000000
--- a/src/Xmobar/X11/Actions.hs
+++ /dev/null
@@ -1,34 +0,0 @@
------------------------------------------------------------------------------
--- |
--- Module : Xmobar.Actions
--- Copyright : (c) Alexander Polakov
--- License : BSD-style (see LICENSE)
---
--- Maintainer : Jose A. Ortega Ruiz <jao@gnu.org>
--- Stability : unstable
--- Portability : unportable
---
------------------------------------------------------------------------------
-
-module Xmobar.X11.Actions (Action(..), runAction, stripActions) where
-
-import System.Process (system)
-import Control.Monad (void)
-import Text.Regex (Regex, subRegex, mkRegex, matchRegex)
-import Graphics.X11.Types (Button)
-
-data Action = Spawn [Button] String
- deriving (Eq, Show)
-
-runAction :: Action -> IO ()
-runAction (Spawn _ s) = void $ system (s ++ "&")
-
-stripActions :: String -> String
-stripActions s = case matchRegex actionRegex s of
- Nothing -> s
- Just _ -> stripActions strippedOneLevel
- where
- strippedOneLevel = subRegex actionRegex s "[action=\\1\\2]\\3[/action]"
-
-actionRegex :: Regex
-actionRegex = mkRegex "<action=`?([^>`]*)`?( +button=[12345]+)?>(.+)</action>"
diff --git a/src/Xmobar/X11/Bitmap.hs b/src/Xmobar/X11/Bitmap.hs
index c17f9d2..2dd47ac 100644
--- a/src/Xmobar/X11/Bitmap.hs
+++ b/src/Xmobar/X11/Bitmap.hs
@@ -2,7 +2,7 @@
-----------------------------------------------------------------------------
-- |
-- Module : X11.Bitmap
--- Copyright : (C) 2013, 2015, 2017, 2018 Alexander Polakov
+-- Copyright : (C) 2013, 2015, 2017, 2018, 2022 Alexander Polakov
-- License : BSD3
--
-- Maintainer : jao@gnu.org
@@ -23,9 +23,9 @@ import Graphics.X11.Xlib
import System.Directory (doesFileExist)
import System.FilePath ((</>))
import System.Mem.Weak ( addFinalizer )
+import Xmobar.Run.Actions (Action)
import Xmobar.X11.ColorCache
import Xmobar.X11.Parsers (TextRenderInfo(..), Widget(..))
-import Xmobar.X11.Actions (Action)
#ifdef XPM
import Xmobar.X11.XPMFile(readXPMFile)
diff --git a/src/Xmobar/X11/Draw.hs b/src/Xmobar/X11/Draw.hs
index 129701b..30f0b75 100644
--- a/src/Xmobar/X11/Draw.hs
+++ b/src/Xmobar/X11/Draw.hs
@@ -32,8 +32,8 @@ import Graphics.X11.Xlib hiding (textExtents, textWidth)
import Graphics.X11.Xlib.Extras
import Xmobar.Config.Types
+import Xmobar.Run.Actions (Action(..))
import qualified Xmobar.X11.Bitmap as B
-import Xmobar.X11.Actions (Action(..))
import Xmobar.X11.Types
import Xmobar.X11.Text
import Xmobar.X11.ColorCache
diff --git a/src/Xmobar/X11/Parsers.hs b/src/Xmobar/X11/Parsers.hs
index 0119208..4688760 100644
--- a/src/Xmobar/X11/Parsers.hs
+++ b/src/Xmobar/X11/Parsers.hs
@@ -25,14 +25,13 @@ module Xmobar.X11.Parsers ( parseString
, Widget(..)) where
import Xmobar.Config.Types
-import Xmobar.X11.Actions
+import Xmobar.Run.Actions
import Control.Monad (guard, mzero)
import Data.Maybe (fromMaybe)
import Data.Int (Int32)
import Text.ParserCombinators.Parsec
import Text.Read (readMaybe)
-import Graphics.X11.Types (Button)
import Foreign.C.Types (CInt)
data Widget = Icon String | Text String | Hspace Int32 deriving Show