mirror of
https://github.com/rwinkhart/sshyp.git
synced 2026-08-29 05:16:27 -04:00
Fix clipboard clearing on non-Wayland platforms; drop dos2unix as a WSL dependency; suggest openssh-server on Debian and Fedora
Former-commit-id: 046786460edc669fa9b962314953164c1cce078e Former-commit-id: d9f0eeb57d73a0255c9dc713533d08d30413bf90
This commit is contained in:
+24
-10
@@ -9,19 +9,33 @@ sleep(30)
|
||||
|
||||
# store a hash of the current clipboard contents for later comparison
|
||||
_hash_paste = sha512()
|
||||
_hash_paste.update(run('wl-paste', stdout=PIPE).stdout.strip())
|
||||
|
||||
# if the supplied hash matches the hash of the current clipboard contents, clear the clipboard
|
||||
if argv[1] == _hash_paste.hexdigest():
|
||||
if argv[2] == 'wsl':
|
||||
if argv[2] == 'wsl':
|
||||
_hash_paste.update(run(('powershell.exe', '-c', 'Get-Clipboard'), stdout=PIPE).stdout.strip())
|
||||
# if the supplied hash matches the hash of the current clipboard contents, clear the clipboard
|
||||
if argv[1] == _hash_paste.hexdigest():
|
||||
run(('powershell.exe', '-c', 'Set-Clipboard'))
|
||||
elif argv[2] == 'wayland':
|
||||
|
||||
elif argv[2] == 'wayland':
|
||||
_hash_paste.update(run('wl-paste', stdout=PIPE).stdout.strip())
|
||||
if argv[1] == _hash_paste.hexdigest():
|
||||
run(('wl-copy', '-c'))
|
||||
elif argv[2] == 'haiku':
|
||||
|
||||
elif argv[2] == 'haiku':
|
||||
_hash_paste.update(run(('clipboard', '-p'), stdout=PIPE).stdout.strip())
|
||||
if argv[1] == _hash_paste.hexdigest():
|
||||
run(('clipboard', '-r'))
|
||||
elif argv[2] == 'mac':
|
||||
|
||||
elif argv[2] == 'mac':
|
||||
_hash_paste.update(run(('pbpaste'), stdout=PIPE).stdout.strip())
|
||||
if argv[1] == _hash_paste.hexdigest():
|
||||
run('pbcopy', input=b'')
|
||||
elif argv[2] == 'termux':
|
||||
|
||||
elif argv[2] == 'termux':
|
||||
_hash_paste.update(run(('termux-clipboard-get'), stdout=PIPE).stdout.strip())
|
||||
if argv[1] == _hash_paste.hexdigest():
|
||||
run(("termux-clipboard-set", "''"))
|
||||
elif argv[2] == 'x11':
|
||||
|
||||
elif argv[2] == 'x11':
|
||||
_hash_paste.update(run(('xclip', '-o', '-sel', 'c'), stdout=PIPE).stdout.strip())
|
||||
if argv[1] == _hash_paste.hexdigest():
|
||||
run(('xclip', '-i', '/dev/null', '-sel', 'c'))
|
||||
|
||||
+4
-5
@@ -222,14 +222,13 @@ Maintainer: Randall Winkhart <idgr at tutanota dot com>
|
||||
Description: A light-weight, self-hosted, synchronized password manager
|
||||
Priority: optional
|
||||
Installed-Size: $size
|
||||
Depends: python3, gnupg, openssh-client
|
||||
" > output/debiantemp/sshyp_"$version"-"$revision"_all/DEBIAN/control
|
||||
if [ "$1" = 'Debian' ]; then
|
||||
printf "Depends: python3, gnupg, openssh-client
|
||||
Suggests: wl-clipboard, xclip, bash-completion
|
||||
printf "Suggests: wl-clipboard, xclip, bash-completion, openssh-server
|
||||
" >> output/debiantemp/sshyp_"$version"-"$revision"_all/DEBIAN/control
|
||||
else
|
||||
printf "Depends: python3, gnupg, openssh-client, dos2unix
|
||||
Suggests: bash-completion
|
||||
printf "Suggests: bash-completion, openssh-server
|
||||
" >> output/debiantemp/sshyp_"$version"-"$revision"_all/DEBIAN/control
|
||||
fi
|
||||
dpkg-deb --build --root-owner-group -z6 -Sextreme -Zxz output/debiantemp/sshyp_"$version"-"$revision"_all/
|
||||
@@ -303,7 +302,7 @@ License: GPL-3.0-only
|
||||
URL: https://github.com/rwinkhart/sshyp
|
||||
Source0: GENERIC-FEDORA-sshyp-"$version".tar.xz
|
||||
Requires: python gnupg openssh-clients
|
||||
Recommends: wl-clipboard xclip bash-completion
|
||||
Recommends: wl-clipboard xclip bash-completion openssh-server
|
||||
%%description
|
||||
sshyp is a password-store compatible CLI password manager available for UNIX(-like) systems - its primary goal is to make syncing passwords and notes across devices as easy as possible via CLI.
|
||||
%%install
|
||||
|
||||
Reference in New Issue
Block a user