From e73977f1b22d4866f1e007ea675974cf0be4c1be Mon Sep 17 00:00:00 2001 From: Jonathan Lestrelin Date: Tue, 14 Mar 2017 21:47:52 +0100 Subject: [PATCH] * rename various elements to be more consistent with other search providers * remove useless dbus config file * add TODO * minor changes --- README.md | 13 +++++++------ TODO.md | 7 +++++++ ...esktop => org.gnome.Pass.SearchProvider.desktop} | 2 +- conf/org.gnome.Pass.SearchProvider.ini | 5 +++++ conf/org.gnome.Pass.SearchProvider.service.dbus | 4 ++++ conf/org.gnome.Pass.SearchProvider.service.systemd | 7 +++++++ conf/org.gnome.pass.search.conf | 10 ---------- conf/org.gnome.pass.search.ini | 5 ----- conf/org.gnome.pass.search.service.dbus | 4 ---- conf/org.gnome.pass.search.service.systemd | 7 ------- daemon.py => gnome-pass-search-provider.py | 8 ++++---- install.sh | 11 +++++------ 12 files changed, 40 insertions(+), 43 deletions(-) create mode 100644 TODO.md rename conf/{org.gnome.pass.search.desktop => org.gnome.Pass.SearchProvider.desktop} (75%) create mode 100644 conf/org.gnome.Pass.SearchProvider.ini create mode 100644 conf/org.gnome.Pass.SearchProvider.service.dbus create mode 100644 conf/org.gnome.Pass.SearchProvider.service.systemd delete mode 100644 conf/org.gnome.pass.search.conf delete mode 100644 conf/org.gnome.pass.search.ini delete mode 100644 conf/org.gnome.pass.search.service.dbus delete mode 100644 conf/org.gnome.pass.search.service.systemd rename daemon.py => gnome-pass-search-provider.py (93%) diff --git a/README.md b/README.md index 7438a3d..f8aec5d 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -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 [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. +Names of passwords will show up in GNOME Shell searches, choosing one will copy the corresponding content to the clipboard. ![Sreencapture](misc/screencapture.gif) @@ -31,8 +31,8 @@ If you need to you can change the installation paths to suit your system: sudo SYSCONFDIR=/etc DATADIR=/usr/share LIBDIR=/usr/lib LIBEXECDIR=/usr/lib ./install.sh ``` -The search provider should show up and be enabled in Gnome search preferences and be autoloaded by Gnome-Shell. -If that's not the case try closing and reopening your Gnome session. +Close and reopen your GNOME session or (if not on Wayland) just restart the Shell (alt + f2, r). +The search provider should show up and be enabled in Gnome search preferences and be autoloaded by GNOME Shell. # Environment variables @@ -40,7 +40,7 @@ If you are configuring pass through environment variables, such as `PASSWORD_STO If you are on a systemd-based system, you can set them in the unit file : ```shell -systemctl --user edit org.gnome.pass.search.service +systemctl --user edit org.gnome.Pass.SearchProvider.service ``` Add your variables like this : @@ -51,7 +51,7 @@ Environment=PASSWORD_STORE_DIR=/my/passwords/path Then restart the service : ```shell -systemctl --user restart org.gnome.pass.search.service +systemctl --user restart org.gnome.Pass.SearchProvider.service ``` # Compatibility @@ -63,3 +63,4 @@ This works fine on Gnome 3.22 and I expect it will continue to work for some tim # 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). + diff --git a/TODO.md b/TODO.md new file mode 100644 index 0000000..3556a79 --- /dev/null +++ b/TODO.md @@ -0,0 +1,7 @@ +* Add a configuration dialog so that passing environment variables to pass is easier. +* Fix the problem of pinentry unable to show up if not called from pass before. +* Make packages. +* Find a good way of implementing LaunchSearch. +* Make the daemon exit after some time. +* Call into GPaste if present to mark item as password. + diff --git a/conf/org.gnome.pass.search.desktop b/conf/org.gnome.Pass.SearchProvider.desktop similarity index 75% rename from conf/org.gnome.pass.search.desktop rename to conf/org.gnome.Pass.SearchProvider.desktop index 6d0e5f9..8a5bd0d 100644 --- a/conf/org.gnome.pass.search.desktop +++ b/conf/org.gnome.Pass.SearchProvider.desktop @@ -3,7 +3,7 @@ Version=1.0 Categories=GNOME;Security; Icon=password-manager Name=Pass -Comment=Gnome-shell search provider for pass +Comment=GNOME Shell search provider for pass Terminal=false Type=Application OnlyShowIn=GNOME; diff --git a/conf/org.gnome.Pass.SearchProvider.ini b/conf/org.gnome.Pass.SearchProvider.ini new file mode 100644 index 0000000..d919bae --- /dev/null +++ b/conf/org.gnome.Pass.SearchProvider.ini @@ -0,0 +1,5 @@ +[Shell Search Provider] +DesktopId=org.gnome.Pass.SearchProvider.desktop +BusName=org.gnome.Pass.SearchProvider +ObjectPath=/org/gnome/Pass/SearchProvider +Version=2 diff --git a/conf/org.gnome.Pass.SearchProvider.service.dbus b/conf/org.gnome.Pass.SearchProvider.service.dbus new file mode 100644 index 0000000..de1809c --- /dev/null +++ b/conf/org.gnome.Pass.SearchProvider.service.dbus @@ -0,0 +1,4 @@ +[D-BUS Service] +Name=org.gnome.Pass.SearchProvider +Exec=/usr/lib/gnome-pass-search-provider/gnome-pass-search-provider.py +SystemdService=org.gnome.Pass.SearchProvider.service diff --git a/conf/org.gnome.Pass.SearchProvider.service.systemd b/conf/org.gnome.Pass.SearchProvider.service.systemd new file mode 100644 index 0000000..ee78888 --- /dev/null +++ b/conf/org.gnome.Pass.SearchProvider.service.systemd @@ -0,0 +1,7 @@ +[Unit] +Description=Pass search provider for GNOME Shell daemon + +[Service] +Type=dbus +BusName=org.gnome.Pass.SearchProvider +ExecStart=/usr/lib/gnome-pass-search-provider/gnome-pass-search-provider.py diff --git a/conf/org.gnome.pass.search.conf b/conf/org.gnome.pass.search.conf deleted file mode 100644 index 93bc66a..0000000 --- a/conf/org.gnome.pass.search.conf +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - diff --git a/conf/org.gnome.pass.search.ini b/conf/org.gnome.pass.search.ini deleted file mode 100644 index d8de51e..0000000 --- a/conf/org.gnome.pass.search.ini +++ /dev/null @@ -1,5 +0,0 @@ -[Shell Search Provider] -DesktopId=org.gnome.pass.search.desktop -BusName=org.gnome.pass.search -ObjectPath=/org/gnome/pass/search -Version=2 diff --git a/conf/org.gnome.pass.search.service.dbus b/conf/org.gnome.pass.search.service.dbus deleted file mode 100644 index afe54dc..0000000 --- a/conf/org.gnome.pass.search.service.dbus +++ /dev/null @@ -1,4 +0,0 @@ -[D-BUS Service] -Name=org.gnome.pass.search -Exec=/usr/lib/gnome-shell-search-pass/daemon.py -SystemdService=org.gnome.pass.search.service diff --git a/conf/org.gnome.pass.search.service.systemd b/conf/org.gnome.pass.search.service.systemd deleted file mode 100644 index a6eeb06..0000000 --- a/conf/org.gnome.pass.search.service.systemd +++ /dev/null @@ -1,7 +0,0 @@ -[Unit] -Description=Pass search provider for gnome-shell daemon - -[Service] -Type=dbus -BusName=org.gnome.pass.search -ExecStart=/usr/lib/gnome-shell-search-pass/daemon.py diff --git a/daemon.py b/gnome-pass-search-provider.py similarity index 93% rename from daemon.py rename to gnome-pass-search-provider.py index 4a50257..da2f638 100755 --- a/daemon.py +++ b/gnome-pass-search-provider.py @@ -1,12 +1,12 @@ #!/usr/bin/env python3 -# This file is a part of gnome-shell-search-pass. +# This file is a part of gnome-pass-search-provider. # -# gnome-shell-search-pass is free software: you can redistribute it and/or modify +# gnome-pass-search-provider is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # -# gnome-shell-search-passs is distributed in the hope that it will be useful, +# gnome-pass-search-providers is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. @@ -49,7 +49,7 @@ class SearchPassService(dbus.service.Object): :meth:`Enable` method, and stopped with :meth:`Disable`. """ - bus_name = 'org.gnome.pass.search' + bus_name = 'org.gnome.Pass.SearchProvider' enabled = False _search_cache = {} diff --git a/install.sh b/install.sh index bfcd914..122f182 100755 --- a/install.sh +++ b/install.sh @@ -7,15 +7,14 @@ LIBDIR=${LIBDIR:-/usr/lib} LIBEXECDIR=${LIBEXECDIR:-/usr/lib/} SYSCONFDIR=${SYSCONFDIR:-/etc} -install -Dm 0755 daemon.py "${LIBEXECDIR}"/gnome-shell-search-pass/daemon.py +install -Dm 0755 gnome-pass-search-provider.py "${LIBEXECDIR}"/gnome-pass-search-provider/gnome-pass-search-provider.py # Search provider definition -install -Dm 0644 conf/org.gnome.pass.search.ini "${DATADIR}"/gnome-shell/search-providers/org.gnome.pass.search.ini +install -Dm 0644 conf/org.gnome.Pass.SearchProvider.ini "${DATADIR}"/gnome-shell/search-providers/org.gnome.Pass.SearchProvider.ini # Desktop file -install -Dm 0644 conf/org.gnome.pass.search.desktop "${DATADIR}"/applications/org.gnome.pass.search.desktop +install -Dm 0644 conf/org.gnome.Pass.SearchProvider.desktop "${DATADIR}"/applications/org.gnome.Pass.SearchProvider.desktop # DBus configuration -install -Dm 0644 conf/org.gnome.pass.search.service.dbus "${DATADIR}"/dbus-1/services/org.gnome.pass.search.service -install -Dm 0644 conf/org.gnome.pass.search.conf "${SYSCONFDIR}"/dbus-1/system.d/org.gnome.pass.search.conf -install -Dm 0644 conf/org.gnome.pass.search.service.systemd "${LIBDIR}"/systemd/user/org.gnome.pass.search.service +install -Dm 0644 conf/org.gnome.Pass.SearchProvider.service.dbus "${DATADIR}"/dbus-1/services/org.gnome.Pass.SearchProvider.service +install -Dm 0644 conf/org.gnome.Pass.SearchProvider.service.systemd "${LIBDIR}"/systemd/user/org.gnome.Pass.SearchProvider.service