xmobar-0.46: A Minimalistic Text Based Status Bar
Copyright(c) 2011 2012 2013 2014 2015 2017 2018 2019 2022 Jose Antonio Ortega Ruiz
(c) 2007 Andrea Rossato
LicenseBSD-style (see LICENSE)
MaintainerJose A. Ortega Ruiz <jao@gnu.org>
Stabilityunstable
Portabilityunportable
Safe HaskellNone
LanguageHaskell2010

Xmobar

Contents

Description

Public interface of the xmobar library

Synopsis

Documentation

defaultConfig :: Config Source #

The default configuration values

tenthSeconds :: Int -> IO () Source #

Sleep for a given amount of tenths of a second.

(Work around the Int max bound: since threadDelay takes an Int, it is not possible to set a thread delay grater than about 45 minutes. With a little recursion we solve the problem.)

data Runnable Source #

Constructors

forall r.(Exec r, Read r, Show r) => Run r 

Instances

Instances details
Read Runnable Source # 
Instance details

Defined in Xmobar.Run.Runnable

Show Runnable Source # 
Instance details

Defined in Xmobar.Run.Runnable

Exec Runnable Source # 
Instance details

Defined in Xmobar.Run.Runnable

class Show e => Exec e where Source #

Minimal complete definition

Nothing

Methods

alias :: e -> String Source #

rate :: e -> Int Source #

run :: e -> IO String Source #

start :: e -> (String -> IO ()) -> IO () Source #

trigger :: e -> (Maybe SignalType -> IO ()) -> IO () Source #

Instances

Instances details
Exec Runnable Source # 
Instance details

Defined in Xmobar.Run.Runnable

Exec StdinReader Source # 
Instance details

Defined in Xmobar.Plugins.StdinReader

Exec PipeReader Source # 
Instance details

Defined in Xmobar.Plugins.PipeReader

Exec NotmuchMail Source #

How to execute this plugin.

Instance details

Defined in Xmobar.Plugins.NotmuchMail

Exec MarqueePipeReader Source # 
Instance details

Defined in Xmobar.Plugins.MarqueePipeReader

Exec HandleReader Source #

Asynchronously read from the Handle.

Instance details

Defined in Xmobar.Plugins.HandleReader

Exec DateZone Source # 
Instance details

Defined in Xmobar.Plugins.DateZone

Exec Date Source # 
Instance details

Defined in Xmobar.Plugins.Date

Methods

alias :: Date -> String Source #

rate :: Date -> Int Source #

run :: Date -> IO String Source #

start :: Date -> (String -> IO ()) -> IO () Source #

trigger :: Date -> (Maybe SignalType -> IO ()) -> IO () Source #

Exec CommandReader Source # 
Instance details

Defined in Xmobar.Plugins.CommandReader

Exec Command Source # 
Instance details

Defined in Xmobar.Plugins.Command

Exec BufferedPipeReader Source # 
Instance details

Defined in Xmobar.Plugins.BufferedPipeReader

Exec Monitors Source # 
Instance details

Defined in Xmobar.Plugins.Monitors

Exec MailX Source # 
Instance details

Defined in Xmobar.Plugins.Mail

Methods

alias :: MailX -> String Source #

rate :: MailX -> Int Source #

run :: MailX -> IO String Source #

start :: MailX -> (String -> IO ()) -> IO () Source #

trigger :: MailX -> (Maybe SignalType -> IO ()) -> IO () Source #

Exec Mail Source # 
Instance details

Defined in Xmobar.Plugins.Mail

Methods

alias :: Mail -> String Source #

rate :: Mail -> Int Source #

run :: Mail -> IO String Source #

start :: Mail -> (String -> IO ()) -> IO () Source #

trigger :: Mail -> (Maybe SignalType -> IO ()) -> IO () Source #

Exec MBox Source # 
Instance details

Defined in Xmobar.Plugins.MBox

Methods

alias :: MBox -> String Source #

rate :: MBox -> Int Source #

run :: MBox -> IO String Source #

start :: MBox -> (String -> IO ()) -> IO () Source #

trigger :: MBox -> (Maybe SignalType -> IO ()) -> IO () Source #

Exec XMonadLog Source # 
Instance details

Defined in Xmobar.Plugins.XMonadLog

Exec Locks Source # 
Instance details

Defined in Xmobar.Plugins.Locks

Methods

alias :: Locks -> String Source #

rate :: Locks -> Int Source #

run :: Locks -> IO String Source #

start :: Locks -> (String -> IO ()) -> IO () Source #

trigger :: Locks -> (Maybe SignalType -> IO ()) -> IO () Source #

Exec Kbd Source # 
Instance details

Defined in Xmobar.Plugins.Kbd

Methods

alias :: Kbd -> String Source #

rate :: Kbd -> Int Source #

run :: Kbd -> IO String Source #

start :: Kbd -> (String -> IO ()) -> IO () Source #

trigger :: Kbd -> (Maybe SignalType -> IO ()) -> IO () Source #

Exec EWMH Source # 
Instance details

Defined in Xmobar.Plugins.EWMH

Methods

alias :: EWMH -> String Source #

rate :: EWMH -> Int Source #

run :: EWMH -> IO String Source #

start :: EWMH -> (String -> IO ()) -> IO () Source #

trigger :: EWMH -> (Maybe SignalType -> IO ()) -> IO () Source #

Exec (QueueReader a) Source #

Async queue/channel reading.

Instance details

Defined in Xmobar.Plugins.QueueReader

data Command Source #

Constructors

Com Program Args Alias Rate 
ComX Program Args String Alias Rate 

Instances

Instances details
Eq Command Source # 
Instance details

Defined in Xmobar.Plugins.Command

Methods

(==) :: Command -> Command -> Bool #

(/=) :: Command -> Command -> Bool #

Read Command Source # 
Instance details

Defined in Xmobar.Plugins.Command

Show Command Source # 
Instance details

Defined in Xmobar.Plugins.Command

Exec Command Source # 
Instance details

Defined in Xmobar.Plugins.Command

data Config Source #

The configuration data type

Constructors

Config 

Fields

Instances

Instances details
Read Config Source # 
Instance details

Defined in Xmobar.Config.Types

Show Config Source # 
Instance details

Defined in Xmobar.Config.Types

data XPosition Source #

The position datatype

Constructors

Top

Top of the screen, full width, auto height

TopH

Top of the screen, full width with specific height

Fields

  • Int

    Height (in pixels)

TopHM

Top of the screen, full width with specific height and margins

Fields

  • Int

    Height (in pixels)

  • Int

    Left margin (in pixels)

  • Int

    Right margin (in pixels)

  • Int

    Top margin (in pixels)

  • Int

    Bottom margin (in pixels)

TopW

Top of the screen with specific width (as screen percentage) and alignment

Fields

  • Align

    Alignement (L|C|R)

  • Int

    Width as screen percentage (0-100)

TopSize

Top of the screen with specific width (as screen percentage), height and alignment

Fields

  • Align

    Alignement (L|C|R)

  • Int

    Width as screen percentage (0-100)

  • Int

    Height (in pixels)

TopP

Top of the screen with specific left/right margins

Fields

  • Int

    Left margin (in pixels)

  • Int

    Right margin (in pixels)

Bottom

Bottom of the screen, full width, auto height

BottomH

Bottom of the screen, full width, with specific height

Fields

  • Int

    Height (in pixels)

BottomHM

Bottom of the screen with specific height and margins

Fields

  • Int

    Height (in pixels)

  • Int

    Left margin (in pixels)

  • Int

    Right margin (in pixels)

  • Int

    Top margin (in pixels)

  • Int

    Bottom margin (in pixels)

BottomP

Bottom of the screen with specific left/right margins

Fields

  • Int

    Left margin (in pixels)

  • Int

    Bottom margin (in pixels)

BottomW

Bottom of the screen with specific width (as screen percentage) and alignment and alignment

Fields

  • Align

    Alignement (L|C|R)

  • Int

    Width as screen percentage (0-100)

BottomSize

Bottom of the screen with specific width (as screen percentage), height and alignment

Fields

  • Align

    Alignement (L|C|R)

  • Int

    Width as screen percentage (0-100)

  • Int

    Height (in pixels)

Static

Static position and specific size

Fields

OnScreen

Along with the position characteristics specify the screen to display the bar

Fields

Instances

Instances details
Eq XPosition Source # 
Instance details

Defined in Xmobar.Config.Types

Read XPosition Source # 
Instance details

Defined in Xmobar.Config.Types

Show XPosition Source # 
Instance details

Defined in Xmobar.Config.Types

data Align Source #

Constructors

L 
R 
C 

Instances

Instances details
Eq Align Source # 
Instance details

Defined in Xmobar.Config.Types

Methods

(==) :: Align -> Align -> Bool #

(/=) :: Align -> Align -> Bool #

Read Align Source # 
Instance details

Defined in Xmobar.Config.Types

Show Align Source # 
Instance details

Defined in Xmobar.Config.Types

Methods

showsPrec :: Int -> Align -> ShowS #

show :: Align -> String #

showList :: [Align] -> ShowS #

data Border Source #

Instances

Instances details
Eq Border Source # 
Instance details

Defined in Xmobar.Config.Types

Methods

(==) :: Border -> Border -> Bool #

(/=) :: Border -> Border -> Bool #

Read Border Source # 
Instance details

Defined in Xmobar.Config.Types

Show Border Source # 
Instance details

Defined in Xmobar.Config.Types

data Box Source #

Constructors

Box 

Instances

Instances details
Eq Box Source # 
Instance details

Defined in Xmobar.Config.Types

Methods

(==) :: Box -> Box -> Bool #

(/=) :: Box -> Box -> Bool #

Show Box Source # 
Instance details

Defined in Xmobar.Config.Types

Methods

showsPrec :: Int -> Box -> ShowS #

show :: Box -> String #

showList :: [Box] -> ShowS #

data BoxBorder Source #

Instances

Instances details
Eq BoxBorder Source # 
Instance details

Defined in Xmobar.Config.Types

Read BoxBorder Source # 
Instance details

Defined in Xmobar.Config.Types

Show BoxBorder Source # 
Instance details

Defined in Xmobar.Config.Types

data BoxOffset Source #

Constructors

BoxOffset Align Int32 

Instances

Instances details
Eq BoxOffset Source # 
Instance details

Defined in Xmobar.Config.Types

Show BoxOffset Source # 
Instance details

Defined in Xmobar.Config.Types

data BoxMargins Source #

Instances

Instances details
Eq BoxMargins Source # 
Instance details

Defined in Xmobar.Config.Types

Show BoxMargins Source # 
Instance details

Defined in Xmobar.Config.Types

data TextRenderInfo Source #

Instances

Instances details
Show TextRenderInfo Source # 
Instance details

Defined in Xmobar.Config.Types

data Widget Source #

Constructors

Icon String 
Text String 
Hspace Int32 

Instances

Instances details
Show Widget Source # 
Instance details

Defined in Xmobar.Config.Types

data Action Source #

Constructors

Spawn [Button] String 

Instances

Instances details
Eq Action Source # 
Instance details

Defined in Xmobar.Run.Actions

Methods

(==) :: Action -> Action -> Bool #

(/=) :: Action -> Action -> Bool #

Read Action Source # 
Instance details

Defined in Xmobar.Run.Actions

Show Action Source # 
Instance details

Defined in Xmobar.Run.Actions

readConfig :: Config -> FilePath -> IO (Either ParseError (Config, [String])) Source #

Reads the configuration from a file or an error if it cannot be parsed.

parseConfig :: Config -> String -> Either ParseError (Config, [String]) Source #

Parse the config, logging a list of fields that were missing and replaced by the default definition.

indexedFont :: Config -> FontIndex -> String Source #

Extracts from a configuration the additional font at the corresponding index. Returns the default font if not present.

indexedOffset :: Config -> FontIndex -> Int Source #

Extracts from a configuration the offset at the corresponding index. Returns the default offset if not present.

colorComponents :: Config -> String -> (String, String) Source #

Splits a colors string into its two components

data Date Source #

Constructors

Date String String Int 

Instances

Instances details
Read Date Source # 
Instance details

Defined in Xmobar.Plugins.Date

Show Date Source # 
Instance details

Defined in Xmobar.Plugins.Date

Methods

showsPrec :: Int -> Date -> ShowS #

show :: Date -> String #

showList :: [Date] -> ShowS #

Exec Date Source # 
Instance details

Defined in Xmobar.Plugins.Date

Methods

alias :: Date -> String Source #

rate :: Date -> Int Source #

run :: Date -> IO String Source #

start :: Date -> (String -> IO ()) -> IO () Source #

trigger :: Date -> (Maybe SignalType -> IO ()) -> IO () Source #

data EWMH Source #

Constructors

EWMH 
EWMHFMT Component 

Instances

Instances details
Read EWMH Source # 
Instance details

Defined in Xmobar.Plugins.EWMH

Show EWMH Source # 
Instance details

Defined in Xmobar.Plugins.EWMH

Methods

showsPrec :: Int -> EWMH -> ShowS #

show :: EWMH -> String #

showList :: [EWMH] -> ShowS #

Exec EWMH Source # 
Instance details

Defined in Xmobar.Plugins.EWMH

Methods

alias :: EWMH -> String Source #

rate :: EWMH -> Int Source #

run :: EWMH -> IO String Source #

start :: EWMH -> (String -> IO ()) -> IO () Source #

trigger :: EWMH -> (Maybe SignalType -> IO ()) -> IO () Source #

data HandleReader Source #

A HandleReader displays any text received from a Handle.

This is only useful if you are running xmobar from other Haskell code. You can create a pair of (read, write) Handles using createPipe. Pass the read Handle to HandleReader and write your desired output to the write Handle.

 (readHandle, writeHandle) <- createPipe
 xmobarProcess <- forkProcess $ xmobar myConfig
         { commands =
             Run (HandleReader readHandle "handle") : commands myConfig
         }
 hPutStr writeHandle "Hello World"

Constructors

HandleReader 

Fields

  • Handle

    The Handle to read from.

  • String

    Alias for the HandleReader

Instances

Instances details
Read HandleReader Source #

WARNING: This Read instance will throw an exception if used! It is only implemented because it is required to use HandleReader with Run in commands.

Instance details

Defined in Xmobar.Plugins.HandleReader

Show HandleReader Source # 
Instance details

Defined in Xmobar.Plugins.HandleReader

Exec HandleReader Source #

Asynchronously read from the Handle.

Instance details

Defined in Xmobar.Plugins.HandleReader

data QueueReader a Source #

A QueueReader displays data from an 'TQueue a' where the data items a are rendered by a user supplied function.

Like the HandleReader plugin this is only useful if you are running xmobar from other Haskell code. You should create a new TQueue a and pass it to this plugin.

main :: IO
main = do
  q <- STM.newQueueIO @String
  bar <- forkIO $ xmobar conf
    { commands = Run (QueueReader q id Queue) : commands conf }
  STM.atomically $ STM.writeTQueue q "Some Message"

Constructors

QueueReader 

Fields

Instances

Instances details
Read (QueueReader a) Source #

WARNING: This read instance will throw an exception if used! It is only implemented, because it is required by Run in commands.

Instance details

Defined in Xmobar.Plugins.QueueReader

Show (QueueReader a) Source #

This cannot be read back.

Instance details

Defined in Xmobar.Plugins.QueueReader

Exec (QueueReader a) Source #

Async queue/channel reading.

Instance details

Defined in Xmobar.Plugins.QueueReader

newtype Kbd Source #

Constructors

Kbd [(String, String)] 

Instances

Instances details
Read Kbd Source # 
Instance details

Defined in Xmobar.Plugins.Kbd

Show Kbd Source # 
Instance details

Defined in Xmobar.Plugins.Kbd

Methods

showsPrec :: Int -> Kbd -> ShowS #

show :: Kbd -> String #

showList :: [Kbd] -> ShowS #

Exec Kbd Source # 
Instance details

Defined in Xmobar.Plugins.Kbd

Methods

alias :: Kbd -> String Source #

rate :: Kbd -> Int Source #

run :: Kbd -> IO String Source #

start :: Kbd -> (String -> IO ()) -> IO () Source #

trigger :: Kbd -> (Maybe SignalType -> IO ()) -> IO () Source #

data Locks Source #

Constructors

Locks 

Instances

Instances details
Read Locks Source # 
Instance details

Defined in Xmobar.Plugins.Locks

Show Locks Source # 
Instance details

Defined in Xmobar.Plugins.Locks

Methods

showsPrec :: Int -> Locks -> ShowS #

show :: Locks -> String #

showList :: [Locks] -> ShowS #

Exec Locks Source # 
Instance details

Defined in Xmobar.Plugins.Locks

Methods

alias :: Locks -> String Source #

rate :: Locks -> Int Source #

run :: Locks -> IO String Source #

start :: Locks -> (String -> IO ()) -> IO () Source #

trigger :: Locks -> (Maybe SignalType -> IO ()) -> IO () Source #

data Mail Source #

A list of mail box names and paths to maildirs.

Constructors

Mail [(String, FilePath)] String 

Instances

Instances details
Read Mail Source # 
Instance details

Defined in Xmobar.Plugins.Mail

Show Mail Source # 
Instance details

Defined in Xmobar.Plugins.Mail

Methods

showsPrec :: Int -> Mail -> ShowS #

show :: Mail -> String #

showList :: [Mail] -> ShowS #

Exec Mail Source # 
Instance details

Defined in Xmobar.Plugins.Mail

Methods

alias :: Mail -> String Source #

rate :: Mail -> Int Source #

run :: Mail -> IO String Source #

start :: Mail -> (String -> IO ()) -> IO () Source #

trigger :: Mail -> (Maybe SignalType -> IO ()) -> IO () Source #

data MailX Source #

A list of mail box names, paths to maildirs and display colors.

Constructors

MailX [(String, FilePath, String)] [String] String 

Instances

Instances details
Read MailX Source # 
Instance details

Defined in Xmobar.Plugins.Mail

Show MailX Source # 
Instance details

Defined in Xmobar.Plugins.Mail

Methods

showsPrec :: Int -> MailX -> ShowS #

show :: MailX -> String #

showList :: [MailX] -> ShowS #

Exec MailX Source # 
Instance details

Defined in Xmobar.Plugins.Mail

Methods

alias :: MailX -> String Source #

rate :: MailX -> Int Source #

run :: MailX -> IO String Source #

start :: MailX -> (String -> IO ()) -> IO () Source #

trigger :: MailX -> (Maybe SignalType -> IO ()) -> IO () Source #

data MBox Source #

A list of display names, paths to mbox files and display colours, followed by a list of options.

Constructors

MBox [(String, FilePath, String)] [String] String 

Instances

Instances details
Read MBox Source # 
Instance details

Defined in Xmobar.Plugins.MBox

Show MBox Source # 
Instance details

Defined in Xmobar.Plugins.MBox

Methods

showsPrec :: Int -> MBox -> ShowS #

show :: MBox -> String #

showList :: [MBox] -> ShowS #

Exec MBox Source # 
Instance details

Defined in Xmobar.Plugins.MBox

Methods

alias :: MBox -> String Source #

rate :: MBox -> Int Source #

run :: MBox -> IO String Source #

start :: MBox -> (String -> IO ()) -> IO () Source #

trigger :: MBox -> (Maybe SignalType -> IO ()) -> IO () Source #

Types

data MailItem Source #

A MailItem is a name, an address, and a query to give to notmuch.

Constructors

MailItem 

Fields

  • name :: String

    Display name for the item in the bar

  • address :: String

    Only check for mail sent to this address; may be the empty string to query all indexed mail instead

  • query :: String

    Query to give to notmuch search

Instances

Instances details
Read MailItem Source # 
Instance details

Defined in Xmobar.Plugins.NotmuchMail

Show MailItem Source # 
Instance details

Defined in Xmobar.Plugins.NotmuchMail

data NotmuchMail Source #

A full mail configuration.

Constructors

NotmuchMail 

Fields

data Monitors Source #

Instances

Instances details
Eq Monitors Source # 
Instance details

Defined in Xmobar.Plugins.Monitors

Read Monitors Source # 
Instance details

Defined in Xmobar.Plugins.Monitors

Show Monitors Source # 
Instance details

Defined in Xmobar.Plugins.Monitors

Exec Monitors Source # 
Instance details

Defined in Xmobar.Plugins.Monitors

type Args = [String] Source #

type Rate = Int Source #