20

recently I installed nemo as default filemanager replacing the nautilus. So far it work perfectly except the fact that I missed the "right click extract/compress". I've installed nemo 2.2.2 and nemo-fileroller through apt-get command on Ubuntu 14.04.

How can I have the right click menu for to "extract/compress"?

NinoDenero
  • 301
  • 1
  • 2
  • 4
  • Is it possible to indicate exceptions in extensions and mimetypes? So, in other file managers, in a compressed file you don't see the contextual menu: "compress". – rainerhg7 Feb 28 '19 at 09:34

4 Answers4

34

Very simply, all you should need to do is install the nemo-fileroller package:

sudo apt-get install nemo-fileroller

To apply the changes quit the file-manager with

nemo -q

to then (re-)start it like you normally would.

David Foerster
  • 35,754
  • 55
  • 92
  • 145
Wilf
  • 29,694
  • 16
  • 106
  • 164
18

Okay, I've tried lots of "solutions" but none of them work, so I went and dug out how things work, and here's how I did it on Ubuntu 14.04 and Nemo 2.2.2...

  1. Open up terminal and type cd ~/.local/share/nemo/actions/
  2. Create a new file/action for Compress by typing nano compress.nemo_action
  3. Paste this contents into newly created file

    [Nemo Action]
    Active=true
    Name=Compress...
    Comment=compress %N
    Exec=file-roller -d %F
    Icon-Name=gnome-mime-application-x-compress
    Selection=Any
    Extensions=any;
    
  4. Save the file and exit (CTRL+X, and just Enter)

  5. Create a new file/action for "Extract here" by typing nano extracthere.nemo_action
  6. Paste this contents into newly created file

    [Nemo Action]
    Active=true
    Name=Extract here
    Comment=Extract here
    Exec=file-roller -h %F
    Icon-Name=gnome-mime-application-x-compress
     #Stock-Id=gtk-cdrom
    Selection=Any
    Extensions=zip;7z;ar;cbz;cpio;exe;iso;jar;tar;tar;7z;tar.Z;tar.bz2;tar.gz;tar.lz;tar.lzma;tar.xz;
    
  7. Save the file and exit (CTRL+X, and just Enter)

  8. You're done. If you still don't have Compress/Extract here options in Nemo, just restart or log out/in.

Creating Nemo actions is the only way I've achieved this, I've tried several repos and tutorial of which none worked.

DJCrashdummy
  • 1,881
  • 3
  • 24
  • 34
dBlaze
  • 331
  • 2
  • 9
  • Thanks a lot, it worked. Just a note: since I wanted to apply the changes system.-wide, I put the new action files in /usr/local/share/nemo/actions instead of .local/... – PJ_Finnegan Dec 02 '16 at 11:52
  • In case someone else stumbles here that does not use Ubuntu, it worked also on rhel7 with Nemo 2.8.7 – bartgol Dec 14 '16 at 15:10
  • EDIT: to apply the changes system.-wide, I put the new action files in /usr/share/nemo/actions instead of .local/.. – PJ_Finnegan Jan 19 '17 at 11:40
7

To improve the Compress/Extract integration, I'm posting an Escape-Safe way (because folders with spaces in the name was crashing my file-roller):

Create the following .nemo_action files and their contents, at /usr/share/nemo/actions:

compress.nemo_action:

[Nemo Action]
Active=true
Name=Compress...
Comment=Compress "%f"
Exec=file-roller --add %F --default-dir=%P
Icon-Name=gnome-mime-application-x-compress
Selection=notnone
Extensions=any;
Quote=double

extract-here.nemo_action:

[Nemo Action]
Active=true
Name=Extract here
Comment=Extract "%f" here
Exec=file-roller --extract-here %F
Icon-Name=gnome-mime-application-x-compress
Selection=notnone
Extensions=zip;7z;ar;cbz;cpio;exe;iso;jar;tar;tar.Z;tar.bz2;tar.gz;tar.lz;tar.lzma;tar.xz;
Quote=double

extract-to.nemo_action:

[Nemo Action]
Active=true
Name=Extract to...
Comment=Extract to a folder of your choice.
Exec=file-roller --extract %F
Icon-Name=gnome-mime-application-x-compress
Selection=notnone
Extensions=zip;7z;ar;cbz;cpio;exe;iso;jar;tar;tar.Z;tar.bz2;tar.gz;tar.lz;tar.lzma;tar.xz;
Quote=double
Maxwel Leite
  • 2,334
  • 3
  • 20
  • 28
Matt Mello
  • 403
  • 1
  • 5
  • 13
  • 1
    If I put EscapeSpaces=true and Quote=double at the same time it won't work, Quote=double is enough to escape the spaces. – PJ_Finnegan Jan 19 '17 at 11:46
5

I believe the above nemo actions is missing the "Quote=double" parameter otherwise files/directories that have space(s) in their name won't work. e.g.

[Nemo Action]
Active=true
Name=Compress...
Comment=compress %N
Exec=file-roller -d %F
Icon-Name=gnome-mime-application-x-compress
Selection=any
Extensions=any;
Quote=double

Also useful is an "Extract to..." action, which allows you to select a different path where you may want to extract the files to.

e.g.
extractto.nemo_action

[Nemo Action]
Active=true
Name=Extract to...
Comment=Extract to...
Exec=file-roller -f %F
Icon-Name=gnome-mime-application-x-compress
#Stock-Id=gtk-cdrom
Selection=any
Extensions=zip;7z;ar;cbz;cpio;exe;iso;jar;tar;tar;7z;tar.Z;tar.bz2;tar.gz;tar.lz;tar.lzma;tar.xz;
Quote=double
mpham
  • 51
  • 1
  • 1