Skip to content
Eric Mertens edited this page Jun 28, 2024 · 10 revisions

A configuration file can currently be used to provide some default values instead of using command line arguments. If any value is missing the default will be used.

The default configuration file path is ~/.config/glirc/config

Relative paths are relative to the home directory.

Learn more about this file format at config-value

Run glirc2 --config-format to dump a list of the available configuration fields.

Configuration sections

setting type description
defaults server These settings are used for all connections
servers list of servers These settings are used to override defaults when the hostname matches
palette palette Client color overrides
window-names text Names of windows (typically overridden on non QWERTY layouts)
nick-padding nonnegative integer Nicks are padded until they have the specified length
extra-highlights list of text Extra words/nicks to highlight
extensions list of text Filenames of extension to load
url-opener text Command to execute with URL parameter for /url e.g. gnome-open on GNOME or open on macOS
ignores list of text Initial list of nicknames to ignore
activity-bar yes or no Initial setting for visibility of activity bar (default no)
bell-on-mention yes or no Emit bell character to terminal on mention
layout one-column or two-column Initial setting for window layout
macros list of macros User-configurable client commands

Example

-- Default settings are used when omitted from a server entry
defaults:
  nick:            "yournick"
  username:        "yourusername"
  realname:        "Your real name"
  password:        "IRC server password"
  tls:             yes -- or: yes-insecure or no
                       -- enabling tls automatically uses port 6697
  tls-client-cert: "/path/to/cert.pem"
  tls-client-key:  "/path/to/cert.key"

-- Override the defaults when connecting to specific servers
servers:
  * name: "libera"
    hostname:      "irc.libera.chat"
    sasl:
        username: "someuser"
        password: "somepass"
    socks-host:    "socks5.example.com"
    socks-port:    8080 -- defaults to 1080

  * name: "example"
    hostname:      "example.com"
    port:          7000 -- override the default port
    connect-cmds:
      * "join #favoritechannel,#otherchannel"
      * "msg mybot another command"

    -- Specify additional certificates beyond the system CAs
    -- relative to home directory
    server-certificates:
      * "extra/certificate.pem"

macros:
  * name: "wipe"
    commands:
      * "clear"
      * "znc *status clearbuffer $channel"

  * name: "mysplits"
    commands:
      * "splits fn:#haskell fn:#haskell-offtopic"

  -- Example use of macro in combination with an extension
  * name: "extra"
    commands:
      * "extension Lua some-parameter $network $channel"

extra-highlights: ["glirc", "lens"]

palette:
  time:
    fg: [10,10,10] -- RGB values for color for timestamps
    bg: blue