22 lines
350 B
Go
22 lines
350 B
Go
package clipboard
|
|
|
|
import (
|
|
clip "github.com/atotto/clipboard" // actual implementation
|
|
"opslag.de/schobers/zntg/ui"
|
|
)
|
|
|
|
type clipboard struct {
|
|
}
|
|
|
|
func (c clipboard) WriteText(t string) error {
|
|
return clip.WriteAll(t)
|
|
}
|
|
|
|
func (c clipboard) ReadText() (string, error) {
|
|
return clip.ReadAll()
|
|
}
|
|
|
|
func init() {
|
|
ui.DefaultClipboard = &clipboard{}
|
|
}
|