Extract archive

Dolphin Service Menus

Source (link to git-repo or to original if based on someone elses unmodified work): Add the source-code for this project on opencode.net

0
5 .0
Description:

Extract any archive file that ark is capable to read + ACE files.


You can chose to extract here, or in a subdirectory. In that case, it asks you the name of the subdirectory where you want to extract, and suggests you the archive name by default.

To install, simply extract, and move the 2 files in ~/.kde/share/apps/konqueror/servicemenus

It's highly recommended to download the latest version of unace on www.winace.com and to run this command line in the unace directory location :
sudo mv unace /usr/bin/unace
More informations : https://help.ubuntu.com/community/FileCompression#head-033d70db4563be031697f1dc5bfef07586805826

It looks like ark kde integration, but works for all archive file types, including ace. And it's easier to change the subdirectory name.

If you want translation to be added, post me comments.

Enjoy !
Last changelog:

13 years ago

1.11 RELEASE
======================================

001 ==> thanks to shirka, extract archive path is now "test" for an "test.tar.bz2" file
002 ==> Name that appears in the menu is now "Extract archive" as suggested by dovidhalevi to differentiate with ark

boralyl

13 years ago

Thanks, I didn't like how Dolphin had an extract to menu for tar.gz, but not tar, which is what most of my archives are. Changed the konqueror directory to dolphin and it works splendid.

Report

nitio

13 years ago

I always enjoyed the option to extract to a subdirectory. Makes it easier to avoid compressed files that don't have subdirectories. (Sorry about the patch for the .desktop - it seems more like the whole file ;)

Quote:--- extract_archive.sh 2007-05-14 15:42:04.000000000 -0300
+++ extract_archive-new.sh 2007-08-27 22:34:18.000000000 -0300
@@ -23,6 +23,9 @@
if [ $option = "-here" ];
then
dir_to_extract=$directory;
+elif [ $option = "-subdir" ];
+then
+ dir_to_extract="$directory/${nameext%.*}"
else
dir_to_extract="$directory/`kdialog --title "Extract to..." --inputbox "In wich sub directory you want to extract ?" "${nameext%.*}"`";
fi


Quote:--- extract_archive.desktop 2007-05-14 15:42:35.000000000 -0300
+++ extract_archive-new.desktop 2007-08-27 22:34:27.000000000 -0300
@@ -2,7 +2,7 @@
Encoding=UTF-8
Version=1.11
ServiceTypes=application/x-gzip,application/x-lha,application/x-tar,application/x-tgz,application/x-tbz,application/x-zip,application/x-bzip,application/x-tzo,application/x-lzop,application/x-rar,application/x-zoo,application/x-tarz,application/x-archive,application/x-bzip2,application/x-jar,application/x-deb,application/x-rar-compressed,application/x-ace
-Actions=extract_archive_to;extract_archive_here
+Actions=extract_archive_to;extract_archive_sub;extract_archive_here
X-KDE-Priority=TopLevel
X-KDE-Submenu=Extract archive
X-KDE-Submenu[fr]=Extraire l'archive
@@ -16,6 +16,11 @@
Exec=~/.kde/share/apps/konqueror/servicemenus/extract_archive.sh "%n" "%u" "%d"
Icon=ark

+[Desktop Action extract_archive_sub]
+Name=Extract to subdirectory
+Exec=~/.kde/share/apps/konqueror/servicemenus/extract_archive.sh "%n" "%u" "%d" -subdir
+Icon=ark
+
[Desktop Action extract_archive_here]
Name=Extract here
Name[fr]=Extraire ici

Report

dovidhalevi

13 years ago

I copied the two files to the main $KDEDIR/share/apps .....
I have no such items in my
~/.kde/share/apps....

However, the thing is looking to the .kde subdirectory for the script.

So I guess this is a bug :-)

Report

C

Topazz

13 years ago

Sorry, I realy don't understand what you meen.
Could you send me a screenshot on my mail ?
Thanks in advance

Report

dovidhalevi

13 years ago

I do not have a handy screengrabber. However, the error messages was that it could not find ~/.kde/share .... extract_archive.sh

I did not place either file there. Both are on my /opt/kdedir/share ....

Report

dovidhalevi

13 years ago

One with submenus:
extract to ...
extract here
no icon

One with submenus
extract to ...
extract to <filenamed directory>
extract here
with icon.

Only one copy of the shell and desktop file in the $KDEDIR/share/apps/konqueror/servicemenus

No extra copy in the ~/.kde ...

Report

C

Topazz

13 years ago

The other submenu is the ark one.
I've changed the name to "Extract archive" to differentiate.
Read the description to see what's different from the ark menu.
If you want to desactivate ark menu, open ark, go into configuration -> General and desactivate the konqueror integration.
But it can be useful to keep it if you want to compress using ark in konqueror.

Report

dovidhalevi

13 years ago

But they call theirs "extract archive"

I installed the latest. Did not seem to change anything.

Report

C

Topazz

13 years ago

I have changed the screenshot to show you wich submenu concern this service menu.
You should have only one "extract archive" submenu.
You can send me your screenshot so that I can understand better your problem :
mfaya (at) free (dot) fr

Report

dovidhalevi

13 years ago

This one in your screenshot has the two alternatives. The second one "extract" has three. I thought this was in fact yours (because of the patch for the filename.tar....

Report

shirka

13 years ago

Hi,

This patch for extract archive to path like this:
"test.tar.bz2" to "test" dir
Without this patch:
"test.tar.bz2" to "test.tar" dir

Bye.

--- extract_archive-old.sh 2007-05-13 19:07:04.000000000 -0300
+++ extract_archive-new.sh 2007-05-14 08:23:00.000000000 -0300
@@ -11,6 +11,14 @@
ext=${nameext##*.}
ext=`echo $ext | tr -s A-Z a-z` # in case extension is .ACE

+nameext2=${nameext%.*}
+ext2=${nameext2##*.}
+ext2=`echo $ext2 | tr -s A-Z a-z`
+if [ $ext2 = "tar" ]
+then
+ nameext=$nameext2
+fi
+
if [ $option = "-here" ];
then
dir_to_extract=$directory;

Report

C

Topazz

13 years ago

Thanks very much. Works perfectly. It's now included in the script v1.11

Report

13 years ago

1.11 RELEASE
======================================

001 ==> thanks to shirka, extract archive path is now "test" for an "test.tar.bz2" file
002 ==> Name that appears in the menu is now "Extract archive" as suggested by dovidhalevi to differentiate with ark

12345678910
Be the first to comment
File (click to download) Version Description Downloads Date Filesize DL OCS-Install MD5SUM
*Needs pling-store or ocs-url to install things
Pling
0 Affiliates
Details
license
version
1.11
updated May 15 2007
added May 13 2007
downloads 24h
1
mediaviews 24h 0
pageviews 24h 1
System Tags addon