Source i (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
Become a Fan
5.0

Description:
Unball:
Between new kernels, patches, and source, I found myself doing:
tar jvxf filename.tar.bz2
tar xvzf filename.tar.gz
unzip crappyformat.zip
all the time. So I wrote a script called unball to perform the same operations I was doing over and over... it recognizes bz2s, zips, gzs, tgz, rars, jars, and tars. Put the "unball" script in your path and the kdeunball.desktop script in your servicemenus directory. Its quite handy to type unball from the console instead of nineteen different options...
-maitre

Ratings & Comments

23 Comments

ssokolow

I got tired of unball's inability to deal with filenames containing spaces, that annoying but harmless error it displays, and the limited number of formats it recognized so I decided to improve it. Long story short, I ended up rewriting it from scratch. My version should be drop-in compatible with the KDE menu entry but, since I switched from KDE to Xfce+Konqueror a while ago, I can't test it. Anyway, it's at http://www.ssokolow.com/MyPrograms/Gentoo

ssokolow

Update: In order to get nice integration with my Bazaar revision control, I moved it to https://launchpad.net/unball/

maitre

solid work, mind if I step on your toes and clean it up a bit? interested in merging it back into the service menu...

ssokolow

Actually, I'm working on my own service menu to be distributed along with the Nautilus (GNOME) equivalent to service menus, and the script itself. I'd have it up already, but it's taking longer than expected to solve an "unace freezes up when called from Konqueror" bug. By the way, sorry for the delayed reply.

ssokolow

Oh, and I also added support for properly handling tar files compressed with formats other than gzip and bzip2 as well as replacing the directory creation for zip files with something that only does it as needed and works for any archive format. Just expect a shock if you look at the code. My coding style has been called everything from esoteric to awful. (I have a habit of using boolean operators instead of if/else blocks and cooking up shell equivalents for constructs from Python's standard library.)

peppelorum

First I want to thank you for this very nice script. Found one error though; peppe@hoth ~/inetpub/test: unball ExoPHPDesk_v1.2.rar /home/peppe/bin/unball: line 10: [: =: unary operator expected Found RAR, unballing ExoPHPDesk_v1.2.rar... unrar: invalid option -- i Try `unrar --help' or `unrar --usage' for more information. Is it me of the script?

maitre

Bah - thats probably me - I'll check it and reup a better version.

j6cubic

I like the unball script, it makes managing archives easier than it was on Windows. But there is one thing that's bothering me: zip files get unzipped into folders with names like zip-filename.zip, which is quite unergonomic when you're doing everything in the Konsole.

I suggest the following change to the script, which makes it handle zip archives without the need for ugly folders:

Replace this *.zip)
echo -ne "Found zip, unballing $FILE...\n"
unzip -qq -d zip-$FILE $FILE
;;
*.ZIP)
echo -ne "Found ZIP, unballing $FILE...\n"
unzip -qq -d zip-$FILE $FILE
;;

with this
*.zip)
echo -ne "Found zip, unballing $FILE...\n"
unzip -qq -d `echo "$FILE" |sed "s/\.zip$//"` $FILE
;;
*.ZIP)
echo -ne "Found ZIP, unballing $FILE...\n"
unzip -qq -d `echo "$FILE" |sed "s/\.ZIP$//"` $FILE
;;

This makes unball turn filename.zip into filename/ instead of zip-filename.zip/.

maitre

Sweetness - you sed freak. I'll merge your changes. :)

Joker

Im very much new to this and when i dl the thing and unzip it, it doesnt have a program to open up with. So what do i do ?

maitre

Didn't see your post til now - oops. :) There's a .desktop file in there, and there's an unball script. Move the .desktop file into your servicemenus directory and the unball script anywhere in your path, I suggest /usr/bin. More detailed explanation: Open up a console, say xterm. 1. su {enter} 2. enter root password {enter} 3. cp unball /usr/bin 4. locate servicemenus This will hopefully find your servicemenus directory for you. It should be under a apps/konqueror parent directory. If you do not have locate. You can cd to / "cd /" and do: find | grep servicemenus to do the same thing (just slower). 5. cp unball.desktop /path/servicemenus 6. Logout and backin.

LukA

which theme do you have on kde3.2? i'm sorry for OT

maitre

thinkeramik - my menus are in XRender mode...

LukA

ehhmmm but the window decorations?????

maitre

nvidia...

LukA

thank you!

MDonoughe

Has anyone else noticed that if you open an archive, and then copy the contents, click up and paste, you get an error about not being able to write to (insert format here)? Is that a know bug?

gg3po

I get exactly the same error all the time. When I drop to the command line and do it manually, everything works great. It seems to be a problem with Ark, though I'm not sure what.

maitre

could be a known bug - I used konstruct to build KDE for me and I belive it patches the source for me. -maitre

maitre

that works fine for me.

MDonoughe

Is this a known bug?^^^

tommycw1

I probably just don't get it, but how is this different then the service menus provided by ark? I.E. Extract to, Extract Here, et all?

maitre

for one its quicker, rather than ark loading my script just calls the cli utilities - another big one for me is I don't have a bunch of files littered everywhere b/c someone didn't know how to put paths in their archive. i find it really useful in consoles mostly, the six or seven line servicemenu was just easy to make... -maitre

Pling
0 Affiliates
Details
license
version 0.1
updated
added
downloads 24h 0
mediaviews 24h 0
pageviews 24h 0

More Dolphin Service Menus from maitre:

Secure your data!
maitre
last update date: 19 years ago

Score 5.0

Other Dolphin Service Menus:

burnWithGrowisofs
chunkylover
last update date: 20 years ago

Score 5.0

Firefox-bookmarks service menu
storyteller
last update date: 20 years ago

Score 5.0

Text Convert Service Menu
smp-penguin
last update date: 21 years ago

Score 5.0

Pdflatex servicemenu
bobuse
last update date: 19 years ago

Score 5.0

Send through Bluetooth
dmnet
last update date: 20 years ago

Score 5.0

Add to Bloglines
spookster
last update date: 20 years ago

Score 5.0



System Tags