Documentation
¶
Index ¶
- func DisableStartup() error
- func EnableStartup() error
- func IsDarkTheme() bool
- func IsStartupEnabled() bool
- func OnReady()
- func SetTemplateIcon(icon []byte, badge IconBadge)
- func SubscribeToThemeChanges(themeChangeChan chan<- bool)
- type BrowserOpener
- type CommandRunner
- type FileWatcher
- type IconBadge
- type IconProvider
- type MenuItem
- type Notifier
- type RealBrowserOpener
- type RealCommandRunner
- type RealFileWatcher
- type RealIconProvider
- type RealMenuItem
- func (r *RealMenuItem) AddSubMenuItem(title, tooltip string) MenuItem
- func (r *RealMenuItem) AddSubMenuItemCheckbox(title, tooltip string, checked bool) MenuItem
- func (r *RealMenuItem) Check()
- func (r *RealMenuItem) ClickedCh() <-chan struct{}
- func (r *RealMenuItem) Disable()
- func (r *RealMenuItem) Enable()
- func (r *RealMenuItem) SetTitle(title string)
- func (r *RealMenuItem) Uncheck()
- type RealNotifier
- type RealStartupManager
- type RealStateManager
- type RealSystemTray
- func (r *RealSystemTray) AddMenuItem(title, tooltip string) MenuItem
- func (r *RealSystemTray) AddSeparator()
- func (r *RealSystemTray) Quit()
- func (r *RealSystemTray) SetTemplateIcon(icon, tooltip []byte)
- func (r *RealSystemTray) SetTitle(title string)
- func (r *RealSystemTray) TrayOpenedCh() <-chan struct{}
- type RealSystemdManager
- func (r *RealSystemdManager) DisableTimer() error
- func (r *RealSystemdManager) DisableTrayIcon() error
- func (r *RealSystemdManager) EnableTimer() error
- func (r *RealSystemdManager) EnableTrayIcon() error
- func (r *RealSystemdManager) IsTimerEnabled() bool
- func (r *RealSystemdManager) IsTrayIconEnabled() bool
- type RealThemeSubscriber
- type RealWatcher
- type StartupManager
- type StateManager
- type SystemTray
- type SystemdManager
- type ThemeSubscriber
- type TrayApp
- type Watcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DisableStartup ¶
func DisableStartup() error
DisableStartup disables the tray icon systemd service
func IsDarkTheme ¶
func IsDarkTheme() bool
func IsStartupEnabled ¶
func IsStartupEnabled() bool
IsStartupEnabled checks if the tray icon systemd service is enabled
func SetTemplateIcon ¶
func SubscribeToThemeChanges ¶
func SubscribeToThemeChanges(themeChangeChan chan<- bool)
Types ¶
type BrowserOpener ¶
BrowserOpener interface for opening URLs in browser
type CommandRunner ¶
CommandRunner interface for running external commands
type FileWatcher ¶
FileWatcher interface for file system watching
type IconBadge ¶
type IconBadge string
SetTemplateIcon sets the system tray icon based on the operating system.
type IconProvider ¶
IconProvider interface for icon management
type MenuItem ¶
type MenuItem interface {
Enable()
Disable()
SetTitle(title string)
AddSubMenuItem(title, tooltip string) MenuItem
AddSubMenuItemCheckbox(title, tooltip string, checked bool) MenuItem
Check()
Uncheck()
ClickedCh() <-chan struct{}
}
MenuItem interface for system tray menu items
type Notifier ¶
type Notifier interface {
Toast(message string)
}
Notifier interface for notifications
type RealBrowserOpener ¶
type RealBrowserOpener struct{}
func (*RealBrowserOpener) OpenURL ¶
func (r *RealBrowserOpener) OpenURL(url string) error
type RealCommandRunner ¶
type RealCommandRunner struct{}
func (*RealCommandRunner) RunCommand ¶
func (r *RealCommandRunner) RunCommand(cmd string, args ...string) (string, error)
type RealFileWatcher ¶
type RealFileWatcher struct{}
func (*RealFileWatcher) NewWatcher ¶
func (r *RealFileWatcher) NewWatcher() (Watcher, error)
type RealIconProvider ¶
type RealIconProvider struct{}
func (*RealIconProvider) IconBlack ¶
func (r *RealIconProvider) IconBlack() []byte
func (*RealIconProvider) IconWhite ¶
func (r *RealIconProvider) IconWhite() []byte
func (*RealIconProvider) SetIcon ¶
func (r *RealIconProvider) SetIcon()
func (*RealIconProvider) WorkingIcon ¶
func (r *RealIconProvider) WorkingIcon()
type RealMenuItem ¶
type RealMenuItem struct {
// contains filtered or unexported fields
}
func (*RealMenuItem) AddSubMenuItem ¶
func (r *RealMenuItem) AddSubMenuItem(title, tooltip string) MenuItem
func (*RealMenuItem) AddSubMenuItemCheckbox ¶
func (r *RealMenuItem) AddSubMenuItemCheckbox(title, tooltip string, checked bool) MenuItem
func (*RealMenuItem) Check ¶
func (r *RealMenuItem) Check()
func (*RealMenuItem) ClickedCh ¶
func (r *RealMenuItem) ClickedCh() <-chan struct{}
func (*RealMenuItem) Disable ¶
func (r *RealMenuItem) Disable()
func (*RealMenuItem) Enable ¶
func (r *RealMenuItem) Enable()
func (*RealMenuItem) SetTitle ¶
func (r *RealMenuItem) SetTitle(title string)
func (*RealMenuItem) Uncheck ¶
func (r *RealMenuItem) Uncheck()
type RealNotifier ¶
type RealNotifier struct{}
func (*RealNotifier) Toast ¶
func (r *RealNotifier) Toast(message string)
type RealStartupManager ¶
type RealStartupManager struct{}
func (*RealStartupManager) DisableStartup ¶
func (r *RealStartupManager) DisableStartup() error
func (*RealStartupManager) EnableStartup ¶
func (r *RealStartupManager) EnableStartup() error
func (*RealStartupManager) IsStartupEnabled ¶
func (r *RealStartupManager) IsStartupEnabled() bool
type RealStateManager ¶
type RealStateManager struct{}
func (*RealStateManager) GetLastState ¶
func (*RealStateManager) GetModifiedTime ¶
func (r *RealStateManager) GetModifiedTime() time.Time
func (*RealStateManager) IsLinked ¶
func (r *RealStateManager) IsLinked() bool
func (*RealStateManager) SelfExe ¶
func (r *RealStateManager) SelfExe() string
func (*RealStateManager) StatePath ¶
func (r *RealStateManager) StatePath() string
type RealSystemTray ¶
type RealSystemTray struct{}
func (*RealSystemTray) AddMenuItem ¶
func (r *RealSystemTray) AddMenuItem(title, tooltip string) MenuItem
func (*RealSystemTray) AddSeparator ¶
func (r *RealSystemTray) AddSeparator()
func (*RealSystemTray) Quit ¶
func (r *RealSystemTray) Quit()
func (*RealSystemTray) SetTemplateIcon ¶
func (r *RealSystemTray) SetTemplateIcon(icon, tooltip []byte)
func (*RealSystemTray) SetTitle ¶
func (r *RealSystemTray) SetTitle(title string)
func (*RealSystemTray) TrayOpenedCh ¶
func (r *RealSystemTray) TrayOpenedCh() <-chan struct{}
type RealSystemdManager ¶
type RealSystemdManager struct{}
func (*RealSystemdManager) DisableTimer ¶
func (r *RealSystemdManager) DisableTimer() error
func (*RealSystemdManager) DisableTrayIcon ¶
func (r *RealSystemdManager) DisableTrayIcon() error
func (*RealSystemdManager) EnableTimer ¶
func (r *RealSystemdManager) EnableTimer() error
func (*RealSystemdManager) EnableTrayIcon ¶
func (r *RealSystemdManager) EnableTrayIcon() error
func (*RealSystemdManager) IsTimerEnabled ¶
func (r *RealSystemdManager) IsTimerEnabled() bool
func (*RealSystemdManager) IsTrayIconEnabled ¶
func (r *RealSystemdManager) IsTrayIconEnabled() bool
type RealThemeSubscriber ¶
type RealThemeSubscriber struct{}
func (*RealThemeSubscriber) SubscribeToThemeChanges ¶
func (r *RealThemeSubscriber) SubscribeToThemeChanges(ch chan<- bool)
type RealWatcher ¶
type RealWatcher struct {
// contains filtered or unexported fields
}
func (*RealWatcher) Add ¶
func (r *RealWatcher) Add(path string) error
func (*RealWatcher) Close ¶
func (r *RealWatcher) Close() error
func (*RealWatcher) Errors ¶
func (r *RealWatcher) Errors() <-chan error
func (*RealWatcher) Events ¶
func (r *RealWatcher) Events() <-chan fsnotify.Event
type StartupManager ¶
type StartupManager interface {
IsStartupEnabled() bool
EnableStartup() error
DisableStartup() error
}
StartupManager interface for startup management
type StateManager ¶
type StateManager interface {
GetLastState(uuid string) (shared.LastState, bool, error)
IsLinked() bool
StatePath() string
GetModifiedTime() time.Time
SelfExe() string
}
StateManager interface for managing application state
type SystemTray ¶
type SystemTray interface {
SetTitle(title string)
SetTemplateIcon(icon, tooltip []byte)
AddMenuItem(title, tooltip string) MenuItem
AddSeparator()
Quit()
TrayOpenedCh() <-chan struct{}
}
SystemTray interface for system tray operations
type SystemdManager ¶
type SystemdManager interface {
IsTimerEnabled() bool
EnableTimer() error
DisableTimer() error
IsTrayIconEnabled() bool
EnableTrayIcon() error
DisableTrayIcon() error
}
SystemdManager interface for systemd operations
type ThemeSubscriber ¶
type ThemeSubscriber interface {
SubscribeToThemeChanges(ch chan<- bool)
}
ThemeSubscriber interface for theme changes
type TrayApp ¶
type TrayApp struct {
// contains filtered or unexported fields
}
TrayApp represents the system tray application with testable dependencies
func NewTrayApp ¶
func NewTrayApp() *TrayApp
NewTrayApp creates a new TrayApp with production dependencies
func NewTrayAppWithDependencies ¶
func NewTrayAppWithDependencies( commandRunner CommandRunner, stateManager StateManager, browserOpener BrowserOpener, systemTray SystemTray, fileWatcher FileWatcher, systemdManager SystemdManager, notifier Notifier, themeSubscriber ThemeSubscriber, iconProvider IconProvider, startupManager StartupManager, broadcaster *shared.Broadcaster, ) *TrayApp
NewTrayAppWithDependencies creates a new TrayApp with custom dependencies for testing