[Portland] Detect xdg-utils

karderio karderio at gmail.com
Fri Dec 22 14:08:38 PST 2006


Hi :o)

I was wondering how an app would go about checking for xdg-utils before
calling one of the utilities. 

I am thinking of using xdg-utils in an installation script I am working
on. The best way I could come up with to check if a utility is actually
there is to run  "xdg-desktop-menu --version", for example, and check
the output. If I wanted to install a desktop menu icon, a desktop icon
and associate files with an app, I would have to run three tests. This
sort of test seems to be a less than ideal solution.

I got thinking that what would be very handy for me would be a little
tool to discover what xdg-utils tools the system had installed, let's
say we call it "xdg-capability". This tool would allow me to query if
xdg-utils is installed, what version, and what individual xdg-utils
tools are available and their versions. This way, before doing anything,
I could check for the availability of all tools.

I read the usage documentation, and this seems great for scripts. I am
thinking there may be some cases where developers would like more
control over which version they are using though.

If you're still reading this, I will now get to the point :o) Is there
already a proper way to test for xdg-utils ?

Thanks for your time.

Love, Karderio.





More information about the Portland mailing list