From kde-devel Mon Sep 08 18:53:32 2003 From: James Richard Tyrer Date: Mon, 08 Sep 2003 18:53:32 +0000 To: kde-devel Subject: Re: Getting the current directory in a service menu X-MARC-Message: https://marc.info/?l=kde-devel&m=106304752921976 Henrique Pinto wrote: >>David Faure wrote: >> >>>On Monday 08 September 2003 00:26, Henrique Pinto wrote: >>> >>> >>>>Hi, >>>> >>>>Is there any way to pass the name of the directory that is being visualized in >>>>Konqueror to an external app in the "Exec=" line of the desktop file of a >>>>service menu? I tried putting "." and "$PWD", but they always expand to the >>>>home directory, instead of the current one. >>> >>>Try %d (see the "desktop entry standard" on developer.kde.org or in kdelibs/kio) > >>I think that what he wants is for it to work like this: >> >>Giver and >> >> cd >> >> >>with the "Exec" in a desktop file. >> >>You should be able to use: >> >> cd ; >> >>The specification: >> >>http://www.freedesktop.org/standards/desktop-entry-spec/0.9.4-onehtml/ >> >>says that you can use: >> >> Path= >> >>but it doesn't appear to work. >> >>Then the second question is: how does he get the directory. > > Actually, that's not what I want. > Given , and the file on which the action should be executed, > I want to be able to do: > > Exec= --someoption , You shouldn't have to do this because: Exec= --someoption %f should give you the file name with the whole path -- it is the same as: Exec= --someoption %d%n Unless "--someoption" needs ONLY the directory. > So, think twice before saying someone did not respond some question > if you don't know what is the question... What?? You don't want people to try to help unless they understand exactly what you mean. If you read the help lists, you would know how absurd that sounds. You have to assume something. What I assume is that people don't ask simple questions, or that they ask them in the context of normal situations unless they are specific. English is a very ambiguous language even for native speakers. Above you now list a much more specific question: Exec= --someoption But, should I assume that you don't mean: Exec= --someoption rather than: Exec= --someoption ??? [they aren't the same] I am still not sure which you mean. In any case: '%d" is the directory of the file passed to a 'desktop' file -- directory containing the file that would be passed in a %f field. It is not about the current directory. But if you are passing more than one file, the situation becomes more complicated because: "%d" does not work if you pass more than one file. -- JRT >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<