<div class="gmail_quote">On Sun, Jan 15, 2012 at 8:43 PM, Emmanuele Bassi <span dir="ltr">&lt;<a href="mailto:ebassi@gmail.com">ebassi@gmail.com</a>&gt;</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 &lt;<a href="mailto:pcman.tw@gmail.com">pcman.tw@gmail.com</a>&gt; wrote:<br>
&gt; Slightly off topic, is there any consensus on how to detect current desktop<br>
&gt; environment?<br>
&gt; Previously a proposed environment variable XDG_CURRENT_DESKTOP was mentioned<br>
&gt; on the ML, but there was no conclusion.<br>
&gt; Can we start a discussion on this issue again?<br>
&gt; It&#39;s very important for desktop-independent applications, such as web<br>
&gt; browsers.<br>
<br>
</div>applications should be detecting capabilities, not doing string<br>
comparisons on desktop environment names.<br>
<br></blockquote><div>Then what&#39;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&#39;t think this is a good idea suitable for &quot;all&quot; 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 &quot;name string&quot;. Otherwise, things like &quot;uname&quot; won&#39;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&#39;s wrong with it. It&#39;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&#39;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&#39;s like<br>
whitelisting or blacklisting a GL driver based on the output of the<br>
glxinfo Renderer string: let&#39;s not repeat the mistakes of the past<br>
(*cough* Flash *cough*).<br></blockquote><div class="im">Isn&#39;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>

&gt; If you&#39;re not able to detect current DE, how can you apply<br>
&gt; 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&#39;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 &quot;free world&quot;, 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&#39;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&#39;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>