Ariver
2026-05-18 db6aabfb7aa4460c8858fec0a51534ebe34786f7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
package services
 
import (
    "voicesnap/internal/config"
    "voicesnap/internal/dock"
    "voicesnap/internal/startup"
)
 
// ConfigService provides configuration read/write methods to the frontend.
type ConfigService struct {
    cfg *config.Config
}
 
func NewConfigService(cfg *config.Config) *ConfigService {
    return &ConfigService{cfg: cfg}
}
 
// GetConfig returns the current configuration.
func (s *ConfigService) GetConfig() *config.Config {
    return s.cfg
}
 
// SetAutoHide sets the auto-hide indicator preference.
func (s *ConfigService) SetAutoHide(enabled bool) {
    s.cfg.AutoHide = enabled
    config.Save(s.cfg)
}
 
// GetAutoHide returns the auto-hide preference.
func (s *ConfigService) GetAutoHide() bool {
    return s.cfg.AutoHide
}
 
// SetSoundFeedback sets the sound feedback preference.
func (s *ConfigService) SetSoundFeedback(enabled bool) {
    s.cfg.SoundFeedback = enabled
    config.Save(s.cfg)
}
 
// GetSoundFeedback returns the sound feedback preference.
func (s *ConfigService) GetSoundFeedback() bool {
    return s.cfg.SoundFeedback
}
 
// SetHotkeyMode sets the voice input interaction mode.
func (s *ConfigService) SetHotkeyMode(mode string) {
    s.cfg.HotkeyMode = config.NormalizeHotkeyMode(mode)
    config.Save(s.cfg)
}
 
// GetHotkeyMode returns the voice input interaction mode.
func (s *ConfigService) GetHotkeyMode() string {
    s.cfg.HotkeyMode = config.NormalizeHotkeyMode(s.cfg.HotkeyMode)
    return s.cfg.HotkeyMode
}
 
// SetCopyToClipboard sets whether recognized text remains in the clipboard after input.
func (s *ConfigService) SetCopyToClipboard(enabled bool) {
    s.cfg.CopyToClipboard = enabled
    config.Save(s.cfg)
}
 
// GetCopyToClipboard returns whether recognized text remains in the clipboard after input.
func (s *ConfigService) GetCopyToClipboard() bool {
    return s.cfg.CopyToClipboard
}
 
// SetHideDockIcon sets whether the app should hide its Dock icon on macOS.
func (s *ConfigService) SetHideDockIcon(enabled bool) {
    s.cfg.HideDockIcon = enabled
    config.Save(s.cfg)
    dock.SetHidden(enabled)
}
 
// GetHideDockIcon returns whether the Dock icon should be hidden.
func (s *ConfigService) GetHideDockIcon() bool {
    return s.cfg.HideDockIcon
}
 
// IsStartupEnabled returns whether the app is set to start at login.
func (s *ConfigService) IsStartupEnabled() bool {
    return startup.IsEnabled()
}
 
// SetStartupEnabled enables or disables start at login.
func (s *ConfigService) SetStartupEnabled(enabled bool) error {
    return startup.SetEnabled(enabled)
}