From afc2d1ed565910b372f65eaf77ea90878ac3ab2b Mon Sep 17 00:00:00 2001 From: jao Date: Sat, 5 Feb 2022 02:49:22 +0000 Subject: swaybar-protocol: support for clickable Action --- src/Xmobar/Text/Swaybar.hs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/Xmobar/Text/Swaybar.hs') diff --git a/src/Xmobar/Text/Swaybar.hs b/src/Xmobar/Text/Swaybar.hs index 0a7b8af..69739ed 100644 --- a/src/Xmobar/Text/Swaybar.hs +++ b/src/Xmobar/Text/Swaybar.hs @@ -16,9 +16,10 @@ -- ------------------------------------------------------------------------------ -module Xmobar.Text.Swaybar (preamble, formatSwaybar) where +module Xmobar.Text.Swaybar (prepare, formatSwaybar) where import Data.Aeson + import Data.ByteString.Lazy.UTF8 (toString) import GHC.Generics @@ -28,8 +29,9 @@ import Xmobar.Config.Types (Config) import Xmobar.Run.Parsers ( Segment , Widget(..) , tColorsString - , colorComponents - ) + , colorComponents) + +import Xmobar.Text.SwaybarClicks (startHandler) data Preamble = Preamble {version :: !Int, click_events :: Bool} deriving (Eq,Show,Generic) @@ -71,3 +73,6 @@ formatSwaybar' _ _ = defaultBlock formatSwaybar :: Config -> [Segment] -> String formatSwaybar conf segs = asString elems ++ "," where elems = filter (not . null . full_text) (map (formatSwaybar' conf) segs) + +prepare :: IO () +prepare = startHandler >> putStrLn preamble -- cgit v1.2.3