mirror of
https://github.com/garraflavatra/rolens.git
synced 2025-07-20 22:48:02 +00:00
Moved UI methods to their own struct
This commit is contained in:
27
internal/ui/ui.go
Normal file
27
internal/ui/ui.go
Normal file
@ -0,0 +1,27 @@
|
||||
package ui
|
||||
|
||||
import (
|
||||
"context"
|
||||
"runtime"
|
||||
|
||||
"github.com/gen2brain/beeep"
|
||||
)
|
||||
|
||||
type UI struct {
|
||||
ctx context.Context
|
||||
}
|
||||
|
||||
func New() *UI {
|
||||
return &UI{}
|
||||
}
|
||||
|
||||
func (u *UI) Startup(ctx context.Context) {
|
||||
u.ctx = ctx
|
||||
}
|
||||
|
||||
func (u *UI) Beep() {
|
||||
if runtime.GOOS == "windows" {
|
||||
return
|
||||
}
|
||||
beeep.Beep(beeep.DefaultFreq, beeep.DefaultDuration)
|
||||
}
|
Reference in New Issue
Block a user