Documentation
¶
Overview ¶
Package gtksettings reads GTK 4's settings.ini: the Settings group GTK falls back to for every setting the desktop does not publish through its portal. The system files (each $XDG_CONFIG_DIRS entry, /etc/xdg by default) load first and the user's ($XDG_CONFIG_HOME/gtk-4.0/settings.ini) overrides them key by key, as gtksettings.c loads them. GTK 4 never reads gtk-3.0's file, so neither does Load.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Animations ¶ added in v0.2.1
type Animations uint8
Animations is gtk-enable-animations: unset when no file sets it, as GTK's default is on.
const ( // AnimationsUnset means no file sets gtk-enable-animations. AnimationsUnset Animations = iota // AnimationsOn is gtk-enable-animations = true. AnimationsOn // AnimationsOff is gtk-enable-animations = false. AnimationsOff )
type Settings ¶
type Settings struct {
// ThemeName is gtk-theme-name.
ThemeName string
// IconThemeName is gtk-icon-theme-name.
IconThemeName string
// CursorThemeName is gtk-cursor-theme-name.
CursorThemeName string
// CursorThemeSize is gtk-cursor-theme-size, in logical pixels.
CursorThemeSize uint32
// FontName is gtk-font-name, a Pango font description.
FontName string
// XftDPI is gtk-xft-dpi.
XftDPI XftDPI
// Animations is gtk-enable-animations.
Animations Animations
}
Settings are the settings.ini keys a desktop's GTK apps take their look from. A zero field is one no file sets.
func Load ¶
Load reads every settings.ini GTK 4 would under env, later files overriding earlier ones key by key. A missing file sets nothing. A file that exists but cannot be read is skipped and reported in the error, which joins one such failure per file; the Settings returned alongside hold what the readable files set.