From b2d0d19c4b3d33ea336e78c62e7eddfa805281ac Mon Sep 17 00:00:00 2001 From: jao Date: Sat, 10 Sep 2022 04:33:56 +0100 Subject: cairo: fonts, offsets, colors, actions --- src/Xmobar/Config/Types.hs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/Xmobar/Config/Types.hs') diff --git a/src/Xmobar/Config/Types.hs b/src/Xmobar/Config/Types.hs index 951759d..216ac19 100644 --- a/src/Xmobar/Config/Types.hs +++ b/src/Xmobar/Config/Types.hs @@ -18,6 +18,7 @@ module Xmobar.Config.Types Config (..) , XPosition (..), Align (..), Border (..), TextOutputFormat (..) , SignalChan (..) + , indexedFont, indexedOffset ) where import qualified Control.Concurrent.STM as STM @@ -73,6 +74,16 @@ data Config = , signal :: SignalChan -- ^ The signal channel used to send signals to xmobar } deriving (Read, Show) +indexedFont :: Config -> Int -> String +indexedFont config idx = + if idx < 1 || idx > length (additionalFonts config) + then font config else (additionalFonts config) !! (idx - 1) + +indexedOffset :: Config -> Int -> Int +indexedOffset config idx = + if idx < 1 || idx > length (textOffsets config) + then textOffset config else (textOffsets config) !! (idx - 1) + data XPosition = Top | TopH Int | TopW Align Int -- cgit v1.2.3