desura / Desurium

Free online games platform (juegos gratis), with an open source client. LGPL repo for Desura client. Potentially out of date. See https://github.com/desura/desura-app for newest (LGPL) client.
https://www.desura.com/es
GNU General Public License v3.0
270 stars 42 forks source link

Add create menu shortcut on linux #29

Closed lodle closed 12 years ago

lodle commented 12 years ago

http://www.moddb.com/groups/desura/forum/thread/shortcut-of-games-on-desktop/#705641

All Ready implemented on windows. Shouldnt be to hard to add.

Protektor-Desura commented 12 years ago

I believe there is a FHS standard for adding shortcuts/icons for Linux.

ssokolow commented 12 years ago

There is a standard and it's elegantly simple to the point of almost being ridiculous. Just create a .desktop file like this example one:

[Desktop Entry]
Type=Application

Name=FooGame
Comment=A game of foo
Comment[fr]=Un jeu de foo

TryExec=/home/username/opt/desura/common/foo-game/value_of_iteminfo.installcheck
Exec=/home/username/opt/desura/common/foo-game/desura_launch_Play.sh
Icon=/home/username/opt/desura/common/foo-game/absolute_path_value_of_iteminfo.icon

Categories=Game;BoardGame;Java;

...and then use one or both of these commands to install it:

xdg-desktop-icon install YourIcon.desktop
xdg-desktop-menu install YourIcon.desktop

The man pages for both of those commands give you a concise and helpful introduction to the .desktop file spec, but it's not necessarily up-to-date on what is required and optional, so I strongly suggest spending the 15 minutes to read the actual spec itself at http://standards.freedesktop.org/desktop-entry-spec/latest/

If nothing else, you'll want to go above and beyond the man pages by mapping any category information Desura can provide to the Categories field so Desura doesn't annoy people who are used to having their launcher menus automatically categorize icons for them. (Or, at the very least, set Categories=Game;)

The registered list of valid categories is at http://standards.freedesktop.org/menu-spec/latest/apa.html

Jookia commented 12 years ago

I'm a very big fan of the standards there. In fact, I implemented the XDG directory standard.

ssokolow commented 12 years ago

Agreed.

I'd actually be trying to convert my little Python script for setting icons on STATUS_LINK entries into some C++/JS patch to use XDG menus to resolve commands to icons but I haven't yet been able to make time to track down why the Desurium build instructions fail on my Lubuntu Oneiric desktop.

Jookia commented 12 years ago

ssokolow, i highly recommend you check out karolherbst's fork, it uses CMake.

ssokolow commented 12 years ago

Thanks. I actually would normally be keeping an eye on the network view, but I've been overworked lately and forgot. I'll give it a try as soon as I can make time.

karolherbst commented 12 years ago

look here: https://github.com/karolherbst/Desurium/compare/master...bug29

any suggestions?

I think about to move the whole desktop creation stuff into ItemInfo

karolherbst commented 12 years ago

we should add a functionality to add games to the application menu on Linux and on Windows (if it isn't there already)

ssokolow commented 12 years ago

In Windows, that would be partially covered by issue #138. I'm unfamiliar with the ins and outs of jumplists, though, so I don't know how much it would cover.

karolherbst commented 12 years ago

yes I will add this to bug #138, so I can close this for the Linux part later

karolherbst commented 12 years ago

fixed since fd3f6d443bbeb1232aba897c5bb2d4adeac693c3