Skip to content

Commit

Permalink
Rename desktop -> freedesktop/, package with release, update
Browse files Browse the repository at this point in the history
instructions to Markdown
  • Loading branch information
michaliskambi committed Feb 6, 2021
1 parent 8e5c296 commit c4b9df1
Show file tree
Hide file tree
Showing 15 changed files with 51 additions and 36 deletions.
7 changes: 4 additions & 3 deletions CastleEngineManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<project name="view3dscene"
standalone_source="code/view3dscene.lpr"
author="Michalis Kamburelis"
qualified_name="net.sourceforge.castleengine.view3dscene"
qualified_name="io.castleengine.view3dscene"
>
<icons>
<icon path="windows/view3dscene.ico" />
<icon path="desktop/view3dscene.svg" />
<icon path="desktop/view3dscene.icns" />
<icon path="freedesktop/view3dscene.svg" />
<icon path="freedesktop/view3dscene.icns" />
</icons>
<dependencies>
<dependency name="Zlib" /> <!-- read .gz -->
Expand All @@ -20,6 +20,7 @@
<package>
<include path="tovrmlx3d*" />
<include path="COPYING.GPL2.txt" />
<include path="freedesktop/*" recursive="True" />
</package>
<data exists="false" />

Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ install:
install view3dscene $(BINDIR)
install tovrmlx3d $(BINDIR)
install -d $(DATADIR)
cd desktop/ && ./install.sh "$(DATADIR)"
cd freedesktop/ && ./install.sh "$(DATADIR)"

.PHONY: uninstall
uninstall:
rm -f $(BINDIR)/view3dscene \
$(BINDIR)/tovrmlx3d
cd desktop/ && ./uninstall.sh "$(DATADIR)"
cd freedesktop/ && ./uninstall.sh "$(DATADIR)"

# code generation ------------------------------------------------------------

Expand Down
File renamed without changes.
File renamed without changes.
74 changes: 44 additions & 30 deletions desktop/INSTALL.txt → freedesktop/README.md
Original file line number Diff line number Diff line change
@@ -1,58 +1,66 @@
To install on Linux or FreeBSD (any desktop Unix using Xorg and following standard XDG specifications)
you can use the files provided here.
# Installing desktop files for freedesktop

This directory contains files for desktop integration (icons, associations, menu entries) on https://freedesktop.org/ desktops, which practically means: desktops on Linux, FreeBSD and other free software Unix.

# How to install

It is advised to build and install by executing this in the top-level view3dscene directory:

make
sudo make install
```
make
sudo make install
```

The latter command makes a system-wide installation,
copying the view3dscene and tovrmlx3d binaries to /usr/local/bin , to make them available on $PATH.
It also installs some desktop files under /usr/local/share .
You can undo it by
The latter command makes a system-wide installation, copying the view3dscene and tovrmlx3d binaries to `/usr/local/bin` , to make them available on `$PATH`. It also installs some desktop files under `/usr/local/share`. You can undo it by

sudo make uninstall
```
sudo make uninstall
```

If you would prefer to make an installation only for your used,
and not use root privileges, you can also just run
If you would prefer to make an installation only for your used, and not use root privileges, you can also just run

cd desktop/
./install.sh
```
cd freedesktop/
./install.sh
```

But in the latter case, it is your responsibility to make the binaries
actually visible by X session.
Note that you will need to modify $PATH used by the X session,
which usually means you need to create and use the ~/.Xsession file.
( Adjusting path of your shell, e.g. in ~/.bashrc, is *not* enough. )
But in the latter case, it is your responsibility to make the binaries actually visible by X session. Note that you will need to modify `$PATH` used by the X session, which usually means you need to create and use the `~/.Xsession` file. (Adjusting path of your shell, e.g. in `~/.bashrc`, is *not* enough.)

------------------------------------------------------------------------------
DETAILS HOW THIS WORKS
(for developers -- normal users can stop reading now :) ):
# DETAILS HOW THIS WORKS

See http://library.gnome.org/devel/integration-guide/stable/desktop-files.html.en
for basic GNOME integration instructions.
This is for developers -- normal users can stop reading now :)

See http://library.gnome.org/devel/integration-guide/stable/desktop-files.html.en for basic GNOME integration instructions.

Desktop file

- Should be copied to /usr/share/applications or ~/.local/share/applications
(for GNOME <= 2.10 (<= 2.8 on Fedora) this should be
~/.gnome2/vfolders/applications).

- See http://standards.freedesktop.org/menu-spec/latest/apa.html
for a list of allowed Category values.

- "StartupNotify=true" can be useful for me to add to *.desktop files,
as GTK 2 backend should automatically support this
(http://library.gnome.org/devel/gdk/stable/gdk-General.html#gdk-notify-startup-complete).
For now, view3dscene opens instantly fast, so it's not needed.

- update-desktop-database call is needed to actually associate my program
with MimeType specified in desktop file. (Found by looking at some Debian
packges postinst script.)

Icon file

- Should be copied under /usr/share/icons/,
most standard is /usr/share/icons/hicolor/48x48/apps/.
Local user has this in ~/.local/share/icons/
and ~/.local/share/icons/hicolor/48x48/apps/

- "48x48" is just indicated as most standard, and smaller versions will
be generated from it. For SVG icons, I think (but didn't actually
read this anywhere) they should go to "scalable" subdir.

- Update: although on my Debian "scalable" subdir is indeed standard,
it looks like desktop icon remains for some reason stupidly small
(even though it's recorded in SVG file that resolution is 48x48).
Expand All @@ -61,23 +69,28 @@ Icon file
just adds 48x48 icon as PNG file, in addition to SVG in scalable.
Fortunately, we can trivially easy just autogenerate PNG 48x48 version
to workaround this.

- Do not specify icon extension in *.desktop file.
Algorithm for searching icons (from spec
http://standards.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html)
makes it clear that implementation will try appending various extensions
on it's own. Besides, as noted above, we have both SVG and PNG versions of
the icon, so we do not know what extension to specify.

Mime file
Mime file:

- Should be copied to /usr/share/mime/packages/,
local user location is ~/.local/share/mime/packages/.

- After copying you should run
update-mime-database /usr/share/mime
or equivalent for local user location.

- Note that our mime XML file describes "model/x3d+binary", but it's
not yet listed in our desktop file --- because we do not handle x3db yet.

Thumbnailer script:

- It works :)

- Beware that loading arbitrary 3D scene may take a lot of time,
Expand All @@ -102,9 +115,10 @@ Thumbnailer script:
slowdowns when using this thumbnailer.

You may want to run
killall gnome-panel
killall nautilus
to refresh icons and mime types everywhere without relogging to GNOME.
(If anyone knows a cleaner to do this, please let me know.) Without these
kills, only the menu entry is actomatically updated. I.e. changes to *.desktop
files dir are picked up automatically, but icon and mime files not (it seems).

```
killall gnome-panel
killall nautilus
```

to refresh icons and mime types everywhere without relogging to GNOME. (If anyone knows a cleaner to do this, please let me know.) Without these kills, only the menu entry is actomatically updated. I.e. changes to *.desktop files dir are picked up automatically, but icon and mime files not (it seems).
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
2 changes: 1 addition & 1 deletion macosx/pack_macosx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ lazbuild ../code/view3dscene.lpi
echo '--------------------- Compiling tovrmlx3d --------------------'
lazbuild ../code/tovrmlx3d.lpi

create_bundle view3dscene ../view3dscene ../desktop/view3dscene.icns \
create_bundle view3dscene ../view3dscene ../freedesktop/view3dscene.icns \
' <dict>
<key>CFBundleTypeExtensions</key>
<array>
Expand Down

0 comments on commit c4b9df1

Please sign in to comment.