From fd6e551ebeede69f7fd06865456e89e057c39ead Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marta=20Marczykowska-G=C3=B3recka?= Date: Sat, 11 Jan 2020 23:18:46 +0100 Subject: [PATCH] Added "QubesIncoming" shortcut to Nautilus A small script will add the QubesIncoming shortcut to Nautilus file pane on the first use of qvm-copy to a given VM. The shortcut will not be recreated if deleted. fixes QubesOS/qubes-issues#2229 --- debian/qubes-core-agent-nautilus.install | 1 + qubes-rpc/nautilus/Makefile | 2 ++ qubes-rpc/nautilus/qvm_nautilus_bookmark.sh | 6 ++++++ qubes-rpc/qubes.Filecopy | 4 ++++ rpm_spec/core-agent.spec.in | 1 + 5 files changed, 14 insertions(+) create mode 100644 qubes-rpc/nautilus/qvm_nautilus_bookmark.sh diff --git a/debian/qubes-core-agent-nautilus.install b/debian/qubes-core-agent-nautilus.install index ab511bc..fe34305 100644 --- a/debian/qubes-core-agent-nautilus.install +++ b/debian/qubes-core-agent-nautilus.install @@ -1 +1,2 @@ usr/share/nautilus-python/extensions/* +usr/lib/qubes/qvm_nautilus_bookmark.sh diff --git a/qubes-rpc/nautilus/Makefile b/qubes-rpc/nautilus/Makefile index bb0a40f..33071be 100644 --- a/qubes-rpc/nautilus/Makefile +++ b/qubes-rpc/nautilus/Makefile @@ -1,7 +1,9 @@ NAUTILUSPYEXTDIR ?= /usr/share/nautilus-python/extensions +QUBESLIBDIR ?= /usr/lib/qubes .PHONY: install install: install -d $(DESTDIR)$(NAUTILUSPYEXTDIR) install -t $(DESTDIR)$(NAUTILUSPYEXTDIR) -m 0644 *.py + install -t $(DESTDIR)$(QUBESLIBDIR) -m 0755 *.sh diff --git a/qubes-rpc/nautilus/qvm_nautilus_bookmark.sh b/qubes-rpc/nautilus/qvm_nautilus_bookmark.sh new file mode 100644 index 0000000..19b12d4 --- /dev/null +++ b/qubes-rpc/nautilus/qvm_nautilus_bookmark.sh @@ -0,0 +1,6 @@ +#!/bin/sh +if [ ! -e ~/.config/gtk-3.0/qubes-incoming-bookmark-created ] +then + echo "file:///home/user/QubesIncoming" >> ~/.config/gtk-3.0/bookmarks + touch ~/.config/gtk-3.0/qubes-incoming-bookmark-created +fi diff --git a/qubes-rpc/qubes.Filecopy b/qubes-rpc/qubes.Filecopy index 9b497f5..7c9ec43 100755 --- a/qubes-rpc/qubes.Filecopy +++ b/qubes-rpc/qubes.Filecopy @@ -1,2 +1,6 @@ #!/bin/sh +if [ -f /usr/lib/qubes/qvm_nautilus_bookmark.sh ] +then + /usr/lib/qubes/qvm_nautilus_bookmark.sh >/dev/null 2>&1