From b18d40fb0894630b6649812d195ed4914e00a91a Mon Sep 17 00:00:00 2001 From: Marek Marczykowski Date: Thu, 21 Feb 2013 16:44:16 +0100 Subject: [PATCH] vm: Use nautilus-actions to provide "Copy to other AppVM" etc nautilus commands No more ugly symlink creation at VM startup, nautilus-actions have system-wide dir (in opposite to nautilus-scripts). Currently old symlinks are not cleaned up. Maybe it should, but leaving them have one advantage: will not break existing users behavior. --- misc/nautilus-actions.conf | 7 +++++++ qubes_rpc/qvm-copy-gnome.desktop | 9 +++++++++ qubes_rpc/qvm-dvm-gnome.desktop | 9 +++++++++ rpm_spec/core-vm.spec | 15 +++++++++------ vm-init.d/qubes_core | 16 ---------------- vm-systemd/misc-post.sh | 15 --------------- 6 files changed, 34 insertions(+), 37 deletions(-) create mode 100644 misc/nautilus-actions.conf create mode 100644 qubes_rpc/qvm-copy-gnome.desktop create mode 100644 qubes_rpc/qvm-dvm-gnome.desktop diff --git a/misc/nautilus-actions.conf b/misc/nautilus-actions.conf new file mode 100644 index 0000000..46f5021 --- /dev/null +++ b/misc/nautilus-actions.conf @@ -0,0 +1,7 @@ +[runtime] +items-create-root-menu=false +items-add-about-item=false + +[io-provider na-desktop] +readable=true +writable=true diff --git a/qubes_rpc/qvm-copy-gnome.desktop b/qubes_rpc/qvm-copy-gnome.desktop new file mode 100644 index 0000000..bb28125 --- /dev/null +++ b/qubes_rpc/qvm-copy-gnome.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Type=Action +ToolbarLabel[C]=Copy to other AppVM +Name[C]=Copy to other AppVM +Profiles=profile-zero; + +[X-Action-Profile profile-zero] +Exec=/usr/lib/qubes/qvm-copy-to-vm.gnome %F +Name[C]=Default profile diff --git a/qubes_rpc/qvm-dvm-gnome.desktop b/qubes_rpc/qvm-dvm-gnome.desktop new file mode 100644 index 0000000..28664a4 --- /dev/null +++ b/qubes_rpc/qvm-dvm-gnome.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Type=Action +ToolbarLabel[C]=Open in DisposableVM +Name[C]=Open in DisposableVM +Profiles=profile-zero; + +[X-Action-Profile profile-zero] +Exec=/usr/bin/qvm-open-in-dvm %f +Name[C]=Default profile diff --git a/rpm_spec/core-vm.spec b/rpm_spec/core-vm.spec index 43b5ed4..efa1876 100644 --- a/rpm_spec/core-vm.spec +++ b/rpm_spec/core-vm.spec @@ -45,6 +45,7 @@ Requires: ethtool Requires: tinyproxy Requires: ntpdate Requires: net-tools +Requires: nautilus-actions Requires: qubes-core-vm-kernel-placeholder Requires: qubes-core-libs Provides: qubes-core-vm @@ -89,12 +90,6 @@ mv /etc/fstab /var/lib/qubes/fstab.orig fi adduser --create-home user -su user -c 'mkdir -p /home/user/.local/share' -su user -c 'mkdir -p /home/user/.gnome2/nautilus-scripts' -su user -c 'ln -s /usr/lib/qubes/qvm-copy-to-vm.gnome /home/user/.gnome2/nautilus-scripts/"Copy to other AppVM"' -su user -c 'ln -s /usr/bin/qvm-open-in-dvm /home/user/.gnome2/nautilus-scripts/"Open in DisposableVM"' -su user -c 'touch /home/user/.gnome2/nautilus-scripts/.scripts_created' -su user -c 'touch /home/user/.gnome2/nautilus-scripts/.scripts_created2' %install @@ -190,6 +185,11 @@ install -m 0644 qubes_rpc/{qubes.Filecopy,qubes.OpenInVM,qubes.VMShell,qubes.Syn install -m 0644 qubes_rpc/{qubes.SuspendPre,qubes.SuspendPost,qubes.GetAppmenus} $RPM_BUILD_ROOT/etc/qubes_rpc install -m 0644 qubes_rpc/qubes.WaitForSession $RPM_BUILD_ROOT/etc/qubes_rpc +install -d $RPM_BUILD_ROOT/usr/share/file-manager/actions +install -m 0644 qubes_rpc/*-gnome.desktop $RPM_BUILD_ROOT/usr/share/file-manager/actions + +install -D misc/nautilus-actions.conf $RPM_BUILD_ROOT/etc/xdg/nautilus-actions/nautilus-actions.conf + install qrexec/qrexec_agent $RPM_BUILD_ROOT/usr/lib/qubes install qrexec/qrexec_client_vm $RPM_BUILD_ROOT/usr/lib/qubes install qrexec/qubes_rpc_multiplexer $RPM_BUILD_ROOT/usr/lib/qubes @@ -412,6 +412,7 @@ rm -f %{name}-%{version} /etc/udev/rules.d/99-qubes_block.rules /etc/udev/rules.d/99-qubes_network.rules /etc/udev/rules.d/99-qubes_usb.rules +/etc/xdg/nautilus-actions/nautilus-actions.conf /etc/xen/scripts/vif-route-qubes %config(noreplace) /etc/yum.conf.d/qubes-proxy.conf %config(noreplace) /etc/yum.repos.d/qubes.repo @@ -457,6 +458,8 @@ rm -f %{name}-%{version} /usr/sbin/qubes_firewall /usr/sbin/qubes_netwatcher /usr/share/glib-2.0/schemas/org.gnome.settings-daemon.plugins.updates.gschema.override +/usr/share/file-manager/actions/qvm-copy-gnome.desktop +/usr/share/file-manager/actions/qvm-dvm-gnome.desktop %dir /home_volatile %attr(700,user,user) /home_volatile/user %dir /mnt/removable diff --git a/vm-init.d/qubes_core b/vm-init.d/qubes_core index 0707bb1..d5760fc 100755 --- a/vm-init.d/qubes_core +++ b/vm-init.d/qubes_core @@ -83,22 +83,6 @@ start() [ -x /rw/config/rc.local ] && /rw/config/rc.local - if ! [ -f /home/user/.gnome2/nautilus-scripts/.scripts_created ] ; then - echo "Creating symlinks for nautilus actions..." - su user -c 'mkdir -p /home/user/.gnome2/nautilus-scripts' - su user -c 'ln -s /usr/lib/qubes/qvm-copy-to-vm.gnome /home/user/.gnome2/nautilus-scripts/"Copy to other AppVM"' - su user -c 'ln -s /usr/bin/qvm-open-in-dvm /home/user/.gnome2/nautilus-scripts/"Open in DisposableVM"' - su user -c 'touch /home/user/.gnome2/nautilus-scripts/.scripts_created' - fi - - if ! [ -f /home/user/.gnome2/nautilus-scripts/.scripts_created2 ] ; then - # as we have recently renamed tools, the symlinks would need to be fixed for older templates - su user -c 'ln -sf /usr/lib/qubes/qvm-copy-to-vm.gnome /home/user/.gnome2/nautilus-scripts/"Copy to other AppVM"' - su user -c 'ln -sf /usr/bin/qvm-open-in-dvm /home/user/.gnome2/nautilus-scripts/"Open in DisposableVM"' - su user -c 'touch /home/user/.gnome2/nautilus-scripts/.scripts_created2' - fi - - success echo "" diff --git a/vm-systemd/misc-post.sh b/vm-systemd/misc-post.sh index cbd0c63..f1a8f9e 100755 --- a/vm-systemd/misc-post.sh +++ b/vm-systemd/misc-post.sh @@ -45,21 +45,6 @@ fi [ -x /rw/config/rc.local ] && /rw/config/rc.local -if ! [ -f /home/user/.gnome2/nautilus-scripts/.scripts_created ] ; then - echo "Creating symlinks for nautilus actions..." - su user -c 'mkdir -p /home/user/.gnome2/nautilus-scripts' - su user -c 'ln -s /usr/lib/qubes/qvm-copy-to-vm.gnome /home/user/.gnome2/nautilus-scripts/"Copy to other AppVM"' - su user -c 'ln -s /usr/bin/qvm-open-in-dvm /home/user/.gnome2/nautilus-scripts/"Open in DisposableVM"' - su user -c 'touch /home/user/.gnome2/nautilus-scripts/.scripts_created' -fi - -if ! [ -f /home/user/.gnome2/nautilus-scripts/.scripts_created2 ] ; then - # as we have recently renamed tools, the symlinks would need to be fixed for older templates - su user -c 'ln -sf /usr/lib/qubes/qvm-copy-to-vm.gnome /home/user/.gnome2/nautilus-scripts/"Copy to other AppVM"' - su user -c 'ln -sf /usr/bin/qvm-open-in-dvm /home/user/.gnome2/nautilus-scripts/"Open in DisposableVM"' - su user -c 'touch /home/user/.gnome2/nautilus-scripts/.scripts_created2' -fi - # Start services which haven't own proper systemd unit: # Start AppVM specific services