summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorgenstern2020-05-06 13:27:43 +1200
committerMorgenstern2020-05-06 13:27:43 +1200
commit9820a01980168167f0d4281a868d6535516b6d3d (patch)
tree766de82156dd8a3573097f8b490ac2eec2e1f7e1
parentee19f9ff3dbb4753a19e25c7afdd2dbc61148682 (diff)
downloadaur-9820a01980168167f0d4281a868d6535516b6d3d.tar.gz
Added passmenu extended typing support
-rw-r--r--.SRCINFO7
-rw-r--r--PKGBUILD20
-rw-r--r--passmenu-extended-typing.patch65
3 files changed, 84 insertions, 8 deletions
diff --git a/.SRCINFO b/.SRCINFO
index ca1a8381acdd..db80ec4f6a1a 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = pass-parcellite
- pkgdesc = Stores, retrieves, generates, and synchronizes passwords securely (Parcellite history removal support)
+ pkgdesc = Stores, retrieves, generates, and synchronizes passwords securely (Parcellite and extended typing support)
pkgver = 1.7.3
- pkgrel = 2
+ pkgrel = 3
url = https://www.passwordstore.org/
arch = any
license = GPL2
@@ -14,6 +14,7 @@ pkgbase = pass-parcellite
optdepends = git: for Git support
optdepends = dmenu: for passmenu
optdepends = qrencode: for QR code support
+ optdepends = xdotool: for typing support
provides = passmenu
provides = pass
conflicts = passmenu
@@ -21,8 +22,10 @@ pkgbase = pass-parcellite
replaces = passmenu
source = https://git.zx2c4.com/password-store/snapshot/password-store-1.7.3.tar.xz
source = pass-parcellite.patch
+ source = passmenu-extended-typing.patch
sha256sums = 2b6c65846ebace9a15a118503dcd31b6440949a30d3b5291dfb5b1615b99a3f4
sha256sums = 451a0e4b09cb56fa57382a6ee30f646fe7734658c709dbe6e2411cafe75af155
+ sha256sums = b65c1f501096b7df74a69d67d7fc5460b53d34bf0bb89c8504b92ac92f5ec2d6
pkgname = pass-parcellite
diff --git a/PKGBUILD b/PKGBUILD
index 84a189bccbd6..1a8ef9909102 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,8 +4,8 @@
pkgname='pass-parcellite'
pkgver=1.7.3
-pkgrel=2
-pkgdesc='Stores, retrieves, generates, and synchronizes passwords securely (Parcellite history removal support)'
+pkgrel=3
+pkgdesc='Stores, retrieves, generates, and synchronizes passwords securely (Parcellite and extended typing support)'
arch=('any')
url='https://www.passwordstore.org/'
license=('GPL2')
@@ -13,18 +13,26 @@ depends=('xclip' 'bash' 'gnupg' 'tree' 'parcellite-git')
checkdepends=('git')
optdepends=('git: for Git support'
'dmenu: for passmenu'
- 'qrencode: for QR code support')
+ 'qrencode: for QR code support'
+ 'xdotool: for typing support')
replaces=('passmenu')
provides=('passmenu' 'pass')
conflicts=('passmenu' 'pass')
source=("https://git.zx2c4.com/password-store/snapshot/password-store-${pkgver}.tar.xz"
- "pass-parcellite.patch")
+ "pass-parcellite.patch"
+ "passmenu-extended-typing.patch")
sha256sums=('2b6c65846ebace9a15a118503dcd31b6440949a30d3b5291dfb5b1615b99a3f4'
- '451a0e4b09cb56fa57382a6ee30f646fe7734658c709dbe6e2411cafe75af155')
+ '451a0e4b09cb56fa57382a6ee30f646fe7734658c709dbe6e2411cafe75af155'
+ 'b65c1f501096b7df74a69d67d7fc5460b53d34bf0bb89c8504b92ac92f5ec2d6')
prepare() {
cd "${srcdir}/password-store-$pkgver/"
- patch --forward --strip=1 --input="${srcdir}/pass-parcellite.patch"
+ # Parcellite history removal support
+ # https://github.com/rickyrockrat/parcellite/commit/fa54161d0ea83357d817d3d16b6ef3f503bafc09
+ patch --forward --strip=1 --input="${srcdir}/pass-parcellite.patch"
+ # Extend "passmenu" to allow username and password typing
+ # https://lists.zx2c4.com/pipermail/password-store/2015-December/001834.html
+ patch --forward --strip=1 --input="${srcdir}/passmenu-extended-typing.patch"
}
check() {
diff --git a/passmenu-extended-typing.patch b/passmenu-extended-typing.patch
new file mode 100644
index 000000000000..4d667aa4e405
--- /dev/null
+++ b/passmenu-extended-typing.patch
@@ -0,0 +1,65 @@
+diff --unified --recursive --text password-store-1.7.3/contrib/dmenu/passmenu password-store-1.7.3.new/contrib/dmenu/passmenu
+--- password-store-1.7.3/contrib/dmenu/passmenu 2018-08-03 15:32:48.000000000 +1200
++++ password-store-1.7.3.new/contrib/dmenu/passmenu 2020-05-06 13:00:50.156634320 +1200
+@@ -8,6 +8,18 @@
+ shift
+ fi
+
++typeuser=0
++if [[ $1 == "--typeuser" ]]; then
++ typeuser=1
++ shift
++fi
++
++typeboth=0
++if [[ $1 == "--typeboth" ]]; then
++ typeboth=1
++ shift
++fi
++
+ prefix=${PASSWORD_STORE_DIR-~/.password-store}
+ password_files=( "$prefix"/**/*.gpg )
+ password_files=( "${password_files[@]#"$prefix"/}" )
+@@ -17,9 +29,19 @@
+
+ [[ -n $password ]] || exit
+
+-if [[ $typeit -eq 0 ]]; then
+- pass show -c "$password" 2>/dev/null
+-else
++if [[ $typeit -eq 1 ]]; then
++ pass show "$password" | { IFS= read -r pass; printf %s "$pass"; } |
++ xdotool type --clearmodifiers --file -
++elif [[ $typeuser -eq 1 ]]; then
++ pass show "$password" | awk 'BEGIN{ORS="\t"} NR==2 {print; exit}' |
++ sed 's/user\:\s//' | # Specify a custom filter if needed
++ xdotool type --clearmodifiers --file -
++elif [[ $typeboth -eq 1 ]]; then
++ pass show "$password" | awk 'BEGIN{ORS="\t"} NR==2 {print; exit}' |
++ sed 's/user\:\s//' | # Specify a custom filter if needed
++ xdotool type --clearmodifiers --file -
+ pass show "$password" | { IFS= read -r pass; printf %s "$pass"; } |
+ xdotool type --clearmodifiers --file -
++else
++ pass show -c "$password" 2>/dev/null
+ fi
+diff --unified --recursive --text password-store-1.7.3/contrib/dmenu/README.md password-store-1.7.3.new/contrib/dmenu/README.md
+--- password-store-1.7.3/contrib/dmenu/README.md 2018-08-03 15:32:48.000000000 +1200
++++ password-store-1.7.3.new/contrib/dmenu/README.md 2020-05-06 12:57:27.023879229 +1200
+@@ -2,11 +2,14 @@
+ password manager. This design allows you to quickly copy a password to the
+ clipboard without having to open up a terminal window if you don't already have
+ one open. If `--type` is specified, the password is typed using [xdotool][]
+-instead of copied to the clipboard.
++instead of copied to the clipboard. If `--typeuser` is specified, the
++second line is typed using [xdotool][] (ideally the username). If `--typeboth`
++is specified, the second line is typed using [xdotool][] first (ideally the
++username), then tab, then the first line.
+
+ # Usage
+
+- passmenu [--type] [dmenu arguments...]
++ passmenu [--type | --typeuser | --typeboth] [dmenu arguments...]
+
+ [dmenu]: http://tools.suckless.org/dmenu/
+ [xdotool]: http://www.semicomplete.com/projects/xdotool/