3

Step 1: I wanted to add a menu as "Compress as ZIP" on right-click. I know I can use a change default compress format as "ZIP" using gconf-editor. But I wanted to add a new Menu Item for Compressing as ZIP without opening any other option dialog.

Step 2: I wanted to Compress a file as ZIP and Rename it as an "epub".

Please let me know is it possible to zip&rename by adding a single menu item? I'm using Ubuntu 11.04 and Installed "Nautilus-Action-Configurations", but unsuccessful.

N.B. I have read this Ask Ubuntu Q&A; I don't want to open a new window to choose me the format. It should be straight away saved as a ZIP.

1 Answers1

2

You can add custom menu entries with the package nautilus-actions, see this Q&A for a similar problem (there are nice screenshots too... :) ).

I couldn't manage to tell nautilus-actuions from which directory to run the path or to run two commands (i.e. cd to the correct directory first). Therefore 2 workarounds:

Full paths

In nautilus-actions: As command enter zip with the options %d/%f.epub %M.

This will include the whole path in the ZIP file. This is probably not suiteable for *.epub files. You can add the -j flag to include only files (no directories at all).

Script

Place this script at /usr/local/bin:

#!/bin/bash

cd $1
zip $2.epub $3

And use your-script-name as command and this options: "%d" "%f.epub" "%m"

I didn't test it, please report bugs (especially with spaces in the path or file names!) or edit this answer to confirm that it works!

lumbric
  • 3,994