22 May 2005

My first servicemenus


Since some months ago I wanted to know how to do that kind of things that
happen when you click with right buttom over a file.

Especially I wanted to do the same that happen in Windows XP when you try to
send pictures by mail. A window appear and you choose if you want to resize
the pictures before send.

This is something similar but without window.

You need to have ImageMagick installed (it is fantastic)

Like always, for Linux and checked on my Debian.

Ah! I forgot. You need to have a empty map in /tmp/pictures_resize

Some links used: (in the beginning I didn't know what was the name of this
kind of things. Now I know that they are called servicemenus and own to
konqueror (in Kde))

http://kde-apps.org/?xcontentmode=287
http://developer.kde.org/documentation/tutorials/dot/index.html
http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-0.9.3.html

------------------------------------------------------

# Resize pictures and send by mail
# by xrubenx
# GPL

[Desktop Entry]
ServiceTypes=image/jpg,image/jpeg
Actions=resizejpgMedium;resizejpgSmall;

[Desktop Action resizejpgMedium]
Name=Resize Medium(60%) and email
Icon= image
Exec=cp %U /tmp/pictures_resize/. ; mogrify -resize 60% /tmp/pictures_resize/* ; kmail --attach /tmp/pictures_resize/* ;sleep 5; rm -f /tmp/pictures_resize/*;


[Desktop Action resizejpgSmall]
Name=Resize Small(40%) and email
Icon=image
Exec=cp %U /tmp/pictures_resize/. ; mogrify -resize 40% /tmp/pictures_resize/* ; kmail --attach /tmp/pictures_resize/* ;sleep 5; rm -f /tmp/pictures_resize/*;

0 Comments:

Post a Comment

<< Home

Too Cool for Internet Explorer