0

Ever since I installed p7zip-gui, it hijacked my system by setting itself as default application for all mime types it can open (31 types in total).

Cinnamon provides a tool called Preferred Applications, but there's no "compressed/archives" grouping:

enter image description here

How to revert to having File Roller open all supported types by default, while still keeping the possibility to open them with p7zip-gui?

1

You can edit mime type associations using the xdg-mime command.

All you need to do is find out the name of the .desktop file for File Roller, then enter the command xdg-mime default program.desktop compressed/archives, replacing program.desktop with the name of the actual file, of course. This also works with wildcards, so if you wanted to set it to open, say, all compressed files, you could specify compressed/*.

  • [edited into an answer] feel free to incorporate my answer in yours if you want me to accept it, and let me know if you do. Thanks. – Marc.2377 Sep 12 '17 at 4:15
1

This is a complement to the previous answer by theJack.

In order to accomplish my goal, I had to:

  1. open the file /usr/share/applications/Archive Manager (actually named /usr/share/applications/org.gnome.FileRoller.desktop if listed from the command line, for example) in a text editor

  2. copy everything directly after MimeType=

  3. replace every semicolon by a space using a text editor with "Search and Replace"

  4. input the resulting string as a parameter to xdg-mime. From the manual: "An application can be made the default for several file types by specifying multiple mimetypes."

The resulting command:

xdg-mime default "org.gnome.FileRoller.desktop" application/x-7z-compressed application/x-7z-compressed-tar application/x-ace application/x-alz application/x-ar application/x-arj application/x-bzip application/x-bzip-compressed-tar application/x-bzip1 application/x-bzip1-compressed-tar application/x-cabinet application/x-cd-image application/x-compress application/x-compressed-tar application/x-cpio application/x-deb application/x-ear application/x-ms-dos-executable application/x-gtar application/x-gzip application/x-gzpostscript application/x-java-archive application/x-lha application/x-lhz application/x-lrzip application/x-lrzip-compressed-tar application/x-lz4 application/x-lzip application/x-lzip-compressed-tar application/x-lzma application/x-lzma-compressed-tar application/x-lzop application/x-lz4-compressed-tar application/x-lzop-compressed-tar application/x-ms-wim application/x-rar application/x-rar-compressed application/x-rpm application/x-source-rpm application/x-rzip application/x-rzip-compressed-tar application/x-tar application/x-tarz application/x-stuffit application/x-war application/x-xz application/x-xz-compressed-tar application/x-zip application/x-zip-compressed application/x-zoo application/zip application/x-archive application/vnd.ms-cab-compressed application/vnd.debian.binary-package application/gzip

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.