hydra-tui
Safe HaskellSafe-Inferred
LanguageGHC2021

Hydra.TUI.Config

Synopsis

Documentation

data Theme Source #

Constructors

DarkTheme 
LightTheme 

Instances

Instances details
Show Theme Source # 
Instance details

Defined in Hydra.TUI.Config

Eq Theme Source # 
Instance details

Defined in Hydra.TUI.Config

Methods

(==) :: Theme -> Theme -> Bool Source #

(/=) :: Theme -> Theme -> Bool Source #

newtype TuiConfig Source #

Constructors

TuiConfig 

Fields

Instances

Instances details
Show TuiConfig Source # 
Instance details

Defined in Hydra.TUI.Config

Eq TuiConfig Source # 
Instance details

Defined in Hydra.TUI.Config

defaultConfig :: TuiConfig Source #

Default config used when no file is present or parsing fails.

toggleTheme :: Theme -> Theme Source #

Flip between dark and light themes.

configFilePath :: IO FilePath Source #

Path to the persisted config: $XDG_CONFIG_HOMEhydratui-config.yaml.

readConfig :: IO TuiConfig Source #

Load config from disk, falling back to defaultConfig on missing or unreadable files.

writeConfig :: TuiConfig -> IO () Source #

Persist the config to disk, creating the directory if necessary. Silently swallows IO errors so an unwritable config path never crashes the TUI.

parseConfig :: Text -> TuiConfig Source #

Parse the on-disk config text. Unrecognised content falls back to defaultConfig.

encodeConfig :: TuiConfig -> Text Source #

Serialise the config to its on-disk text form.