Copyright | (c) Eric Mertens 2016 |
---|---|
License | ISC |
Maintainer | emertens@gmail.com |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
This module defines the top-level configuration information for the client.
Synopsis
- data Configuration = Configuration {
- _configDefaults :: ServerSettings
- _configServers :: HashMap Text ServerSettings
- _configPalette :: Palette
- _configWindowNames :: Text
- _configExtraHighlights :: [Identifier]
- _configNeverHighlights :: [Identifier]
- _configNickPadding :: PaddingMode
- _configMacros :: Recognizer Macro
- _configExtensions :: [ExtensionConfiguration]
- _configUrlOpener :: Maybe UrlOpener
- _configIgnores :: [Text]
- _configActivityBar :: Bool
- _configBellOnMention :: Bool
- _configHideMeta :: Bool
- _configKeyMap :: KeyMap
- _configLayout :: LayoutMode
- _configShowPing :: Bool
- _configJumpModifier :: [Modifier]
- _configDigraphs :: Map Digraph Text
- _configNotifications :: NotifyWith
- data ConfigurationFailure
- data LayoutMode
- data EditMode
- data PaddingMode
- = LeftPadding !Int
- | RightPadding !Int
- | NoPadding
- data ExtensionConfiguration = ExtensionConfiguration {}
- configDefaults :: Lens' Configuration ServerSettings
- configServers :: Lens' Configuration (HashMap Text ServerSettings)
- configPalette :: Lens' Configuration Palette
- configWindowNames :: Lens' Configuration Text
- configNickPadding :: Lens' Configuration PaddingMode
- configMacros :: Lens' Configuration (Recognizer Macro)
- configExtensions :: Lens' Configuration [ExtensionConfiguration]
- configExtraHighlights :: Lens' Configuration [Identifier]
- configNeverHighlights :: Lens' Configuration [Identifier]
- configUrlOpener :: Lens' Configuration (Maybe UrlOpener)
- configIgnores :: Lens' Configuration [Text]
- configActivityBar :: Lens' Configuration Bool
- configBellOnMention :: Lens' Configuration Bool
- configHideMeta :: Lens' Configuration Bool
- configKeyMap :: Lens' Configuration KeyMap
- configLayout :: Lens' Configuration LayoutMode
- configShowPing :: Lens' Configuration Bool
- configJumpModifier :: Lens' Configuration [Modifier]
- configDigraphs :: Lens' Configuration (Map Digraph Text)
- configNotifications :: Lens' Configuration NotifyWith
- configNetworkPalette :: Text -> Configuration -> NetworkPalette
- extensionPath :: Lens' ExtensionConfiguration FilePath
- extensionRtldFlags :: Lens' ExtensionConfiguration [RTLDFlags]
- extensionArgs :: Lens' ExtensionConfiguration [Text]
- loadConfiguration :: Maybe FilePath -> IO (Either ConfigurationFailure (FilePath, Configuration))
- getConfigPath :: IO FilePath
- configurationSpec :: ValueSpec (ServerSettings -> Configuration)
- data FilePathContext
- newFilePathContext :: FilePath -> IO FilePathContext
- resolveFilePath :: FilePathContext -> FilePath -> FilePath
- data UrlOpener = UrlOpener FilePath [UrlArgument]
- data UrlArgument
Configuration type
data Configuration Source #
Top-level client configuration information. When connecting to a
server configuration from _configServers
is used where possible,
otherwise _configDefaults
is used.
Configuration | |
|
Instances
Show Configuration Source # | |
Defined in Client.Configuration showsPrec :: Int -> Configuration -> ShowS # show :: Configuration -> String # showList :: [Configuration] -> ShowS # |
data ConfigurationFailure Source #
Failure cases when loading a configuration file.
ConfigurationReadFailed String | Error message from reading configuration file |
ConfigurationParseFailed FilePath String | Error message from parser or lexer |
ConfigurationMalformed FilePath String | Error message from loading parsed configuration |
Instances
Exception ConfigurationFailure Source # | default instance |
Defined in Client.Configuration | |
Show ConfigurationFailure Source # | |
Defined in Client.Configuration showsPrec :: Int -> ConfigurationFailure -> ShowS # show :: ConfigurationFailure -> String # showList :: [ConfigurationFailure] -> ShowS # |
data LayoutMode Source #
OneColumn | Vertically stack all windows in a single column |
TwoColumn | Vertically stack extra windows in a second column |
Instances
Show LayoutMode Source # | |
Defined in Client.Configuration showsPrec :: Int -> LayoutMode -> ShowS # show :: LayoutMode -> String # showList :: [LayoutMode] -> ShowS # |
data PaddingMode Source #
Setting for how to pad the message prefix.
LeftPadding !Int | Whitespace add to the left side of chat prefix |
RightPadding !Int | Whitespace add to the right side of chat prefix |
NoPadding | No whitespace added |
Instances
Show PaddingMode Source # | |
Defined in Client.Configuration showsPrec :: Int -> PaddingMode -> ShowS # show :: PaddingMode -> String # showList :: [PaddingMode] -> ShowS # |
data ExtensionConfiguration Source #
Configuration information for run-time loaded dynamic library extensions.
ExtensionConfiguration | |
|
Instances
Show ExtensionConfiguration Source # | |
Defined in Client.Configuration showsPrec :: Int -> ExtensionConfiguration -> ShowS # show :: ExtensionConfiguration -> String # showList :: [ExtensionConfiguration] -> ShowS # |
Lenses
configDigraphs :: Lens' Configuration (Map Digraph Text) Source #
configNetworkPalette :: Text -> Configuration -> NetworkPalette Source #
Returns a NetworkPalette for the given network name.
Loading configuration
:: Maybe FilePath | path to configuration file |
-> IO (Either ConfigurationFailure (FilePath, Configuration)) |
Load the configuration file defaulting to ~.glircconfig
.
Given configuration path is optional and actual path used will be returns on success
Resolving paths
getConfigPath :: IO FilePath Source #
Uses getXdgDirectory
XdgConfig
to find ~.configglirc/config
Specification
FilePath resolution
data FilePathContext Source #
:: FilePath | configuration file path |
-> IO FilePathContext |
resolveFilePath :: FilePathContext -> FilePath -> FilePath Source #
Url opener configuration
data UrlArgument Source #
Instances
Show UrlArgument Source # | |
Defined in Client.Configuration showsPrec :: Int -> UrlArgument -> ShowS # show :: UrlArgument -> String # showList :: [UrlArgument] -> ShowS # |