From 30afbafcbf5f6b03905dea086d45a9c005d944e7 Mon Sep 17 00:00:00 2001 From: Randall Winkhart Date: Tue, 26 Sep 2023 18:37:42 -0400 Subject: [PATCH] Fixed xclip throwing errors on FreeBSD Former-commit-id: 65b466c0598f2194d452c0897ffa9eeb7ec3b281 Former-commit-id: 51ad92728be141113047bb25fb8841d141d545e6 --- lib/sshyp.py | 6 +++--- port-jobs/CLIPBOARD.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/sshyp.py b/lib/sshyp.py index 46f3599..880a9e0 100755 --- a/lib/sshyp.py +++ b/lib/sshyp.py @@ -572,10 +572,10 @@ def copy_data(): Popen("sleep 30; termux-clipboard-set ''", shell=True) # X11 clipboard detection elif 'DISPLAY' in environ: - run(('xclip', '-se', 'c'), stdin=Popen(('printf', _copy_subject.replace('\\', '\\\\') + run(('xclip', '-sel', 'c'), stdin=Popen(('printf', _copy_subject.replace('\\', '\\\\') .replace('%', '%%')), stdout=PIPE).stdout) - Popen(f"sleep 30; test \'{_hash.hexdigest() + 2*' ' + '-'}\' = \"$(printf \"$(xclip -o -se c)\" | sha512sum)\" " - "&& xclip -i /dev/null -se c", shell=True) + Popen(f"sleep 30; test \'{_hash.hexdigest() + 2*' ' + '-'}\' = \"$(printf \"$(xclip -o -sel c)\" | sha512sum)\" " + "&& xclip -i /dev/null -sel c", shell=True) else: print('\n\u001b[38;5;9merror: clipboard tool could not be determined\n\nnote that the clipboard does not ' 'function in a raw tty\u001b[0m\n') diff --git a/port-jobs/CLIPBOARD.py b/port-jobs/CLIPBOARD.py index a9b8192..acd3658 100755 --- a/port-jobs/CLIPBOARD.py +++ b/port-jobs/CLIPBOARD.py @@ -30,10 +30,10 @@ if len(arguments) > 0: Popen(f"sleep 30; test \\'{_hash.hexdigest() + 2*' ' + '-'}\\' = \\"$(printf \\"$(wl-paste)\\" | sha512sum)\\" " "&& wl-copy -c", shell=True) else: - run(('xclip', '-se', 'c'), stdin=Popen(('printf', _copy_subject + run(('xclip', '-sel', 'c'), stdin=Popen(('printf', _copy_subject .replace('\\\\\\', '\\\\\\\\\\\\\\').replace('%', '%%')), stdout=PIPE).stdout) - Popen(f"sleep 30; test \\'{_hash.hexdigest() + 2*' ' + '-'}\\' = \\"$(printf \\"$(xclip -o -se c)\\" | sha512sum)\\" " - "&& xclip -i /dev/null -se c", shell=True)""" + Popen(f"sleep 30; test \\'{_hash.hexdigest() + 2*' ' + '-'}\\' = \\"$(printf \\"$(xclip -o -sel c)\\" | sha512sum)\\" " + "&& xclip -i /dev/null -sel c", shell=True)""" else: s_exit()