From 56f3e25756a6f0d88ce06aee8cea490de8176415 Mon Sep 17 00:00:00 2001 From: Jonathan Lestrelin Date: Sun, 12 May 2019 00:07:39 +0200 Subject: [PATCH] * Change icon to one that GNOME installs by default * Remove option to install to different dirs as that is broken due to hardcoded paths in D-bus service files. * Don't install fuzzywuzzy through pip from install.sh as it may be preferable to install it from distribution packages * Improve README a bit --- README.md | 24 ++++++++++++++-------- conf/org.gnome.Pass.SearchProvider.desktop | 2 +- install.sh | 18 ++++++++-------- 3 files changed, 24 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 15ff408..d6291c2 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -A search provider for GNOME Shell that adds support for searching in [pass](https://www.passwordstore.org/). +A search provider for GNOME Shell that adds support for searching in zx2c4/[pass](https://www.passwordstore.org/). Names of passwords will show up in GNOME Shell searches, choosing one will copy the corresponding content to the clipboard. @@ -12,6 +12,12 @@ Install `gnome-pass-search-provider-git` from the AUR. Ensure that python>=3.5 and python-gobject are installed on your system and that pass is setup. +Install Python 3 fuzzywuzzy module. +Depending on your distribution this can be packaged as python-fuzzywuzzy, python3-fuzzywuzzy or you might need to install it with pip: +```shell +python3 -m pip install fuzzywuzzy +``` + Download or clone this repository: ```shell git clone git@github.com:jle64/gnome-shell-pass-search-provider.git @@ -22,11 +28,6 @@ Run the installation script as root: sudo ./install.sh ``` -If you need to you can change the installation paths to suit your system: -```shell -sudo SYSCONFDIR=/etc DATADIR=/usr/share LIBDIR=/usr/lib LIBEXECDIR=/usr/lib ./install.sh -``` - # Post-installation Recommended : set gpg agent to use pinentry-gnome3 by adding `pinentry-program /usr/bin/pinentry-gnome3` to `~/.gnupg/gpg-agent.conf`. @@ -43,7 +44,12 @@ The [pass-otp](https://github.com/tadfisher/pass-otp) extension is supported. Se # Environment variables If you are configuring pass through environment variables, such as `PASSWORD_STORE_DIR`, make sure to set them in a way that will propagate to the search provider executable, not just in your shell. -Setting them in `~/.profile` should be sufficient. +Setting them in `~/.profile` or `~/.pam_environment` should be sufficient, but stuff in shell-specific files such as `~/.bashrc` and co will not be picked up by gnome-shell. + +If your values have no effect, make sure they propagate to the script environment: +```shell +ps auxeww | grep [g]nome-pass-search-provider.py +``` # Clipboard managers @@ -52,9 +58,9 @@ Otherwise they are sent to the clipboard using `pass -c` which defaults to expir # Compatibility -This implements the `org.gnome.Shell.SearchProvider2` D-Bus API which seems to be present in GNOME Shell since around 2012 and has been tested with GNOME Shell 3.22-3.30. +This implements the `org.gnome.Shell.SearchProvider2` D-Bus API and has been tested with GNOME Shell 3.22-3.32. # Troubleshooting -If this does not work for you, make sure to look to wherever GNOME and D-Bus are logging for error messages (in the journal on systemd-using systems). +If this does not work for you, make sure to look to wherever GNOME and D-Bus are logging for error messages (using `journalctl --user` on systemd-using systems). Don't hesitate to open an issue. diff --git a/conf/org.gnome.Pass.SearchProvider.desktop b/conf/org.gnome.Pass.SearchProvider.desktop index 9a15878..7da808d 100644 --- a/conf/org.gnome.Pass.SearchProvider.desktop +++ b/conf/org.gnome.Pass.SearchProvider.desktop @@ -1,7 +1,7 @@ [Desktop Entry] Version=1.0 Categories=GNOME;Security; -Icon=password-manager +Icon=dialog-password Name=Pass Comment=GNOME Shell search provider for pass Terminal=false diff --git a/install.sh b/install.sh index 95005f3..aba8b6b 100755 --- a/install.sh +++ b/install.sh @@ -2,22 +2,20 @@ set -eu -o pipefail cd "$(dirname "$(realpath "${0}")")" -DATADIR=${DATADIR:-/usr/share} -LIBDIR=${LIBDIR:-/usr/lib} -LIBEXECDIR=${LIBEXECDIR:-/usr/lib/} -SYSCONFDIR=${SYSCONFDIR:-/etc} -PIPARGS=${PIPARGS:-} # use --user for local install +DATADIR=/usr/share +LIBDIR=/usr/lib -pip install ${PIPARGS} fuzzywuzzy - -install -Dm 0755 gnome-pass-search-provider.py "${LIBEXECDIR}"/gnome-pass-search-provider/gnome-pass-search-provider.py +# The actual executable +install -Dm 0755 gnome-pass-search-provider.py "${LIBDIR}"/gnome-pass-search-provider/gnome-pass-search-provider.py # Search provider definition install -Dm 0644 conf/org.gnome.Pass.SearchProvider.ini "${DATADIR}"/gnome-shell/search-providers/org.gnome.Pass.SearchProvider.ini -# Desktop file +# Desktop file (for having an icon) install -Dm 0644 conf/org.gnome.Pass.SearchProvider.desktop "${DATADIR}"/applications/org.gnome.Pass.SearchProvider.desktop -# DBus configuration +# DBus configuration (no-systemd) install -Dm 0644 conf/org.gnome.Pass.SearchProvider.service.dbus "${DATADIR}"/dbus-1/services/org.gnome.Pass.SearchProvider.service + +# DBus configuration (systemd) install -Dm 0644 conf/org.gnome.Pass.SearchProvider.service.systemd "${LIBDIR}"/systemd/user/org.gnome.Pass.SearchProvider.service