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 |
Public interface of the xmobar library
Synopsis
- xmobar :: Config -> IO ()
- xmobarMain :: IO ()
- defaultConfig :: Config
- configFromArgs :: Config -> IO Config
- tenthSeconds :: Int -> IO ()
- data Runnable = forall r.(Exec r, Read r, Show r) => Run r
- class Show e => Exec e where
- data Command
- data SignalType
- 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
- data XPosition
- data Align
- data Border
- data TextOutputFormat
- newtype SignalChan = SignalChan {
- unSignalChan :: Maybe (TMVar SignalType)
- readConfig :: Config -> FilePath -> IO (Either ParseError (Config, [String]))
- parseConfig :: Config -> String -> Either ParseError (Config, [String])
- 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 = Locks
- 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
- type Args = [String]
- type Program = String
- type Alias = String
- type Station = String
- type SkyConditions = [(String, String)]
- type Zone = String
- type ZoneNo = Int
- type Interface = String
- type Rate = Int
- type DiskSpec = [(String, String)]
- type Slot = String
- data PipeReader = PipeReader String String
- data MarqueePipeReader = MarqueePipeReader String (Length, Rate, Separator) String
- data StdinReader
- data XMonadLog
Documentation
xmobarMain :: IO () Source #
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.)
class Show e => Exec e where Source #
Nothing
run :: e -> IO String Source #
start :: e -> (String -> IO ()) -> IO () Source #
trigger :: e -> (Maybe SignalType -> IO ()) -> IO () Source #
Instances
Exec Runnable Source # | |
Exec StdinReader Source # | |
Defined in Xmobar.Plugins.StdinReader | |
Exec PipeReader Source # | |
Defined in Xmobar.Plugins.PipeReader | |
Exec NotmuchMail Source # | How to execute this plugin. |
Defined in Xmobar.Plugins.NotmuchMail | |
Exec MarqueePipeReader Source # | |
Defined in Xmobar.Plugins.MarqueePipeReader | |
Exec HandleReader Source # | Asynchronously read from the |
Defined in Xmobar.Plugins.HandleReader | |
Exec Date Source # | |
Exec CommandReader Source # | |
Defined in Xmobar.Plugins.CommandReader | |
Exec Command Source # | |
Exec BufferedPipeReader Source # | |
Defined in Xmobar.Plugins.BufferedPipeReader | |
Exec Monitors Source # | |
Exec XMonadLog Source # | |
Exec Locks Source # | |
Exec Kbd Source # | |
Exec EWMH Source # | |
Exec (QueueReader a) Source # | Async queue/channel reading. |
Defined in Xmobar.Plugins.QueueReader |
data SignalType Source #
Wakeup | |
Reposition | |
ChangeScreen | |
Hide Int | |
Reveal Int | |
Toggle Int | |
SetAlpha Int | |
TogglePersistent | |
Action Button Position |
Instances
Read SignalType Source # | |
Defined in Xmobar.System.Signal readsPrec :: Int -> ReadS SignalType # readList :: ReadS [SignalType] # readPrec :: ReadPrec SignalType # readListPrec :: ReadPrec [SignalType] # | |
Show SignalType Source # | |
Defined in Xmobar.System.Signal showsPrec :: Int -> SignalType -> ShowS # show :: SignalType -> String # showList :: [SignalType] -> ShowS # |
Configuration
Configuration data type
The configuration data type
Config | |
|
Top | |
TopH Int | |
TopW Align Int | |
TopSize Align Int Int | |
TopP Int Int | |
Bottom | |
BottomH Int | |
BottomP Int Int | |
BottomW Align Int | |
BottomSize Align Int Int | |
Static | |
OnScreen Int XPosition |
data TextOutputFormat Source #
Instances
Eq TextOutputFormat Source # | |
Defined in Xmobar.Config.Types (==) :: TextOutputFormat -> TextOutputFormat -> Bool # (/=) :: TextOutputFormat -> TextOutputFormat -> Bool # | |
Read TextOutputFormat Source # | |
Defined in Xmobar.Config.Types | |
Show TextOutputFormat Source # | |
Defined in Xmobar.Config.Types showsPrec :: Int -> TextOutputFormat -> ShowS # show :: TextOutputFormat -> String # showList :: [TextOutputFormat] -> ShowS # |
newtype SignalChan Source #
Instances
Read SignalChan Source # | |
Defined in Xmobar.Config.Types readsPrec :: Int -> ReadS SignalChan # readList :: ReadS [SignalChan] # readPrec :: ReadPrec SignalChan # readListPrec :: ReadPrec [SignalChan] # | |
Show SignalChan Source # | |
Defined in Xmobar.Config.Types 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.
data BufferedPipeReader Source #
BufferedPipeReader String [(Int, Bool, String)] |
Instances
Read BufferedPipeReader Source # | |
Defined in Xmobar.Plugins.BufferedPipeReader | |
Show BufferedPipeReader Source # | |
Defined in Xmobar.Plugins.BufferedPipeReader showsPrec :: Int -> BufferedPipeReader -> ShowS # show :: BufferedPipeReader -> String # showList :: [BufferedPipeReader] -> ShowS # | |
Exec BufferedPipeReader Source # | |
Defined in Xmobar.Plugins.BufferedPipeReader |
data CommandReader Source #
Instances
Read CommandReader Source # | |
Defined in Xmobar.Plugins.CommandReader readsPrec :: Int -> ReadS CommandReader # readList :: ReadS [CommandReader] # | |
Show CommandReader Source # | |
Defined in Xmobar.Plugins.CommandReader showsPrec :: Int -> CommandReader -> ShowS # show :: CommandReader -> String # showList :: [CommandReader] -> ShowS # | |
Exec CommandReader Source # | |
Defined in Xmobar.Plugins.CommandReader |
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)
Handle
s 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"
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 readsPrec :: Int -> ReadS HandleReader # readList :: ReadS [HandleReader] # | |
Show HandleReader Source # | |
Defined in Xmobar.Plugins.HandleReader showsPrec :: Int -> HandleReader -> ShowS # show :: HandleReader -> String # showList :: [HandleReader] -> ShowS # | |
Exec HandleReader Source # | Asynchronously read from the |
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"
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 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 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 |
Types
A MailItem
is a name, an address, and a query to give to notmuch
.
data NotmuchMail Source #
A full mail configuration.
Instances
Read NotmuchMail Source # | |
Defined in Xmobar.Plugins.NotmuchMail readsPrec :: Int -> ReadS NotmuchMail # readList :: ReadS [NotmuchMail] # readPrec :: ReadPrec NotmuchMail # readListPrec :: ReadPrec [NotmuchMail] # | |
Show NotmuchMail Source # | |
Defined in Xmobar.Plugins.NotmuchMail showsPrec :: Int -> NotmuchMail -> ShowS # show :: NotmuchMail -> String # showList :: [NotmuchMail] -> ShowS # | |
Exec NotmuchMail Source # | How to execute this plugin. |
Defined in Xmobar.Plugins.NotmuchMail |
type SkyConditions = [(String, String)] Source #
data PipeReader Source #
Instances
Read PipeReader Source # | |
Defined in Xmobar.Plugins.PipeReader readsPrec :: Int -> ReadS PipeReader # readList :: ReadS [PipeReader] # readPrec :: ReadPrec PipeReader # readListPrec :: ReadPrec [PipeReader] # | |
Show PipeReader Source # | |
Defined in Xmobar.Plugins.PipeReader showsPrec :: Int -> PipeReader -> ShowS # show :: PipeReader -> String # showList :: [PipeReader] -> ShowS # | |
Exec PipeReader Source # | |
Defined in Xmobar.Plugins.PipeReader |
data MarqueePipeReader Source #
MarqueePipeReader String (Length, Rate, Separator) String |
Instances
Read MarqueePipeReader Source # | |
Defined in Xmobar.Plugins.MarqueePipeReader | |
Show MarqueePipeReader Source # | |
Defined in Xmobar.Plugins.MarqueePipeReader showsPrec :: Int -> MarqueePipeReader -> ShowS # show :: MarqueePipeReader -> String # showList :: [MarqueePipeReader] -> ShowS # | |
Exec MarqueePipeReader Source # | |
Defined in Xmobar.Plugins.MarqueePipeReader |
data StdinReader Source #
Instances
Read StdinReader Source # | |
Defined in Xmobar.Plugins.StdinReader readsPrec :: Int -> ReadS StdinReader # readList :: ReadS [StdinReader] # readPrec :: ReadPrec StdinReader # readListPrec :: ReadPrec [StdinReader] # | |
Show StdinReader Source # | |
Defined in Xmobar.Plugins.StdinReader showsPrec :: Int -> StdinReader -> ShowS # show :: StdinReader -> String # showList :: [StdinReader] -> ShowS # | |
Exec StdinReader Source # | |
Defined in Xmobar.Plugins.StdinReader |