setup script for Linux desktop
Open, NormalPublic

Description

Patch for: T34218

setup.sh installs freedesktop files (blender.desktop, blender.thumbnailer, and icons) to current user's ~/.local/share directory. Users can easily setup application menu and thumbnailer.

This script assumes blender, blender-thumbnailer.py, and the freedesktop files are in the same directory. I tested it only with bash and am not sure it works with sh shell.

Also attached blender.thumbnailer file.

Details

Type
Patch

Great. Thanks. Works perfectly in Ubuntu 13.10.

And apparently not working in Ubuntu 14.04
If I launch it with -f in my blender folder I get this:

$ ./setup.sh -f
Creating /home/vicente/.local/share/applications/blender.desktop file...
================================================================================
[Desktop Entry]
Name=Blender
GenericName=3D modeller
GenericName[es]=modelador 3D
GenericName[de]=3D-Modellierer
GenericName[fr]=modeleur 3D
GenericName[ru]=Редактор 3D-моделей
Comment=3D modeling, animation, rendering and post-production
Comment[es]=modelado 3D, animación, renderizado y post-producción
Comment[de]=3D-Modellierung, Animation, Rendering und Nachbearbeitung
Exec=/home/vicente/aplicaciones/blender/trunk/install/linux/blender
Icon=blender
Terminal=false
Type=Application
Categories=Graphics;3DGraphics;
MimeType=application/x-blender;
================================================================================
Creating /home/vicente/.local/share/thumbnailers/blender.thumbnailer file...
================================================================================
[Thumbnailer Entry]
TryExec=/home/vicente/aplicaciones/blender/trunk/install/linux/blender-thumbnailer.py
Exec=/home/vicente/aplicaciones/blender/trunk/install/linux/blender-thumbnailer.py %u %o
MimeType=application/x-blender;
================================================================================
Installing application icons...
/home/vicente/.local/share/icons/hicolor/16x16/apps/blender.png
/home/vicente/.local/share/icons/hicolor/48x48/apps/blender.png
/home/vicente/.local/share/icons/hicolor/scalable/apps/blender.svg
/home/vicente/.local/share/icons/hicolor/22x22/apps/blender.png
/home/vicente/.local/share/icons/hicolor/256x256/apps/blender.png
/home/vicente/.local/share/icons/hicolor/32x32/apps/blender.png
/home/vicente/.local/share/icons/hicolor/24x24/apps/blender.png

and this is the content of the folder:

$ ls
2.70     blender.desktop  blender.thumbnailer     copyright.txt     GPL-license.txt  jemalloc-license.txt   LICENSE-bmonofont-i18n.ttf.txt  Python-license.txt  setup.sh
blender  blenderplayer    blender-thumbnailer.py  GPL3-license.txt  icons            LICENSE-bfont.ttf.txt  LICENSE-droidsans.ttf.txt       readme.html

Talked with Sergey... and its a bit awkward where this fits in, a setup.sh file makes it look as if setup is necessary.

Would prefer to use the same argument we have for windows. blender -r, this can setup icons and thumbnailer (using a Python script internally, see how BPY_string_exec, in set_addons, this can load some external script)

Note that we could also associate Blend files with this blender

xdg-mime default blender.desktop application/x-blender

see: https://wiki.archlinux.org/index.php/xdg-open