-
Notifications
You must be signed in to change notification settings - Fork 27
/
hearing.go
23 lines (18 loc) · 921 Bytes
/
hearing.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package accessibility
import (
"context"
"google.golang.org/protobuf/types/known/emptypb"
"google.golang.org/protobuf/types/known/wrapperspb"
)
// GetVisualAlerts returns the current state of visual alerts.
func (s *Service) GetVisualAlerts(ctx context.Context, req *emptypb.Empty) (*wrapperspb.BoolValue, error) {
return &wrapperspb.BoolValue{Value: getBooleanSettings(s.wmSettings, "visual-bell")}, nil
}
// EnableVisualAlerts enables visual alerts.
func (s *Service) EnableVisualAlerts(ctx context.Context, req *emptypb.Empty) (*emptypb.Empty, error) {
return setBooleanSettings(s.wmSettings, "visual-bell", true, "failed to enable visual alerts %v")
}
// DisableVisualAlerts disables visual alerts.
func (s *Service) DisableVisualAlerts(ctx context.Context, req *emptypb.Empty) (*emptypb.Empty, error) {
return setBooleanSettings(s.wmSettings, "visual-bell", false, "failed to disable visual alerts %v")
}