You've already forked panic-cli
mirror of
https://github.com/Print-and-Panic/panic-cli.git
synced 2026-01-21 10:17:41 -08:00
33 lines
557 B
Go
33 lines
557 B
Go
package platform
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/Alatec/go-openrgb"
|
|
)
|
|
|
|
var _ StudioController = (*PersonalRig)(nil)
|
|
|
|
type PersonalRig struct {
|
|
LinuxKDE
|
|
}
|
|
|
|
func (p *PersonalRig) ApplyStudioPreset(persona string) error {
|
|
client := openrgb.NewOpenRGBClient()
|
|
client.Connect("localhost:6742")
|
|
defer client.Disconnect()
|
|
|
|
profiles, err := client.ListProfiles()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
for _, profile := range profiles {
|
|
if profile == persona {
|
|
return client.LoadProfile(profile)
|
|
}
|
|
}
|
|
|
|
return fmt.Errorf("profile '%s' not found", persona)
|
|
}
|