Fix empty clipboard warnings being shown to the user on Wayland if the same entry field is copied multiple times within 30 seconds

Former-commit-id: ef5415a793eaf8088f857331872181b40ef4d78f
Former-commit-id: c1521a73d443c173cd2b23f18f71f99fc54b0eb6
This commit is contained in:
2023-10-26 18:32:47 -04:00
parent f80fd2b6e2
commit 7e1961e0ec
+2 -2
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
from hashlib import sha512
from subprocess import PIPE, run
from subprocess import DEVNULL, PIPE, run
from sys import argv
from time import sleep
@@ -16,7 +16,7 @@ if argv[2] == 'wsl':
run(('powershell.exe', '-c', 'Set-Clipboard'))
elif argv[2] == 'wayland':
hash_paste.update(run('wl-paste', stdout=PIPE).stdout.strip())
hash_paste.update(run('wl-paste', stdout=PIPE, stderr=DEVNULL).stdout.strip())
if argv[1] == hash_paste.hexdigest():
run(('wl-copy', '-c'))