From 032cb86ff8108eb4915a692015da344a41f78506 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 28 Feb 2021 14:51:13 +0100 Subject: Pager.Types: init --- src/Pager/Types.hs | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/Pager/Types.hs (limited to 'src/Pager/Types.hs') diff --git a/src/Pager/Types.hs b/src/Pager/Types.hs new file mode 100644 index 0000000..95dd837 --- /dev/null +++ b/src/Pager/Types.hs @@ -0,0 +1,32 @@ +{-# LANGUAGE TemplateHaskell #-} +module Pager.Types where + +import Data.Aeson.TH (Options(fieldLabelModifier), deriveJSON, defaultOptions) +import Data.Text (Text) + + +data Geometry = Geometry + { geometry_x :: Int + , geometry_y :: Int + , geometry_width :: Int + , geometry_height :: Int + } + +data Window = Window + { window_id :: Int + , window_title :: Text + , window_geometry :: Geometry + , window_focused :: Bool + , window_urgent :: Bool + } + +data Workspace = Workspace + { workspace_geometry :: Geometry + , workspace_focused :: Bool + , workspace_name :: Text + , workspace_windows :: [Window] + } + +$(deriveJSON defaultOptions { fieldLabelModifier = tail . dropWhile (/='_') } ''Geometry) +$(deriveJSON defaultOptions { fieldLabelModifier = tail . dropWhile (/='_') } ''Window) +$(deriveJSON defaultOptions { fieldLabelModifier = tail . dropWhile (/='_') } ''Workspace) -- cgit v1.2.3