fix: error time clear clipboard
This commit is contained in:
parent
94402c78a0
commit
0165ab48c0
10
README.MD
10
README.MD
@ -1,7 +1,15 @@
|
||||
## clipboard-sync
|
||||
|
||||
### CommandLineArgs
|
||||
|
||||
- `-t` Launch Type
|
||||
- `s` Server
|
||||
- `c` Client
|
||||
- `-b` Bind Address (Server Only) Default `:8080`
|
||||
- `-a` Server Address(Client Only) Default `http://127.0.0.1:8080`
|
||||
|
||||
### Server
|
||||
./clipboard-sync -t s
|
||||
./clipboard-sync -t s -b :8080
|
||||
|
||||
### Client
|
||||
./clipboard-sync -a http://172.30.34.2:8080
|
2
main.go
2
main.go
@ -69,7 +69,7 @@ func readClipboard(a string) {
|
||||
sTime, _ := strconv.ParseInt(response.Header[timeHeader][0], 10, 64)
|
||||
if sTime > updateTime && sText != old {
|
||||
old = sText
|
||||
updateTime = time.Now().Unix()
|
||||
updateTime = sTime
|
||||
clipboard.WriteAll(sText)
|
||||
fmt.Printf("Update Clipboard: %s\n", sText)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user