Documentation
¶
Index ¶
- func ConvertToLipglossColor(hex string) lipgloss.Color
- func DetectTerminalDarkMode() bool
- func DetectTerminalDarkModeLive() bool
- func FormatKeys(keys []string) string
- func GetDetectedMode() string
- func InitializeThemeDetection()
- func IsColorDark(colorStr string) bool
- func QueryTerminalBackground() string
- func QueryTerminalBackgroundColor() (string, error)
- func QueryTerminalBackgroundLive() string
- func ResetLiveModeCache()
- func SaveExample() error
- type Config
- type KeyMap
- type KeysConfig
- type StartupConfig
- type Styles
- type ThemeColors
- type ThemeConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertToLipglossColor ¶
ConvertToLipglossColor converts a hex color string to lipgloss.Color
func DetectTerminalDarkMode ¶
func DetectTerminalDarkMode() bool
DetectTerminalDarkMode attempts to detect if terminal is in dark mode
func DetectTerminalDarkModeLive ¶
func DetectTerminalDarkModeLive() bool
DetectTerminalDarkModeLive performs live terminal theme detection for dynamic theme switching while the app is running. The result is cached for liveModeTTL so rapid successive calls (and calls from concurrent goroutines) don't each spawn a subprocess.
An explicit SIMTOOL_THEME_MODE override bypasses the cache.
func FormatKeys ¶
FormatKeys formats multiple keys for display in the UI e.g. ["up", "k"] -> "↑/k"
func GetDetectedMode ¶
func GetDetectedMode() string
GetDetectedMode returns the previously detected mode
func InitializeThemeDetection ¶
func InitializeThemeDetection()
InitializeThemeDetection performs terminal theme detection before TUI starts
func IsColorDark ¶
IsColorDark determines if an RGB color string is dark
func QueryTerminalBackground ¶
func QueryTerminalBackground() string
QueryTerminalBackground attempts to detect terminal background
func QueryTerminalBackgroundColor ¶
QueryTerminalBackgroundColor queries the terminal's background color using OSC 11
func QueryTerminalBackgroundLive ¶
func QueryTerminalBackgroundLive() string
QueryTerminalBackgroundLive attempts to detect terminal background for live updates This version is designed to work even when running inside a TUI
func ResetLiveModeCache ¶ added in v1.1.0
func ResetLiveModeCache()
ResetLiveModeCache clears the cached live theme mode. Intended for tests that need to force a fresh detection query.
Types ¶
type Config ¶
type Config struct {
Theme ThemeConfig `toml:"theme"`
Keys KeysConfig `toml:"keys"`
Startup StartupConfig `toml:"startup"`
}
Config represents the application configuration
func Load ¶
Load loads configuration from the standard config path. On any error a usable default config is returned alongside the error so callers can gracefully fall back.
func (*Config) GenerateStyles ¶
GenerateStyles creates lipgloss styles from the configuration
func (*Config) GetActiveTheme ¶
GetActiveTheme returns the active theme name based on config and terminal mode
type KeyMap ¶
type KeyMap struct {
// contains filtered or unexported fields
}
KeyMap provides a fast lookup for key bindings
func NewKeyMap ¶
func NewKeyMap(keys KeysConfig) *KeyMap
NewKeyMap creates a key mapping from the configuration
type KeysConfig ¶
type KeysConfig struct {
// Navigation
Up []string `toml:"up"`
Down []string `toml:"down"`
Left []string `toml:"left"`
Right []string `toml:"right"`
Home []string `toml:"home"`
End []string `toml:"end"`
// Actions
Quit []string `toml:"quit"`
Boot []string `toml:"boot"` // Boot simulator
Open []string `toml:"open"` // Open in Finder
Filter []string `toml:"filter"` // Toggle filter
Search []string `toml:"search"` // Start search
Escape []string `toml:"escape"` // Exit search/cancel
Enter []string `toml:"enter"` // Select/confirm
// Search mode
Backspace []string `toml:"backspace"` // Delete character in search
}
KeysConfig represents keyboard shortcut configuration
func (*KeysConfig) FormatKeyAction ¶
func (kc *KeysConfig) FormatKeyAction(action string, label string) string
FormatKeyAction formats a key binding with its action label e.g. "up", "up" -> "↑/k: up"
type StartupConfig ¶
type StartupConfig struct {
// Initial view to show on startup: "simulator_list" (default) or "all_apps"
InitialView string `toml:"initial_view"`
}
StartupConfig defines startup behavior
type Styles ¶
type Styles struct {
// Selection styles
Selected lipgloss.Style
Normal lipgloss.Style
// Status styles
Booted lipgloss.Style
Shutdown lipgloss.Style
Error lipgloss.Style
Success lipgloss.Style
// UI element styles
Header lipgloss.Style
Border lipgloss.Style
// Content styles
Name lipgloss.Style
Detail lipgloss.Style
Folder lipgloss.Style
// Search and status styles
Search lipgloss.Style
Status lipgloss.Style
Loading lipgloss.Style
// List item style
ListItem lipgloss.Style
}
Styles holds all the application styles generated from config
type ThemeColors ¶
type ThemeColors struct {
// Base colors
Background string
Foreground string
// UI element colors
Selection string // For selected items
SelectionText string // Text on selected items
Border string // For borders
HeaderBg string // Header background
HeaderFg string // Header foreground
// Status colors
Success string // Success/running status
Error string // Error messages
Warning string // Warnings
Info string // Info messages
// Content colors
Primary string // Primary content (names)
Secondary string // Secondary content (details)
Muted string // Muted text (footer, etc)
Accent string // Accent color (folders, special items)
}
ThemeColors holds all colors derived from a chroma theme
func ExtractThemeColors ¶
func ExtractThemeColors(themeName string) (*ThemeColors, error)
ExtractThemeColors extracts colors from a chroma theme
type ThemeConfig ¶
type ThemeConfig struct {
// Force dark or light mode ("dark", "light", or "auto")
Mode string `toml:"mode"`
// Themes for each mode
DarkTheme string `toml:"dark_theme"` // Theme to use in dark mode
LightTheme string `toml:"light_theme"` // Theme to use in light mode
}
ThemeConfig defines theme configuration