| Safe Haskell | Safe-Inferred |
|---|---|
| Language | GHC2021 |
Hydra.TUI.Config
Synopsis
- data Theme
- newtype TuiConfig = TuiConfig {}
- defaultConfig :: TuiConfig
- toggleTheme :: Theme -> Theme
- configFilePath :: IO FilePath
- readConfig :: IO TuiConfig
- writeConfig :: TuiConfig -> IO ()
- parseConfig :: Text -> TuiConfig
- encodeConfig :: TuiConfig -> Text
Documentation
Constructors
| DarkTheme | |
| LightTheme |
Instances
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.