| Copyright | (c) 2011 2012 2013 2014 2015 2017 2018 2019 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
Contents
Description
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 Config = Config {
- font :: String
- additionalFonts :: [String]
- wmClass :: String
- wmName :: String
- bgColor :: String
- fgColor :: String
- position :: XPosition
- 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
- data XPosition
- data Align
- data Border
- 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
- 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
- | 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 #
Minimal complete definition
Nothing
Methods
run :: e -> IO String Source #
start :: e -> (String -> IO ()) -> IO () Source #
trigger :: e -> (Maybe SignalType -> IO ()) -> IO () Source #
Instances
| Exec Runnable Source # | |
| Exec Command Source # | |
| Exec PipeReader Source # | |
| Exec NotmuchMail Source # | How to execute this plugin. |
| Exec MarqueePipeReader Source # | |
Defined in Xmobar.Plugins.MarqueePipeReader | |
| Exec HandleReader Source # | Asynchronously read from the |
| Exec Date Source # | |
| Exec CommandReader Source # | |
Defined in Xmobar.Plugins.CommandReader | |
| Exec BufferedPipeReader Source # | |
Defined in Xmobar.Plugins.BufferedPipeReader | |
| Exec Monitors Source # | |
| Exec StdinReader Source # | |
| Exec XMonadLog Source # | |
| Exec Locks Source # | |
| Exec Kbd Source # | |
| Exec EWMH Source # | |
Configuration
Configuration data type
The configuration data type
Constructors
| Config | |
Fields
| |
Constructors
| 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 | |
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 #
Constructors
| BufferedPipeReader String [(Int, Bool, String)] |
Instances
| Read BufferedPipeReader Source # | |
Defined in Xmobar.Plugins.BufferedPipeReader Methods readsPrec :: Int -> ReadS BufferedPipeReader # readList :: ReadS [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 | |
data CommandReader Source #
Constructors
| CommandReader String String |
Instances
| Read CommandReader Source # | |
Defined in Xmobar.Plugins.CommandReader Methods readsPrec :: Int -> ReadS CommandReader # readList :: ReadS [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 | |
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 | |
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] # | |
| 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 |
Types
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. |
Constructors
type SkyConditions = [(String, String)] 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 # | |
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] # | |
| 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 | |
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 # | |