This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Ark - Recursively extract archives via servicemenu

Tags: None
(comma "," separated)
User avatar
doktor5000
Registered Member
Posts
28
Karma
0
OS
Hello there,

i have made up a servicemenu to recursively extract archives. It looks like this now:

Code: Select all
[Desktop Entry]
Type=Service
X-KDE-ServiceTypes=KonqPopupMenu/Plugin,inode/directory
Actions=unrar-rekursiv;

[Desktop Action unrar-rekursiv]
Name=Extract rar archives recursively
Name[de]=Rar Dateien rekursiv entpacken
Icon=utilities-file-archiver
Exec=find %u -name '*.rar' -execdir nice -n20 ark --batch '{}' ';'


For now, this is only for my special purpose, to ease extraction of several .RAR archives (as i don't explicitly use unrar any more, it can be used for any archive type that Ark supports) in subdirectories.

As i'm not a shell god, i don't know how to process several found archives one-by-one, currently they are processed in parallel, which is not that good. Can anybody give me a hint how to do this?

Abstracted usage scenario:

Folder/
./1/somefile.rar
./2/someotherfile.rar
./3/evenanotherfile.rar

Right-click on Folder, select "Extract rar archives recursively" and all found files are extracted in parallel, which is unwanted.

BTW: If anyone want's to use this, feel free to do so. For now i don't intend to open enhancement request on BKO, as the usage is very special. What do you think about this?
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
Maybe the following would work?
Code: Select all
arkfilesopen = $(find %u -name '*.rar') ark --batch $arkfilesopen;


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
User avatar
doktor5000
Registered Member
Posts
28
Karma
0
OS
Big up to bcooksley, working great now. ;D
But the question remains: What do you think, is this worth posting as an enhancement request to be integrated into Ark?

EDIT: Seems to work only one time. Next time it tells me that "program "arkfilesopen" can't be found" even when unsetting arkfilesopen before. Any idea?
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
Try this instead, which should be more runtime.

Code: Select all
ark --batch $(find %u -name '*.rar')


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
User avatar
doktor5000
Registered Member
Posts
28
Karma
0
OS
This extracts the files to ~/Documents. Will have to play around with Ark command line options a bit. But Thanks for your help.


Bookmarks



Who is online

Registered users: abc72656, Bing [Bot], daret, Google [Bot], lockheed, Sogou [Bot], Yahoo [Bot]