roboticslab-uc3m / questions-and-answers

A place for general debate and question&answer
https://robots.uc3m.es/developer-manual/appendix/repository-index.html
2 stars 0 forks source link

Fix hard-coded paths of scripts/gnome/___.desktop #52

Open jgvictores opened 6 years ago

jgvictores commented 6 years ago

Org-wide fix hard-coded paths of scripts/gnome/___.desktop

Learn from https://github.com/roboticslab-uc3m/asibot-configuration-files

Refs:

Special treatment as always for https://github.com/roboticslab-uc3m/project-generator

PeterBowman commented 6 years ago

TODO list (:panic:):

Note: some of these are not used at all and may be safely removed. Note 2: repos marked with an x are low priority.

PeterBowman commented 6 years ago

CMakeLists.txt (no install step yet)

Let's talk about this. Where should these .desktop files land upon install? Is $HOME/Desktop a good location, and plain $HOME as a fallback in case of trouble (e.g. missing Desktop directory)? The xdg-user-dir utility could come in handy here, see:

jgvictores commented 6 years ago

Is $HOME/Desktop a good location, and plain $HOME as a fallback in case of trouble (e.g. missing Desktop directory)?

Yes, that would be perfect.

PeterBowman commented 6 years ago

Proof of concept: https://github.com/roboticslab-uc3m/asibot-configuration-files/commit/d8f9f07e6c9d3a9eceb61a014722354a42aa5112.

Behavior:

*()** Actually, the generated shortcut should be properly handled to work locally, i.e. from build/. I'd leave this as a TODO.

PeterBowman commented 6 years ago

(*) Actually, the generated shortcut should be properly handled to work locally, i.e. from build/. I'd leave this as a TODO.

Done at https://github.com/roboticslab-uc3m/asibot-configuration-files/commit/825b9f72274f2172da6dac0d31980187b3da9861.

PeterBowman commented 6 years ago

As found out at https://github.com/asrob-uc3m/robotDevastation/issues/126, we are having trouble in correctly displaying the shortcut icon whenever the full path points at system-located PNG files. Apart from that, @jgvictores posted the following link, which may render useful: https://developer.gnome.org/integration-guide/stable/desktop-files.html.en. I learned from it that the standard way of registering applications in a GNOME-compatible desktop (so that they show up as menu items (Debian) or as search results in the Unity launcher (Ubuntu)) is to place their .desktop shortcuts either in /usr/share/applications (all users) or ~/.local/share/applications (single user). Therefore, we'll may have up to three different copies of the same app shortcut:

All or some of these might be enabled/disabled via CMake options.

PeterBowman commented 6 years ago

Solely regarding icon files and their standard location(s): https://askubuntu.com/a/435612. Perhaps /usr/local/share/icons? (per $XDG_DATA_DIRS/icons, test on different distros)

PeterBowman commented 4 years ago

Moar on standard directory layout: http://www.pathname.com/fhs/pub/fhs-2.3.html#USRLOCALLOCALHIERARCHY.