taffybar-4.0.2: 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.Widget.Workspaces

Description

Synopsis

- data WorkspaceState
  - = Active
  - | Visible
  - | Hidden
  - | Empty
  - | Urgent
- getCSSClass :: Show s => s -> Text
- cssWorkspaceStates :: [Text]
- data WindowData = WindowData {
  - windowId :: X11Window
  - windowTitle :: String
  - windowClass :: String
  - windowUrgent :: Bool
  - windowActive :: Bool
  - windowMinimized :: Bool
  }
- data WidgetUpdate
  - = WorkspaceUpdate Workspace
  - | IconUpdate [X11Window]
- data Workspace = Workspace {
  - workspaceIdx :: WorkspaceId
  - workspaceName :: String
  - workspaceState :: WorkspaceState
  - windows :: [WindowData]
  }
- data WorkspacesContext = WorkspacesContext {
  - controllersVar :: MVar (Map WorkspaceId WWC)
  - workspacesVar :: MVar (Map WorkspaceId Workspace)
  - workspacesWidget :: Box
  - workspacesConfig :: WorkspacesConfig
  - taffyContext :: Context
  }
- type WorkspacesIO a = ReaderT WorkspacesContext IO a
- liftContext :: TaffyIO a -> WorkspacesIO a
- liftX11Def :: a -> X11Property a -> WorkspacesIO a
- setWorkspaceWidgetStatusClass :: (MonadIO m, IsWidget a) => Workspace -> a -> m ()
- updateWidgetClasses :: (Foldable t1, Foldable t, IsWidget a, MonadIO m) => a -> t1 Text -> t Text -> m ()
- class WorkspaceWidgetController wc where
  - getWidget :: wc -> WorkspacesIO Widget
  - updateWidget :: wc -> WidgetUpdate -> WorkspacesIO wc
  - updateWidgetX11 :: wc -> WidgetUpdate -> WorkspacesIO wc
- data WWC = forall a.WorkspaceWidgetController a => WWC a
- type ControllerConstructor = Workspace -> WorkspacesIO WWC
- type ParentControllerConstructor = ControllerConstructor -> ControllerConstructor
- type WindowIconPixbufGetter = Int32 -> WindowData -> TaffyIO (Maybe Pixbuf)
- data WorkspacesConfig = WorkspacesConfig {
  - widgetBuilder :: ControllerConstructor
  - widgetGap :: Int
  - maxIcons :: Maybe Int
  - minIcons :: Int
  - getWindowIconPixbuf :: WindowIconPixbufGetter
  - labelSetter :: Workspace -> WorkspacesIO String
  - showWorkspaceFn :: Workspace -> Bool
  - borderWidth :: Int
  - updateEvents :: [String]
  - updateRateLimitMicroseconds :: Integer
  - iconSort :: [WindowData] -> WorkspacesIO [WindowData]
  - urgentWorkspaceState :: Bool
  }
- defaultWorkspacesConfig :: WorkspacesConfig
- hideEmpty :: Workspace -> Bool
- wLog :: MonadIO m => Priority -> String -> m ()
- updateVar :: MVar a -> (a -> WorkspacesIO a) -> WorkspacesIO a
- updateWorkspacesVar :: WorkspacesIO (Map WorkspaceId Workspace)
- getWorkspaceToWindows :: [X11Window] -> X11Property (MultiMap WorkspaceId X11Window)
- getWindowData :: Maybe X11Window -> [X11Window] -> X11Window -> X11Property WindowData
- buildWorkspaceData :: Map WorkspaceId Workspace -> WorkspacesIO (Map WorkspaceId Workspace)
- addWidgetsToTopLevel :: WorkspacesIO ()
- addWidget :: WWC -> WorkspacesIO ()
- workspacesNew :: WorkspacesConfig -> TaffyIO Widget
- updateAllWorkspaceWidgets :: WorkspacesIO ()
- setControllerWidgetVisibility :: WorkspacesIO ()
- doWidgetUpdate :: (WorkspaceId -> WWC -> WorkspacesIO WWC) -> WorkspacesIO ()
- updateWorkspaceControllers :: WorkspacesIO ()
- rateLimitFn :: forall req resp. WorkspacesContext -> (req -> IO resp) -> ResultsCombiner req resp -> IO (req -> IO resp)
- onWorkspaceUpdate :: WorkspacesContext -> IO (Event -> IO ())
- onIconChanged :: (Set X11Window -> IO ()) -> Event -> IO ()
- onIconsChanged :: WorkspacesContext -> IO (Set X11Window -> IO ())
- initializeWWC :: WorkspaceWidgetController a => a -> Workspace -> ReaderT WorkspacesContext IO WWC
- data WrappingController = WrappingController {
  - wrappedWidget :: Widget
  - wrappedController :: WWC
  }
- data WorkspaceContentsController = WorkspaceContentsController {
  - containerWidget :: Widget
  - contentsControllers :: [WWC]
  }
- buildContentsController :: [ControllerConstructor] -> ControllerConstructor
- defaultBuildContentsController :: ControllerConstructor
- bottomLeftAlignedBoxWrapper :: Text -> ControllerConstructor -> ControllerConstructor
- buildLabelOverlayController :: ControllerConstructor
- buildOverlayContentsController :: [ControllerConstructor] -> [ControllerConstructor] -> ControllerConstructor
- newtype LabelController = LabelController {
  - label :: Label
  }
- buildLabelController :: ControllerConstructor
- data IconWidget = IconWidget {
  - iconContainer :: EventBox
  - iconImage :: Image
  - iconWindow :: MVar (Maybe WindowData)
  - iconForceUpdate :: IO ()
  }
- getPixbufForIconWidget :: Bool -> MVar (Maybe WindowData) -> Int32 -> WorkspacesIO (Maybe Pixbuf)
- buildIconWidget :: Bool -> Workspace -> WorkspacesIO IconWidget
- data IconController = IconController {
  - iconsContainer :: Box
  - iconImages :: [IconWidget]
  - iconWorkspace :: Workspace
  }
- buildIconController :: ControllerConstructor
- updateWindowIconsById :: IconController -> [X11Window] -> WorkspacesIO ()
- scaledWindowIconPixbufGetter :: WindowIconPixbufGetter -> WindowIconPixbufGetter
- constantScaleWindowIconPixbufGetter :: Int32 -> WindowIconPixbufGetter -> WindowIconPixbufGetter
- handleIconGetterException :: WindowIconPixbufGetter -> WindowIconPixbufGetter
- getWindowIconPixbufFromEWMH :: WindowIconPixbufGetter
- getWindowIconPixbufFromClass :: WindowIconPixbufGetter
- getWindowIconPixbufFromDesktopEntry :: WindowIconPixbufGetter
- getWindowIconPixbufFromChrome :: WindowIconPixbufGetter
- defaultGetWindowIconPixbuf :: WindowIconPixbufGetter
- unscaledDefaultGetWindowIconPixbuf :: WindowIconPixbufGetter
- addCustomIconsToDefaultWithFallbackByPath :: (WindowData -> Maybe FilePath) -> FilePath -> WindowIconPixbufGetter
- addCustomIconsAndFallback :: (WindowData -> Maybe FilePath) -> (Int32 -> TaffyIO (Maybe Pixbuf)) -> WindowIconPixbufGetter -> WindowIconPixbufGetter
- sortWindowsByPosition :: [WindowData] -> WorkspacesIO [WindowData]
- sortWindowsByStackIndex :: [WindowData] -> WorkspacesIO [WindowData]
- updateImages :: IconController -> Workspace -> WorkspacesIO [IconWidget]
- getWindowStatusString :: WindowData -> Text
- possibleStatusStrings :: [Text]
- updateIconWidget :: IconController -> IconWidget -> Maybe WindowData -> WorkspacesIO ()
- data WorkspaceButtonController = WorkspaceButtonController {
  - button :: EventBox
  - buttonWorkspace :: Workspace
  - contentsController :: WWC
  }
- buildButtonController :: ParentControllerConstructor
- switch :: MonadIO m => WorkspacesContext -> WorkspaceId -> m Bool

# Documentation

data WorkspaceState Source #

Constructors

Active |
Visible |
Hidden |
Empty |
Urgent |

#### Instances

Instances details

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

getCSSClass :: Show s => s -> Text Source #

cssWorkspaceStates :: [Text] Source #

data WindowData Source #

Constructors

WindowData |

Fields

- windowId :: X11Window
- windowTitle :: String
- windowClass :: String
- windowUrgent :: Bool
- windowActive :: Bool
- windowMinimized :: Bool

#### Instances

Instances details

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

data WidgetUpdate Source #

Constructors

WorkspaceUpdate Workspace |
IconUpdate [X11Window] |

data Workspace Source #

Constructors

Workspace |

Fields

- workspaceIdx :: WorkspaceId
- workspaceName :: String
- workspaceState :: WorkspaceState
- windows :: [WindowData]

#### Instances

Instances details

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

data WorkspacesContext Source #

Constructors

WorkspacesContext |

Fields

- controllersVar :: MVar (Map WorkspaceId WWC)
- workspacesVar :: MVar (Map WorkspaceId Workspace)
- workspacesWidget :: Box
- workspacesConfig :: WorkspacesConfig
- taffyContext :: Context

type WorkspacesIO a = ReaderT WorkspacesContext IO a Source #

liftContext :: TaffyIO a -> WorkspacesIO a Source #

liftX11Def :: a -> X11Property a -> WorkspacesIO a Source #

setWorkspaceWidgetStatusClass :: (MonadIO m, IsWidget a) => Workspace -> a -> m () Source #

updateWidgetClasses :: (Foldable t1, Foldable t, IsWidget a, MonadIO m) => a -> t1 Text -> t Text -> m () Source #

class WorkspaceWidgetController wc where Source #

Minimal complete definition

getWidget, updateWidget

Methods

getWidget :: wc -> WorkspacesIO Widget Source #

updateWidget :: wc -> WidgetUpdate -> WorkspacesIO wc Source #

updateWidgetX11 :: wc -> WidgetUpdate -> WorkspacesIO wc Source #

#### Instances

Instances details

WorkspaceWidgetController IconController Source # |
Instance details Defined in System.Taffybar.Widget.Workspaces Methods getWidget :: IconController -> WorkspacesIO Widget Source # updateWidget :: IconController -> WidgetUpdate -> WorkspacesIO IconController Source # updateWidgetX11 :: IconController -> WidgetUpdate -> WorkspacesIO IconController Source #
WorkspaceWidgetController LabelController Source # |
Instance details Defined in System.Taffybar.Widget.Workspaces Methods getWidget :: LabelController -> WorkspacesIO Widget Source # updateWidget :: LabelController -> WidgetUpdate -> WorkspacesIO LabelController Source # updateWidgetX11 :: LabelController -> WidgetUpdate -> WorkspacesIO LabelController Source #
WorkspaceWidgetController WWC Source # |
Instance details Defined in System.Taffybar.Widget.Workspaces Methods getWidget :: WWC -> WorkspacesIO Widget Source # updateWidget :: WWC -> WidgetUpdate -> WorkspacesIO WWC Source # updateWidgetX11 :: WWC -> WidgetUpdate -> WorkspacesIO WWC Source #
WorkspaceWidgetController WorkspaceButtonController Source # |
Instance details Defined in System.Taffybar.Widget.Workspaces Methods getWidget :: WorkspaceButtonController -> WorkspacesIO Widget Source # updateWidget :: WorkspaceButtonController -> WidgetUpdate -> WorkspacesIO WorkspaceButtonController Source # updateWidgetX11 :: WorkspaceButtonController -> WidgetUpdate -> WorkspacesIO WorkspaceButtonController Source #
WorkspaceWidgetController WorkspaceContentsController Source # |
Instance details Defined in System.Taffybar.Widget.Workspaces Methods getWidget :: WorkspaceContentsController -> WorkspacesIO Widget Source # updateWidget :: WorkspaceContentsController -> WidgetUpdate -> WorkspacesIO WorkspaceContentsController Source # updateWidgetX11 :: WorkspaceContentsController -> WidgetUpdate -> WorkspacesIO WorkspaceContentsController Source #
WorkspaceWidgetController WrappingController Source # |
Instance details Defined in System.Taffybar.Widget.Workspaces Methods getWidget :: WrappingController -> WorkspacesIO Widget Source # updateWidget :: WrappingController -> WidgetUpdate -> WorkspacesIO WrappingController Source # updateWidgetX11 :: WrappingController -> WidgetUpdate -> WorkspacesIO WrappingController Source #

data WWC Source #

Constructors

forall a.WorkspaceWidgetController a => WWC a |

#### Instances

Instances details

WorkspaceWidgetController WWC Source # |
Instance details Defined in System.Taffybar.Widget.Workspaces Methods getWidget :: WWC -> WorkspacesIO Widget Source # updateWidget :: WWC -> WidgetUpdate -> WorkspacesIO WWC Source # updateWidgetX11 :: WWC -> WidgetUpdate -> WorkspacesIO WWC Source #

type ControllerConstructor = Workspace -> WorkspacesIO WWC Source #

type ParentControllerConstructor = ControllerConstructor -> ControllerConstructor Source #

type WindowIconPixbufGetter = Int32 -> WindowData -> TaffyIO (Maybe Pixbuf) Source #

data WorkspacesConfig Source #

Constructors

WorkspacesConfig |

Fields

- widgetBuilder :: ControllerConstructor
- widgetGap :: Int
- maxIcons :: Maybe Int
- minIcons :: Int
- getWindowIconPixbuf :: WindowIconPixbufGetter
- labelSetter :: Workspace -> WorkspacesIO String
- showWorkspaceFn :: Workspace -> Bool
- borderWidth :: Int
- updateEvents :: [String]
- updateRateLimitMicroseconds :: Integer
- iconSort :: [WindowData] -> WorkspacesIO [WindowData]
- urgentWorkspaceState :: Bool

#### Instances

Instances details

Default WorkspacesConfig Source # |
Instance details Defined in System.Taffybar.Widget.Workspaces Methods def :: WorkspacesConfig #

defaultWorkspacesConfig :: WorkspacesConfig Source #

hideEmpty :: Workspace -> Bool Source #

wLog :: MonadIO m => Priority -> String -> m () Source #

updateVar :: MVar a -> (a -> WorkspacesIO a) -> WorkspacesIO a Source #

updateWorkspacesVar :: WorkspacesIO (Map WorkspaceId Workspace) Source #

getWorkspaceToWindows :: [X11Window] -> X11Property (MultiMap WorkspaceId X11Window) Source #

getWindowData :: Maybe X11Window -> [X11Window] -> X11Window -> X11Property WindowData Source #

buildWorkspaceData :: Map WorkspaceId Workspace -> WorkspacesIO (Map WorkspaceId Workspace) Source #

addWidgetsToTopLevel :: WorkspacesIO () Source #

addWidget :: WWC -> WorkspacesIO () Source #

workspacesNew :: WorkspacesConfig -> TaffyIO Widget Source #

updateAllWorkspaceWidgets :: WorkspacesIO () Source #

setControllerWidgetVisibility :: WorkspacesIO () Source #

doWidgetUpdate :: (WorkspaceId -> WWC -> WorkspacesIO WWC) -> WorkspacesIO () Source #

updateWorkspaceControllers :: WorkspacesIO () Source #

rateLimitFn :: forall req resp. WorkspacesContext -> (req -> IO resp) -> ResultsCombiner req resp -> IO (req -> IO resp) Source #

onWorkspaceUpdate :: WorkspacesContext -> IO (Event -> IO ()) Source #

onIconChanged :: (Set X11Window -> IO ()) -> Event -> IO () Source #

onIconsChanged :: WorkspacesContext -> IO (Set X11Window -> IO ()) Source #

initializeWWC :: WorkspaceWidgetController a => a -> Workspace -> ReaderT WorkspacesContext IO WWC Source #

data WrappingController Source #

A WrappingController can be used to wrap some child widget with another abitrary widget.

Constructors

WrappingController |

Fields

- wrappedWidget :: Widget
- wrappedController :: WWC

#### Instances

Instances details

WorkspaceWidgetController WrappingController Source # |
Instance details Defined in System.Taffybar.Widget.Workspaces Methods getWidget :: WrappingController -> WorkspacesIO Widget Source # updateWidget :: WrappingController -> WidgetUpdate -> WorkspacesIO WrappingController Source # updateWidgetX11 :: WrappingController -> WidgetUpdate -> WorkspacesIO WrappingController Source #

data WorkspaceContentsController Source #

Constructors

WorkspaceContentsController |

Fields

- containerWidget :: Widget
- contentsControllers :: [WWC]

#### Instances

Instances details

WorkspaceWidgetController WorkspaceContentsController Source # |
Instance details Defined in System.Taffybar.Widget.Workspaces Methods getWidget :: WorkspaceContentsController -> WorkspacesIO Widget Source # updateWidget :: WorkspaceContentsController -> WidgetUpdate -> WorkspacesIO WorkspaceContentsController Source # updateWidgetX11 :: WorkspaceContentsController -> WidgetUpdate -> WorkspacesIO WorkspaceContentsController Source #

buildContentsController :: [ControllerConstructor] -> ControllerConstructor Source #

defaultBuildContentsController :: ControllerConstructor Source #

bottomLeftAlignedBoxWrapper :: Text -> ControllerConstructor -> ControllerConstructor Source #

buildLabelOverlayController :: ControllerConstructor Source #

buildOverlayContentsController :: [ControllerConstructor] -> [ControllerConstructor] -> ControllerConstructor Source #

newtype LabelController Source #

Constructors

LabelController |

Fields

- label :: Label

#### Instances

Instances details

WorkspaceWidgetController LabelController Source # |
Instance details Defined in System.Taffybar.Widget.Workspaces Methods getWidget :: LabelController -> WorkspacesIO Widget Source # updateWidget :: LabelController -> WidgetUpdate -> WorkspacesIO LabelController Source # updateWidgetX11 :: LabelController -> WidgetUpdate -> WorkspacesIO LabelController Source #

buildLabelController :: ControllerConstructor Source #

data IconWidget Source #

Constructors

IconWidget |

Fields

- iconContainer :: EventBox
- iconImage :: Image
- iconWindow :: MVar (Maybe WindowData)
- iconForceUpdate :: IO ()

getPixbufForIconWidget :: Bool -> MVar (Maybe WindowData) -> Int32 -> WorkspacesIO (Maybe Pixbuf) Source #

buildIconWidget :: Bool -> Workspace -> WorkspacesIO IconWidget Source #

data IconController Source #

Constructors

IconController |

Fields

- iconsContainer :: Box
- iconImages :: [IconWidget]
- iconWorkspace :: Workspace

#### Instances

Instances details

WorkspaceWidgetController IconController Source # |
Instance details Defined in System.Taffybar.Widget.Workspaces Methods getWidget :: IconController -> WorkspacesIO Widget Source # updateWidget :: IconController -> WidgetUpdate -> WorkspacesIO IconController Source # updateWidgetX11 :: IconController -> WidgetUpdate -> WorkspacesIO IconController Source #

buildIconController :: ControllerConstructor Source #

updateWindowIconsById :: IconController -> [X11Window] -> WorkspacesIO () Source #

scaledWindowIconPixbufGetter :: WindowIconPixbufGetter -> WindowIconPixbufGetter Source #

constantScaleWindowIconPixbufGetter :: Int32 -> WindowIconPixbufGetter -> WindowIconPixbufGetter Source #

handleIconGetterException :: WindowIconPixbufGetter -> WindowIconPixbufGetter Source #

getWindowIconPixbufFromEWMH :: WindowIconPixbufGetter Source #

getWindowIconPixbufFromClass :: WindowIconPixbufGetter Source #

getWindowIconPixbufFromDesktopEntry :: WindowIconPixbufGetter Source #

getWindowIconPixbufFromChrome :: WindowIconPixbufGetter Source #

defaultGetWindowIconPixbuf :: WindowIconPixbufGetter Source #

unscaledDefaultGetWindowIconPixbuf :: WindowIconPixbufGetter Source #

addCustomIconsToDefaultWithFallbackByPath :: (WindowData -> Maybe FilePath) -> FilePath -> WindowIconPixbufGetter Source #

addCustomIconsAndFallback :: (WindowData -> Maybe FilePath) -> (Int32 -> TaffyIO (Maybe Pixbuf)) -> WindowIconPixbufGetter -> WindowIconPixbufGetter Source #

sortWindowsByPosition :: [WindowData] -> WorkspacesIO [WindowData] Source #

Sort windows by top-left corner position.

sortWindowsByStackIndex :: [WindowData] -> WorkspacesIO [WindowData] Source #

Sort windows in reverse _NET_CLIENT_LIST_STACKING order. Starting in xmonad-contrib 0.17.0, this is effectively focus history, active first. Previous versions erroneously stored focus-sort-order in _NET_CLIENT_LIST.

updateImages :: IconController -> Workspace -> WorkspacesIO [IconWidget] Source #

getWindowStatusString :: WindowData -> Text Source #

possibleStatusStrings :: [Text] Source #

updateIconWidget :: IconController -> IconWidget -> Maybe WindowData -> WorkspacesIO () Source #

data WorkspaceButtonController Source #

Constructors

WorkspaceButtonController |

Fields

- button :: EventBox
- buttonWorkspace :: Workspace
- contentsController :: WWC

#### Instances

Instances details

WorkspaceWidgetController WorkspaceButtonController Source # |
Instance details Defined in System.Taffybar.Widget.Workspaces Methods getWidget :: WorkspaceButtonController -> WorkspacesIO Widget Source # updateWidget :: WorkspaceButtonController -> WidgetUpdate -> WorkspacesIO WorkspaceButtonController Source # updateWidgetX11 :: WorkspaceButtonController -> WidgetUpdate -> WorkspacesIO WorkspaceButtonController Source #

buildButtonController :: ParentControllerConstructor Source #

switch :: MonadIO m => WorkspacesContext -> WorkspaceId -> m Bool Source #