config

package
v0.12.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 4, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DBPath

func DBPath() (string, error)

DBPath returns the SQLite database path.

func DataDir

func DataDir() (string, error)

DataDir returns the data directory (~/.local/share/oku on macOS and Linux, %LocalAppData%\oku on Windows).

func EnsureConfigDir

func EnsureConfigDir() error

EnsureConfigDir creates the config directory if it doesn't exist.

func EnsureDataDir

func EnsureDataDir() error

EnsureDataDir creates the data directory if it doesn't exist.

func FilePath

func FilePath() (string, error)

FilePath returns the config file path (~/.config/oku/config.toml on macOS and Linux, %AppData%\oku\config.toml on Windows).

func SetTheme added in v0.9.0

func SetTheme(name string) error

SetTheme writes the `theme` key to the config file. The file is rewritten line by line rather than re-encoded from a Config, so a hand-written config keeps its comments, its key order and any key this build does not know about. name is one of the values the TUI accepts, validated by the caller.

Types

type Config

type Config struct {
	Editor      string `toml:"editor"`
	UseFzf      bool   `toml:"use_fzf"`
	DefaultList string `toml:"default_list"`
	// Theme picks the palette the TUI and the coloured CLI output draw with:
	// "auto" (the default) lets the terminal report its background, "dark"
	// and "light" pin it, and a named palette ("nord", "dracula", …) replaces
	// the built-in one. `oku config theme` lists them.
	Theme string `toml:"theme"`
}

Config holds the application configuration.

func Defaults

func Defaults() Config

Defaults returns a Config with sensible defaults.

func Load

func Load() (Config, error)

Load reads config from the TOML file, falling back to defaults.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL