Better modularize clipboard code (add "clip" package; break up TOTP code

This commit is contained in:
2025-11-09 23:23:47 -05:00
parent d49632d221
commit bf1399ce8d
14 changed files with 162 additions and 140 deletions
+16
View File
@@ -0,0 +1,16 @@
//go:build !windows && !darwin && !android && !ios && !termux && !wsl && interactive
package clip
import (
"os"
"strconv"
)
// LaunchClipClearProcess launches the timed clipboard clearing process.
// For interactive GUI/TUI implementations, the clipboard clearing process is launched as a goroutine.
// copySubject can be omitted to clear the clipboard immediately and unconditionally.
func LaunchClipClearProcess(copySubject string, isWayland bool) {
os.Args = []string{os.Args[0], "", strconv.FormatBool(isWayland)}
go clipClearProcess(copySubject)
}