<div class="gmail_quote">On Sun, Jan 15, 2012 at 8:43 PM, Emmanuele Bassi <span dir="ltr"><<a href="mailto:ebassi@gmail.com">ebassi@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
hi;<br>
<div class="im"><br>
On 15 January 2012 12:10, PCMan <<a href="mailto:pcman.tw@gmail.com">pcman.tw@gmail.com</a>> wrote:<br>
> Slightly off topic, is there any consensus on how to detect current desktop<br>
> environment?<br>
> Previously a proposed environment variable XDG_CURRENT_DESKTOP was mentioned<br>
> on the ML, but there was no conclusion.<br>
> Can we start a discussion on this issue again?<br>
> It's very important for desktop-independent applications, such as web<br>
> browsers.<br>
<br>
</div>applications should be detecting capabilities, not doing string<br>
comparisons on desktop environment names.<br>
<br></blockquote><div>Then what's the purpose of OnlyShowIn/NotShowIn?<br></div><div>Besides, how to detect capabilities?<br>Examing for specific dbus interface or using systemd?<br>I don't think this is a good idea suitable for "all" applications.<br>
</div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
a desktop environment UX can change without its name changing; or new<br>
desktop environments, with similar UX can appear.<br>
<br></blockquote><div>Feel free to do additional capability testing in your desktop environment.<br>You can still do the additonal checks you like regardless of the DE name given.<br>Sometimes we really just need that "name string". Otherwise, things like "uname" won't exist, either.<br>
Sometimes you just need the name for some programs and there is no easy way to figure it out.<br></div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
checking the name of the desktop environment is going to be hopelessly<br>
out of date, or actively wrong.<br></blockquote><div>Please explain what's wrong with it. It's quite useful for desktop independent programs.<br>Not everyone writes source code for Gnome or KDE only.<br>There are programs which need to be usable across desktop environment.<br>
If I want to know which program I can use to open file of a mime-type, I query mime database.<br>Then I get a list of desktop entry files. If I don't know the name of DE, how can I know which ones can be shown?<br></div>
<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
plus, are you seriously going to add a bunch of<br>
whitelisting/blacklisting of behaviours inside application code, and<br>
basing it on strings? because that *will* break. it's like<br>
whitelisting or blacklisting a GL driver based on the output of the<br>
glxinfo Renderer string: let's not repeat the mistakes of the past<br>
(*cough* Flash *cough*).<br></blockquote><div class="im">Isn't this what has been done in menu spec, a listing of known desktop environments for OnlyShowIn/NotShowIn in the spec?<br>Everytime a new DE is created, we add it to the list. Is this ideal?<br>
> If you're not able to detect current DE, how can you apply<br>
> OnlyShowIn/NotShowIn correctly?<br>
</div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
showing entries is the desktop environment role, not the application's<br>
role - and a desktop environment should know its own name.<br></blockquote><div>Then why a project like xdg-utils exist? It should be killed. <br></div><div>In the "free world", not every applications is designed to work with Gnome or KDE only.<br>
Not every program is bound to a specific desktop environment, either.<br>While I understand your ambition for finding the best solution possible, it's not necessarilty the best for other small and simple projects.<br>
Please leave room for others. We just need a simple solution to solve simple cases.<br>If name comparison is not enough for your DE, you can still add more complicated rules to yours.<br>Adding a common way to export DE name won't hurt anything. It only helps people who really need it much.<br>
<br>Thanks<br><br></div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
ciao,<br>
Emmanuele.<br>
<font color="#888888"><br>
--<br>
W: <a href="http://www.emmanuelebassi.name" target="_blank">http://www.emmanuelebassi.name</a><br>
B: <a href="http://blogs.gnome.org/ebassi/" target="_blank">http://blogs.gnome.org/ebassi/</a><br>
</font></blockquote></div><br>