mirror of
https://github.com/rwinkhart/sshyp.git
synced 2026-09-05 16:47:14 -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
|
# store a hash of the current clipboard contents for later comparison
|
||||||
_hash_paste = sha512()
|
_hash_paste = sha512()
|
||||||
_hash_paste.update(run('wl-paste', stdout=PIPE).stdout.strip())
|
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 the supplied hash matches the hash of the current clipboard contents, clear the clipboard
|
||||||
if argv[1] == _hash_paste.hexdigest():
|
if argv[1] == _hash_paste.hexdigest():
|
||||||
if argv[2] == 'wsl':
|
|
||||||
run(('powershell.exe', '-c', 'Set-Clipboard'))
|
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'))
|
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'))
|
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'')
|
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", "''"))
|
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'))
|
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
|
Description: A light-weight, self-hosted, synchronized password manager
|
||||||
Priority: optional
|
Priority: optional
|
||||||
Installed-Size: $size
|
Installed-Size: $size
|
||||||
|
Depends: python3, gnupg, openssh-client
|
||||||
" > output/debiantemp/sshyp_"$version"-"$revision"_all/DEBIAN/control
|
" > output/debiantemp/sshyp_"$version"-"$revision"_all/DEBIAN/control
|
||||||
if [ "$1" = 'Debian' ]; then
|
if [ "$1" = 'Debian' ]; then
|
||||||
printf "Depends: python3, gnupg, openssh-client
|
printf "Suggests: wl-clipboard, xclip, bash-completion, openssh-server
|
||||||
Suggests: wl-clipboard, xclip, bash-completion
|
|
||||||
" >> output/debiantemp/sshyp_"$version"-"$revision"_all/DEBIAN/control
|
" >> output/debiantemp/sshyp_"$version"-"$revision"_all/DEBIAN/control
|
||||||
else
|
else
|
||||||
printf "Depends: python3, gnupg, openssh-client, dos2unix
|
printf "Suggests: bash-completion, openssh-server
|
||||||
Suggests: bash-completion
|
|
||||||
" >> output/debiantemp/sshyp_"$version"-"$revision"_all/DEBIAN/control
|
" >> output/debiantemp/sshyp_"$version"-"$revision"_all/DEBIAN/control
|
||||||
fi
|
fi
|
||||||
dpkg-deb --build --root-owner-group -z6 -Sextreme -Zxz output/debiantemp/sshyp_"$version"-"$revision"_all/
|
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
|
URL: https://github.com/rwinkhart/sshyp
|
||||||
Source0: GENERIC-FEDORA-sshyp-"$version".tar.xz
|
Source0: GENERIC-FEDORA-sshyp-"$version".tar.xz
|
||||||
Requires: python gnupg openssh-clients
|
Requires: python gnupg openssh-clients
|
||||||
Recommends: wl-clipboard xclip bash-completion
|
Recommends: wl-clipboard xclip bash-completion openssh-server
|
||||||
%%description
|
%%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.
|
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
|
%%install
|
||||||
|
|||||||
Reference in New Issue
Block a user