Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><a href="http://www.freedesktop.org/wiki/Specifications" rel="nofollow noreferrer">http://www.freedesktop.org/wiki/Specifications</a> is probably a good place to start. I find these quite hard to follow most of the time, but sometimes you can figure it out. Specifically, the "Desktop Entry Specification".</p> <p>Also, I don't think you'll be able to use any aliases from <code>.bashrc</code>, at least not without writing some kind of wrapper script. I think it needs to be an executable file. Of course, you could just use the good old symlinks- to- same + what's- my- name trick...</p> <p>(Which, for reference, goes like this:</p> <ol> <li>Make a script which uses its own name as a parameter.</li> <li>Make symlinks to said script using the parameter values as the link names.)</li> </ol> <hr> <h1>Investigating...</h1> <p>Some casual investigation reveals that creating these is fairly simple if you use Nautilus, (at least the version I have):</p> <ol> <li>Bring up the context menu for some random file, and use "Open With"->"Open with Other Application".</li> <li>Unfold the "Use a custom command" and type in something like: <ol> <li><code>xterm -e 'bash -c "unzip -l %f; sleep 5"'</code></li> </ol></li> <li>This results in <ol> <li>the command being run (so don't type <code>rm -rf</code>)</li> <li>a file in <code>~/.local/share/applications/</code> called <code>xterm-usercreated.desktop</code></li> </ol></li> </ol> <p>Here at least, I get the follow file:</p> <pre><code>[Desktop Entry] Encoding=UTF-8 Name=xterm MimeType=application/zip; Exec=xterm -e 'bash -c "unzip -l %f; sleep 5"' %f Type=Application Terminal=false NoDisplay=true </code></pre> <p>4: Looking at the system xterm .desktop I find this:</p> <pre><code>[Desktop Entry] Type=Application Encoding=UTF-8 Name=XTerm GenericName= Comment=XTerm: terminal emulator for X Icon=/usr/share/pixmaps/xterm-color_32x32.xpm Exec=xterm Terminal=false Categories=X-Debian-Applications-Terminal-Emulators; </code></pre> <p>5: Editing the .usercreated.desktop file to this:</p> <pre><code>[Desktop Entry] Type=Application Encoding=UTF-8 Name=xtermz Exec=xterm -e 'bash -c "unzip -l %f; sleep 5"' %f Terminal=false Categories=X-Local-WTF </code></pre> <p>6: Run xdg-desktop-menu forceupdate --mode user</p> <p>7: "xtermz" now shows up in the list... Success!</p> <p>8: Yuck! This also makes it appear in the main menu, under "Other". Weird!</p> <hr> <h2>Some notes:</h2> <ul> <li>In my Debian/testing, <code>xdg-desktop-menu</code> and friends (notably <code>xdg-icon-resource</code>) live in the <code>xdg-utils</code> package.</li> <li>You should be able to create a <code>.desktop</code> file from scratch.</li> <li>You should be able to install the <code>.desktop</code> file using <code>xdg-desktop-menu install</code> blah blah</li> </ul>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload