taffybar-4.0.1: A desktop bar similar to xmobar, but with more GUI

Copyright | (c) Ivan A. Malison
License | BSD3-style (see LICENSE)
Maintainer | Ivan A. Malison
Stability | unstable
Portability | unportable
Safe Haskell | Safe-Inferred
Language | Haskell2010

System.Taffybar.SimpleConfig

Description

This module defines a simpler, but less flexible config system than the one offered in System.Taffybar.Context.

Synopsis

- data SimpleTaffyConfig = SimpleTaffyConfig {
  - monitorsAction :: TaffyIO [Int]
  - barHeight :: StrutSize
  - barPadding :: Int
  - barPosition :: Position
  - widgetSpacing :: Int
  - startWidgets :: [TaffyIO Widget]
  - centerWidgets :: [TaffyIO Widget]
  - endWidgets :: [TaffyIO Widget]
  - cssPaths :: [FilePath]
  - startupHook :: TaffyIO ()
  }
- data Position
  - = Top
  - | Bottom
- defaultSimpleTaffyConfig :: SimpleTaffyConfig
- simpleDyreTaffybar :: SimpleTaffyConfig -> IO ()
- simpleTaffybar :: SimpleTaffyConfig -> IO ()
- toTaffyConfig :: SimpleTaffyConfig -> TaffybarConfig
- useAllMonitors :: TaffyIO [Int]
- usePrimaryMonitor :: TaffyIO [Int]
- data StrutSize
  - = ExactSize Int32
  - | ScreenRatio Rational

# Documentation

data SimpleTaffyConfig Source #

A configuration object whose interface is simpler than that of `TaffybarConfig`. Unless you have a good reason to use taffybar's more advanced interface, you should stick to using this one.

Constructors

SimpleTaffyConfig |

Fields

- monitorsAction :: TaffyIO [Int]

  The monitor number to put the bar on (default: `usePrimaryMonitor`)

- barHeight :: StrutSize

  Number of pixels to reserve for the bar (default: 30)

- barPadding :: Int

  Number of additional pixels to reserve for the bar strut (default: 0)

- barPosition :: Position

  The position of the bar on the screen (default: `Top`)

- widgetSpacing :: Int

  The number of pixels between widgets (default: 5)

- startWidgets :: [TaffyIO Widget]

  Widget constructors whose outputs are placed at the beginning of the bar

- centerWidgets :: [TaffyIO Widget]

  Widget constructors whose outputs are placed in the center of the bar

- endWidgets :: [TaffyIO Widget]

  Widget constructors whose outputs are placed at the end of the bar

- cssPaths :: [FilePath]

  List of paths to CSS stylesheets that should be loaded at startup.

- startupHook :: TaffyIO ()

  Hook to run at taffybar startup.

#### Instances

Instances details

Default SimpleTaffyConfig Source # |
Instance details Defined in System.Taffybar.SimpleConfig Methods def :: SimpleTaffyConfig #

data Position Source #

An ADT representing the edge of the monitor along which taffybar should be displayed.

Constructors

Top |
Bottom |

#### Instances

Instances details

Show Position Source # |
Instance details Defined in System.Taffybar.SimpleConfig Methods showsPrec :: Int -> Position -> ShowS Source # show :: Position -> String Source # showList :: [Position] -> ShowS Source #
Eq Position Source # |
Instance details Defined in System.Taffybar.SimpleConfig Methods (==) :: Position -> Position -> Bool Source # (/=) :: Position -> Position -> Bool Source #

defaultSimpleTaffyConfig :: SimpleTaffyConfig Source #

Sensible defaults for most of the fields of `SimpleTaffyConfig`. You'll need to specify the widgets you want in the bar with `startWidgets`, `centerWidgets` and `endWidgets`.

simpleDyreTaffybar :: SimpleTaffyConfig -> IO () Source #

Start taffybar using dyre with a `SimpleTaffybarConfig`.

simpleTaffybar :: SimpleTaffyConfig -> IO () Source #

Start taffybar with a `SimpleTaffybarConfig`.

toTaffyConfig :: SimpleTaffyConfig -> TaffybarConfig Source #

Convert a `SimpleTaffyConfig` into a `TaffybarConfig` that can be used with `startTaffybar` or `dyreTaffybar`.

useAllMonitors :: TaffyIO [Int] Source #

Supply this value for `monitorsAction` to display the taffybar window on all monitors.

usePrimaryMonitor :: TaffyIO [Int] Source #

Supply this value for `monitorsAction` to display the taffybar window only on the primary monitor.

data StrutSize Source #

Constructors

ExactSize Int32 |
ScreenRatio Rational |

#### Instances

Instances details

Read StrutSize |
Instance details Defined in Graphics.UI.GIGtkStrut Methods readsPrec :: Int -> ReadS StrutSize Source # readList :: ReadS [StrutSize] Source # readPrec :: ReadPrec StrutSize Source # readListPrec :: ReadPrec [StrutSize] Source #
Show StrutSize |
Instance details Defined in Graphics.UI.GIGtkStrut Methods showsPrec :: Int -> StrutSize -> ShowS Source # show :: StrutSize -> String Source # showList :: [StrutSize] -> ShowS Source #
Eq StrutSize |
Instance details Defined in Graphics.UI.GIGtkStrut Methods (==) :: StrutSize -> StrutSize -> Bool Source # (/=) :: StrutSize -> StrutSize -> Bool Source #