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 ¶
Types ¶
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 Toggle
// DecorationLayout is gtk-decoration-layout, the buttons of a
// client-side titlebar ("icon:minimize,maximize,close").
DecorationLayout string
// XftAntialias is gtk-xft-antialias.
XftAntialias Toggle
// XftHinting is gtk-xft-hinting.
XftHinting Toggle
// XftHintStyle is gtk-xft-hintstyle.
XftHintStyle HintStyle
// XftRGBA is gtk-xft-rgba.
XftRGBA SubpixelOrder
// CursorBlink is gtk-cursor-blink.
CursorBlink Toggle
// CursorBlinkTime is gtk-cursor-blink-time, one whole blink cycle.
CursorBlinkTime time.Duration
// CursorBlinkTimeout is gtk-cursor-blink-timeout, how long the
// caret keeps blinking after the last keypress.
CursorBlinkTimeout time.Duration
// DoubleClickTime is gtk-double-click-time.
DoubleClickTime time.Duration
// DndDragThreshold is gtk-dnd-drag-threshold, in logical pixels.
DndDragThreshold uint32
// EnablePrimaryPaste is gtk-enable-primary-paste.
EnablePrimaryPaste Toggle
// OverlayScrolling is gtk-overlay-scrolling.
OverlayScrolling Toggle
// ShowStatusShapes is gtk-show-status-shapes.
ShowStatusShapes Toggle
// SoundThemeName is gtk-sound-theme-name.
SoundThemeName string
// EnableEventSounds is gtk-enable-event-sounds.
EnableEventSounds Toggle
}
Settings are the settings.ini keys a desktop's GTK apps take their look and feel 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.
type SubpixelOrder ¶ added in v0.2.15
type SubpixelOrder uint8
SubpixelOrder is gtk-xft-rgba, the layout of a pixel's subpixels.
const ( // SubpixelUnset means no file sets gtk-xft-rgba. SubpixelUnset SubpixelOrder = iota // SubpixelNone is none: grayscale antialiasing. SubpixelNone // SubpixelRGB is rgb. SubpixelRGB // SubpixelBGR is bgr. SubpixelBGR // SubpixelVRGB is vrgb. SubpixelVRGB // SubpixelVBGR is vbgr. SubpixelVBGR )