| Copyright | (c) 2011 2012 2013 2014 2015 2017 2018 2019 2022 Jose Antonio Ortega Ruiz (c) 2007 Andrea Rossato |
|---|---|
| License | BSD-style (see LICENSE) |
| Maintainer | Jose A. Ortega Ruiz <jao@gnu.org> |
| Stability | unstable |
| Portability | unportable |
| Safe Haskell | None |
| Language | Haskell2010 |
Xmobar
Description
Public interface of the xmobar library
Synopsis
- xmobar :: Config -> IO ()
- xmobarMain :: IO ()
- defaultConfig :: Config
- configFromArgs :: Config -> IO Config
- tenthSeconds :: Int -> IO ()
- data Runnable = (Exec r, Read r, Show r) => Run r
- class Show e => Exec e where
- data Command
- data SignalType
- = Wakeup
- | Reposition
- | ChangeScreen
- | Hide Int
- | Reveal Int
- | Toggle Int
- | SetAlpha Int
- | TogglePersistent
- | Action Button Position
- data Config = Config {
- font :: String
- additionalFonts :: [String]
- wmClass :: String
- wmName :: String
- bgColor :: String
- fgColor :: String
- position :: XPosition
- textOutput :: Bool
- textOutputFormat :: TextOutputFormat
- textOffset :: Int
- textOffsets :: [Int]
- iconOffset :: Int
- border :: Border
- borderColor :: String
- borderWidth :: Int
- alpha :: Int
- hideOnStart :: Bool
- allDesktops :: Bool
- overrideRedirect :: Bool
- pickBroadest :: Bool
- lowerOnStart :: Bool
- persistent :: Bool
- iconRoot :: FilePath
- commands :: [Runnable]
- sepChar :: String
- alignSep :: String
- template :: String
- verbose :: Bool
- signal :: SignalChan
- dpi :: Double
- data XPosition
- data Align
- data Border
- data TextOutputFormat
- type Segment = (Widget, TextRenderInfo, FontIndex, Maybe [Action])
- type FontIndex = Int
- data Box = Box {}
- data BoxBorder
- data BoxOffset = BoxOffset Align Int32
- data BoxMargins = BoxMargins Int32 Int32 Int32 Int32
- data TextRenderInfo = TextRenderInfo {
- tColorsString :: String
- tBgTopOffset :: Int32
- tBgBottomOffset :: Int32
- tBoxes :: [Box]
- data Widget
- newtype SignalChan = SignalChan {
- unSignalChan :: Maybe (TMVar SignalType)
- data Action = Spawn [Button] String
- type Button = Word32
- readConfig :: Config -> FilePath -> IO (Either ParseError (Config, [String]))
- parseConfig :: Config -> String -> Either ParseError (Config, [String])
- indexedFont :: Config -> FontIndex -> String
- indexedOffset :: Config -> FontIndex -> Int
- colorComponents :: Config -> String -> (String, String)
- module Xmobar.Plugins.Accordion
- data ArchUpdates = ArchUpdates (String, String, String) Rate
- data BufferedPipeReader = BufferedPipeReader String [(Int, Bool, String)]
- data CommandReader = CommandReader String String
- data Date = Date String String Int
- date :: IORef TimeZone -> String -> IO String
- data EWMH
- data HandleReader = HandleReader Handle String
- data QueueReader a = QueueReader {}
- newtype Kbd = Kbd [(String, String)]
- data Locks
- data Mail = Mail [(String, FilePath)] String
- data MailX = MailX [(String, FilePath, String)] [String] String
- data MBox = MBox [(String, FilePath, String)] [String] String
- data MailItem = MailItem {}
- data NotmuchMail = NotmuchMail {}
- data Monitors
- = Network Interface Args Rate
- | DynNetwork Args Rate
- | BatteryP Args Args Rate
- | BatteryN Args Args Rate Alias
- | Battery Args Rate
- | DiskU DiskSpec Args Rate
- | DiskIO DiskSpec Args Rate
- | Load Args Rate
- | Thermal Zone Args Rate
- | ThermalZone ZoneNo Args Rate
- | Memory Args Rate
- | Swap Args Rate
- | Cpu Args Rate
- | MultiCpu Args Rate
- | Brightness Args Rate
- | CpuFreq Args Rate
- | CoreTemp Args Rate
- | MultiCoreTemp Args Rate
- | K10Temp Slot Args Rate
- | TopProc Args Rate
- | TopMem Args Rate
- | Uptime Args Rate
- | CatInt Int FilePath Args Rate
- | Weather Station Args Rate
- | WeatherX Station SkyConditions Args Rate
- | Wireless Interface Args Rate
- | MPD Args Rate
- | MPDX Args Rate Alias
- | AutoMPD Args
- type Rate = Int
- type Args = [String]
- type Program = String
- type Alias = String
- type Interface = String
- type DiskSpec = [(String, String)]
- type Zone = String
- type ZoneNo = Int
- type Slot = String
- type Station = String
- type SkyConditions = [(String, String)]
- data PacmanUpdates = PacmanUpdates (String, String, String, String) Rate
- data PipeReader = PipeReader String String
- data MarqueePipeReader = MarqueePipeReader String (Length, Rate, Separator) String
- data StdinReader
- data XMonadLog
- = XMonadLog
- | UnsafeXMonadLog
- | XPropertyLog String
- | UnsafeXPropertyLog String
- | NamedXPropertyLog String String
- | UnsafeNamedXPropertyLog String String
Documentation
xmobarMain :: IO () Source #
defaultConfig :: Config Source #
The default configuration values
configFromArgs :: Config -> IO Config Source #
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.)
class Show e => Exec e where Source #
Minimal complete definition
Nothing
Methods
run :: e -> IO String Source #
start :: e -> (String -> IO ()) -> IO () Source #
trigger :: e -> (Maybe SignalType -> IO ()) -> IO () Source #
Instances
data SignalType Source #
Constructors
| Wakeup | |
| Reposition | |
| ChangeScreen | |
| Hide Int | |
| Reveal Int | |
| Toggle Int | |
| SetAlpha Int | |
| TogglePersistent | |
| Action Button Position |
Instances
| Read SignalType Source # | |
Defined in Xmobar.System.Signal Methods readsPrec :: Int -> ReadS SignalType readList :: ReadS [SignalType] readPrec :: ReadPrec SignalType readListPrec :: ReadPrec [SignalType] | |
| Show SignalType Source # | |
Defined in Xmobar.System.Signal Methods showsPrec :: Int -> SignalType -> ShowS show :: SignalType -> String showList :: [SignalType] -> ShowS | |
The configuration data type
Constructors
| Config | |
Fields
| |
The position datatype
Constructors
| Top | Top of the screen, full width, auto height |
| TopH | Top of the screen, full width with specific height |
Fields
| |
| TopHM | Top of the screen, full width with specific height and margins |
Fields
| |
| TopW | Top of the screen with specific width (as screen percentage) and alignment |
Fields
| |
| TopSize | Top of the screen with specific width (as screen percentage), height and alignment |
Fields
| |
| TopP | Top of the screen with specific left/right margins |
Fields
| |
| Bottom | Bottom of the screen, full width, auto height |
| BottomH | Bottom of the screen, full width, with specific height |
Fields
| |
| BottomHM | Bottom of the screen with specific height and margins |
Fields
| |
| BottomP | Bottom of the screen with specific left/right margins |
Fields
| |
| BottomW | Bottom of the screen with specific width (as screen percentage) and alignment and alignment |
Fields
| |
| BottomSize | Bottom of the screen with specific width (as screen percentage), height and alignment |
Fields
| |
| Static | Static position and specific size |
| OnScreen | Along with the position characteristics specify the screen to display the bar |
Fields
| |
data TextOutputFormat Source #
Instances
| Read TextOutputFormat Source # | |
Defined in Xmobar.Config.Types Methods readsPrec :: Int -> ReadS TextOutputFormat readList :: ReadS [TextOutputFormat] readPrec :: ReadPrec TextOutputFormat readListPrec :: ReadPrec [TextOutputFormat] | |
| Show TextOutputFormat Source # | |
Defined in Xmobar.Config.Types Methods showsPrec :: Int -> TextOutputFormat -> ShowS show :: TextOutputFormat -> String showList :: [TextOutputFormat] -> ShowS | |
| Eq TextOutputFormat Source # | |
Defined in Xmobar.Config.Types Methods (==) :: TextOutputFormat -> TextOutputFormat -> Bool (/=) :: TextOutputFormat -> TextOutputFormat -> Bool | |
Constructors
| Box | |
Instances
data BoxMargins Source #
Constructors
| BoxMargins Int32 Int32 Int32 Int32 |
Instances
| Show BoxMargins Source # | |
Defined in Xmobar.Config.Types Methods showsPrec :: Int -> BoxMargins -> ShowS show :: BoxMargins -> String showList :: [BoxMargins] -> ShowS | |
| Eq BoxMargins Source # | |
Defined in Xmobar.Config.Types | |
data TextRenderInfo Source #
Constructors
| TextRenderInfo | |
Fields
| |
Instances
| Show TextRenderInfo Source # | |
Defined in Xmobar.Config.Types Methods showsPrec :: Int -> TextRenderInfo -> ShowS show :: TextRenderInfo -> String showList :: [TextRenderInfo] -> ShowS | |
newtype SignalChan Source #
Constructors
| SignalChan | |
Fields
| |
Instances
| Read SignalChan Source # | |
Defined in Xmobar.Config.Types Methods readsPrec :: Int -> ReadS SignalChan readList :: ReadS [SignalChan] readPrec :: ReadPrec SignalChan readListPrec :: ReadPrec [SignalChan] | |
| Show SignalChan Source # | |
Defined in Xmobar.Config.Types Methods showsPrec :: Int -> SignalChan -> ShowS show :: SignalChan -> String showList :: [SignalChan] -> ShowS | |
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
module Xmobar.Plugins.Accordion
data ArchUpdates Source #
Constructors
| ArchUpdates (String, String, String) Rate |
Instances
| Read ArchUpdates Source # | |
Defined in Xmobar.Plugins.ArchUpdates Methods readsPrec :: Int -> ReadS ArchUpdates readList :: ReadS [ArchUpdates] readPrec :: ReadPrec ArchUpdates readListPrec :: ReadPrec [ArchUpdates] | |
| Show ArchUpdates Source # | |
Defined in Xmobar.Plugins.ArchUpdates Methods showsPrec :: Int -> ArchUpdates -> ShowS show :: ArchUpdates -> String showList :: [ArchUpdates] -> ShowS | |
| Exec ArchUpdates Source # | |
Defined in Xmobar.Plugins.ArchUpdates Methods alias :: ArchUpdates -> String Source # rate :: ArchUpdates -> Int Source # run :: ArchUpdates -> IO String Source # start :: ArchUpdates -> (String -> IO ()) -> IO () Source # trigger :: ArchUpdates -> (Maybe SignalType -> IO ()) -> IO () Source # | |
data BufferedPipeReader Source #
Constructors
| BufferedPipeReader String [(Int, Bool, String)] |
Instances
| Read BufferedPipeReader Source # | |
Defined in Xmobar.Plugins.BufferedPipeReader Methods readsPrec :: Int -> ReadS BufferedPipeReader readList :: ReadS [BufferedPipeReader] readPrec :: ReadPrec BufferedPipeReader readListPrec :: ReadPrec [BufferedPipeReader] | |
| Show BufferedPipeReader Source # | |
Defined in Xmobar.Plugins.BufferedPipeReader Methods showsPrec :: Int -> BufferedPipeReader -> ShowS show :: BufferedPipeReader -> String showList :: [BufferedPipeReader] -> ShowS | |
| Exec BufferedPipeReader Source # | |
Defined in Xmobar.Plugins.BufferedPipeReader Methods alias :: BufferedPipeReader -> String Source # rate :: BufferedPipeReader -> Int Source # run :: BufferedPipeReader -> IO String Source # start :: BufferedPipeReader -> (String -> IO ()) -> IO () Source # trigger :: BufferedPipeReader -> (Maybe SignalType -> IO ()) -> IO () Source # | |
data CommandReader Source #
Constructors
| CommandReader String String |
Instances
| Read CommandReader Source # | |
Defined in Xmobar.Plugins.CommandReader Methods readsPrec :: Int -> ReadS CommandReader readList :: ReadS [CommandReader] readPrec :: ReadPrec CommandReader readListPrec :: ReadPrec [CommandReader] | |
| Show CommandReader Source # | |
Defined in Xmobar.Plugins.CommandReader Methods showsPrec :: Int -> CommandReader -> ShowS show :: CommandReader -> String showList :: [CommandReader] -> ShowS | |
| Exec CommandReader Source # | |
Defined in Xmobar.Plugins.CommandReader Methods alias :: CommandReader -> String Source # rate :: CommandReader -> Int Source # run :: CommandReader -> IO String Source # start :: CommandReader -> (String -> IO ()) -> IO () Source # trigger :: CommandReader -> (Maybe SignalType -> IO ()) -> IO () Source # | |
Constructors
| Date String String Int |
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) <-createPipexmobarProcess <-forkProcess$xmobarmyConfig { commands =Run(HandleReaderreadHandle "handle") :commandsmyConfig }hPutStrwriteHandle "Hello World"
Constructors
| HandleReader | |
Fields
| |
Instances
| 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
|
Defined in Xmobar.Plugins.HandleReader Methods readsPrec :: Int -> ReadS HandleReader readList :: ReadS [HandleReader] readPrec :: ReadPrec HandleReader readListPrec :: ReadPrec [HandleReader] | |
| Show HandleReader Source # | |
Defined in Xmobar.Plugins.HandleReader Methods showsPrec :: Int -> HandleReader -> ShowS show :: HandleReader -> String showList :: [HandleReader] -> ShowS | |
| Exec HandleReader Source # | Asynchronously read from the |
Defined in Xmobar.Plugins.HandleReader Methods alias :: HandleReader -> String Source # rate :: HandleReader -> Int Source # run :: HandleReader -> IO String Source # start :: HandleReader -> (String -> IO ()) -> IO () Source # trigger :: HandleReader -> (Maybe SignalType -> IO ()) -> IO () Source # | |
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 | |
Instances
| Read (QueueReader a) Source # | WARNING: This read instance will throw an exception if used! It is
only implemented, because it is required by |
Defined in Xmobar.Plugins.QueueReader Methods readsPrec :: Int -> ReadS (QueueReader a) readList :: ReadS [QueueReader a] readPrec :: ReadPrec (QueueReader a) readListPrec :: ReadPrec [QueueReader a] | |
| Show (QueueReader a) Source # | This cannot be read back. |
Defined in Xmobar.Plugins.QueueReader Methods showsPrec :: Int -> QueueReader a -> ShowS show :: QueueReader a -> String showList :: [QueueReader a] -> ShowS | |
| Exec (QueueReader a) Source # | Async queue/channel reading. |
Defined in Xmobar.Plugins.QueueReader Methods alias :: QueueReader a -> String Source # rate :: QueueReader a -> Int Source # run :: QueueReader a -> IO String Source # start :: QueueReader a -> (String -> IO ()) -> IO () Source # trigger :: QueueReader a -> (Maybe SignalType -> IO ()) -> IO () Source # | |
Constructors
| Kbd [(String, String)] |
A list of mail box names and paths to maildirs.
Constructors
| Mail [(String, FilePath)] String |
A list of mail box names, paths to maildirs and display colors.
Constructors
| MailX [(String, FilePath, String)] [String] String |
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 |
A MailItem is a name, an address, and a query to give to notmuch.
Constructors
| MailItem | |
data NotmuchMail Source #
A full mail configuration.
Constructors
| NotmuchMail | |
Instances
| Read NotmuchMail Source # | |
Defined in Xmobar.Plugins.NotmuchMail Methods readsPrec :: Int -> ReadS NotmuchMail readList :: ReadS [NotmuchMail] readPrec :: ReadPrec NotmuchMail readListPrec :: ReadPrec [NotmuchMail] | |
| Show NotmuchMail Source # | |
Defined in Xmobar.Plugins.NotmuchMail Methods showsPrec :: Int -> NotmuchMail -> ShowS show :: NotmuchMail -> String showList :: [NotmuchMail] -> ShowS | |
| Exec NotmuchMail Source # | How to execute this plugin. |
Defined in Xmobar.Plugins.NotmuchMail Methods alias :: NotmuchMail -> String Source # rate :: NotmuchMail -> Int Source # run :: NotmuchMail -> IO String Source # start :: NotmuchMail -> (String -> IO ()) -> IO () Source # trigger :: NotmuchMail -> (Maybe SignalType -> IO ()) -> IO () Source # | |
Constructors
type SkyConditions = [(String, String)] Source #
data PacmanUpdates Source #
Constructors
| PacmanUpdates (String, String, String, String) Rate |
Instances
| Read PacmanUpdates Source # | |
Defined in Xmobar.Plugins.PacmanUpdates Methods readsPrec :: Int -> ReadS PacmanUpdates readList :: ReadS [PacmanUpdates] readPrec :: ReadPrec PacmanUpdates readListPrec :: ReadPrec [PacmanUpdates] | |
| Show PacmanUpdates Source # | |
Defined in Xmobar.Plugins.PacmanUpdates Methods showsPrec :: Int -> PacmanUpdates -> ShowS show :: PacmanUpdates -> String showList :: [PacmanUpdates] -> ShowS | |
| Exec PacmanUpdates Source # | |
Defined in Xmobar.Plugins.PacmanUpdates Methods alias :: PacmanUpdates -> String Source # rate :: PacmanUpdates -> Int Source # run :: PacmanUpdates -> IO String Source # start :: PacmanUpdates -> (String -> IO ()) -> IO () Source # trigger :: PacmanUpdates -> (Maybe SignalType -> IO ()) -> IO () Source # | |
data PipeReader Source #
Constructors
| PipeReader String String |
Instances
| Read PipeReader Source # | |
Defined in Xmobar.Plugins.PipeReader Methods readsPrec :: Int -> ReadS PipeReader readList :: ReadS [PipeReader] readPrec :: ReadPrec PipeReader readListPrec :: ReadPrec [PipeReader] | |
| Show PipeReader Source # | |
Defined in Xmobar.Plugins.PipeReader Methods showsPrec :: Int -> PipeReader -> ShowS show :: PipeReader -> String showList :: [PipeReader] -> ShowS | |
| Exec PipeReader Source # | |
Defined in Xmobar.Plugins.PipeReader Methods alias :: PipeReader -> String Source # rate :: PipeReader -> Int Source # run :: PipeReader -> IO String Source # start :: PipeReader -> (String -> IO ()) -> IO () Source # trigger :: PipeReader -> (Maybe SignalType -> IO ()) -> IO () Source # | |
data MarqueePipeReader Source #
Constructors
| MarqueePipeReader String (Length, Rate, Separator) String |
Instances
| Read MarqueePipeReader Source # | |
Defined in Xmobar.Plugins.MarqueePipeReader Methods readsPrec :: Int -> ReadS MarqueePipeReader readList :: ReadS [MarqueePipeReader] readPrec :: ReadPrec MarqueePipeReader readListPrec :: ReadPrec [MarqueePipeReader] | |
| Show MarqueePipeReader Source # | |
Defined in Xmobar.Plugins.MarqueePipeReader Methods showsPrec :: Int -> MarqueePipeReader -> ShowS show :: MarqueePipeReader -> String showList :: [MarqueePipeReader] -> ShowS | |
| Exec MarqueePipeReader Source # | |
Defined in Xmobar.Plugins.MarqueePipeReader Methods alias :: MarqueePipeReader -> String Source # rate :: MarqueePipeReader -> Int Source # run :: MarqueePipeReader -> IO String Source # start :: MarqueePipeReader -> (String -> IO ()) -> IO () Source # trigger :: MarqueePipeReader -> (Maybe SignalType -> IO ()) -> IO () Source # | |
data StdinReader Source #
Constructors
| StdinReader | |
| UnsafeStdinReader |
Instances
| Read StdinReader Source # | |
Defined in Xmobar.Plugins.StdinReader Methods readsPrec :: Int -> ReadS StdinReader readList :: ReadS [StdinReader] readPrec :: ReadPrec StdinReader readListPrec :: ReadPrec [StdinReader] | |
| Show StdinReader Source # | |
Defined in Xmobar.Plugins.StdinReader Methods showsPrec :: Int -> StdinReader -> ShowS show :: StdinReader -> String showList :: [StdinReader] -> ShowS | |
| Exec StdinReader Source # | |
Defined in Xmobar.Plugins.StdinReader Methods alias :: StdinReader -> String Source # rate :: StdinReader -> Int Source # run :: StdinReader -> IO String Source # start :: StdinReader -> (String -> IO ()) -> IO () Source # trigger :: StdinReader -> (Maybe SignalType -> IO ()) -> IO () Source # | |
Constructors
| XMonadLog | |
| UnsafeXMonadLog | |
| XPropertyLog String | |
| UnsafeXPropertyLog String | |
| NamedXPropertyLog String String | |
| UnsafeNamedXPropertyLog String String |