Help needed: specification of current directory for shell scripts in .desktop files

Waldo Bastian bastian at kde.org
Thu Mar 25 18:20:33 EET 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wed March 24 2004 12:40, Michael Jeltsch wrote:
> I came across a strange behaviour of .desktop files when used in KDE 3 as
> service menus for Konqueror (Suse Linux 9): When I specify a shell script
> for "Exec", the current directory of the shell script seems to be allways
> my home directory. This is kind of strange when URLs or file lists are
> forwarded to the shell script. E.g. when renaming files with mv in my shell
> script, they are moved to my home directory instead of just renamed...
> Setting "Path" inside the .desktop file does not help in this case (because
> the "Type" is not Application and thus probably ignored). I need to
> integrate my shell scripts into the desktop.

If you only handle single files (e.g. %f or %u) you can use %d to get the 
directory. Unfortunately %d doesn't work in combination with multiple files 
(%U or %F)

You can use "dirname" in your script to extract the directory from the 
filename.

Hope that helps.

Cheers,
Waldo
- -- 
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
^ bastian at kde.org | Is your software SUSE LINUX READY? | bastian at suse.com
^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQFAYwbRN4pvrENfboIRAt7YAKClW9w6rOzXwyTbRG8FdHWLuhU5/QCfQ5lG
vGy1rYP70ANkaIQj3Pmregk=
=SqY7
-----END PGP SIGNATURE-----




More information about the xdg mailing list