Documentation
¶
Overview ¶
Package config handles loading and validating the kcd daemon configuration. It has zero external imports except github.com/BurntSushi/toml.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultConfigPath ¶
func DefaultConfigPath() string
DefaultConfigPath returns the default config file path.
func DefaultSocketPath ¶ added in v1.0.5
func DefaultSocketPath() string
DefaultSocketPath returns the default IPC socket path.
Types ¶
type BatteryConfig ¶ added in v1.10.0
type BatteryConfig struct {
NotifyLow bool `toml:"notify_low"`
NotifyFull bool `toml:"notify_full"`
LowUrgency string `toml:"low_urgency"`
FullUrgency string `toml:"full_urgency"`
LowMessage string `toml:"low_message"`
FullMessage string `toml:"full_message"`
}
func (*BatteryConfig) Defaults ¶ added in v1.10.0
func (c *BatteryConfig) Defaults()
type Config ¶
type Config struct {
DeviceID string `toml:"device_id"`
DeviceName string `toml:"device_name"`
DeviceType string `toml:"device_type"` // "desktop", "laptop", "phone", "tablet"
CertFile string `toml:"cert_file"`
KeyFile string `toml:"key_file"`
SocketPath string `toml:"socket_path"`
DownloadDir string `toml:"download_dir"`
TCPPort int `toml:"tcp_port"`
// EnableBroadcast was removed — broadcast starts automatically with `kcd pair` (listen mode)
LogLevel string `toml:"log_level"` // "debug", "info", "warn", "error" (or "quiet")
// AutoAcceptPairing was removed in favor of `kcd pair` (listen mode).
// Old config values are silently ignored by the TOML parser.
Plugins PluginConfig `toml:"plugins"`
Commands map[string]string `toml:"commands"`
Notifications NotificationConfig `toml:"notifications"`
Battery BatteryConfig `toml:"battery"`
Notification NotificationPluginConfig `toml:"notification_plugin"`
SFTP SFTPConfig `toml:"sftp"`
Ping PingConfig `toml:"ping"`
Pairing PairingConfig `toml:"pairing"`
Mousepad MousepadConfig `toml:"mousepad"`
SMS SMSConfig `toml:"sms"`
ConfigPath string `toml:"-"` // populated at load time, never written to disk
}
Config holds all daemon configuration.
func Defaults ¶
func Defaults() *Config
Defaults returns a Config populated with sensible defaults using XDG paths.
func (*Config) EnsureDeviceID ¶
EnsureDeviceID generates a UUIDv4-style device ID if one is not already set, and writes the updated config back to the given path.
type MousepadConfig ¶ added in v1.10.0
type MousepadConfig struct {
Backend string `toml:"backend"`
}
func (*MousepadConfig) Defaults ¶ added in v1.10.0
func (c *MousepadConfig) Defaults()
type NotificationConfig ¶ added in v1.0.5
NotificationConfig controls per-app notification filtering.
type NotificationPluginConfig ¶ added in v1.10.0
type NotificationPluginConfig struct {
Urgency string `toml:"urgency"`
FetchIcons bool `toml:"fetch_icons"`
IconCacheDir string `toml:"icon_cache_dir"`
MaxBodyLength int `toml:"max_body_length"`
ExpireMS int `toml:"expire_ms"`
SkipNonClearable bool `toml:"skip_non_clearable"`
}
func (*NotificationPluginConfig) Defaults ¶ added in v1.10.0
func (c *NotificationPluginConfig) Defaults()
type PairingConfig ¶ added in v1.10.0
type PairingConfig struct {
TimeoutSecs int `toml:"timeout_secs"`
}
func (*PairingConfig) Defaults ¶ added in v1.10.0
func (c *PairingConfig) Defaults()
type PingConfig ¶ added in v1.10.0
type PingConfig struct {
AppName string `toml:"app_name"`
Icon string `toml:"icon"`
DefaultMessage string `toml:"default_message"`
}
func (*PingConfig) Defaults ¶ added in v1.10.0
func (c *PingConfig) Defaults()
type PluginConfig ¶
type PluginConfig struct {
Battery bool `toml:"battery"`
Clipboard bool `toml:"clipboard"`
Notification bool `toml:"notification"`
RunCommand bool `toml:"runcommand"`
MPRIS bool `toml:"mpris"`
Ping bool `toml:"ping"`
Telephony bool `toml:"telephony"`
Connectivity bool `toml:"connectivity"`
Mousepad bool `toml:"mousepad"`
SFTP bool `toml:"sftp"`
FindMyPhone bool `toml:"findmyphone"`
LockDevice bool `toml:"lockdevice"`
SystemVolume bool `toml:"systemvolume"`
PauseMusic bool `toml:"pausemusic"`
SMS bool `toml:"sms"`
Presenter bool `toml:"presenter"`
FindThisDevice bool `toml:"findthisdevice"`
}
func (*PluginConfig) Defaults ¶ added in v1.10.0
func (p *PluginConfig) Defaults()
type SFTPConfig ¶ added in v1.10.0
type SFTPConfig struct {
MountDir string `toml:"mount_dir"`
CredentialsTimeoutSecs int `toml:"credentials_timeout_secs"`
KeepaliveIntervalSecs int `toml:"keepalive_interval_secs"`
KeepaliveCount int `toml:"keepalive_count"`
AutoOpen bool `toml:"auto_open"`
OpenCommand string `toml:"open_command"`
ExtraSshfsOpts []string `toml:"extra_sshfs_opts"`
}
func (*SFTPConfig) Defaults ¶ added in v1.10.0
func (c *SFTPConfig) Defaults()
type SMSConfig ¶ added in v1.11.0
type SMSConfig struct {
// NotifyIncoming shows a desktop notification when an SMS is received.
NotifyIncoming bool `toml:"notify_incoming"`
}
type ShareConfig ¶ added in v1.10.0
type ShareConfig struct {
}
func (*ShareConfig) Defaults ¶ added in v1.10.0
func (c *ShareConfig) Defaults()
Click to show internal directories.
Click to hide internal directories.