hi3status-0.1.1.0: Status line for i3bar.

LicenseMIT
MaintainerJosh Kirklin (jjvk2@cam.ac.uk)
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Hi3Status.Block.Util

Contents

Description

This module contains a number of common functions that are useful for writing blocks.

Synopsis

BlockM

onUpdate :: BlockM () -> BlockM () Source

Perform a given BlockM when an update is required.

periodic :: Int -> BlockM () -> BlockM () Source

Perform a given BlockM every given number of microseconds, or whenever an update is requested.

periodic_ :: Int -> BlockM () -> BlockM () Source

Perform a given BlockM every given number of microseconds.

Text formatting

formatText :: [(String, String)] -> String -> Text Source

Format a string using the given substitutions and return it as a Text.

>>> formatText [("status","Ready"),("percentage","85")] "{status}: {percentage}%" = "Ready: 85%"