Add instructions for installing Linux desktop icons and integration #104718

Closed
Bill-Spitzak wants to merge 2 commits from Bill-Spitzak/blender-manual:main into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
4 changed files with 126 additions and 7 deletions

1
.gitignore vendored
View File

@ -1,4 +1,5 @@
# Editors # Editors
*~
.vscode/* .vscode/*
# Python virtual environment # Python virtual environment

View File

@ -77,4 +77,5 @@ Follow the steps for your platform.
.. toctree:: .. toctree::
:hidden: :hidden:
linux_example_install.rst
linux_windowing_environment.rst linux_windowing_environment.rst

View File

@ -12,16 +12,15 @@ Install from blender.org
======================== ========================
Download the Linux version for your architecture and decompress the file to the desired location Download the Linux version for your architecture and decompress the file to the desired location
Review

Use a comma instead of multiple or's.

(e.g. ``/opt``, ``~/software`` or ``/usr/local``).
Use a comma instead of multiple or's. ``` (e.g. ``/opt``, ``~/software`` or ``/usr/local``). ```
(e.g. ``~/software`` or ``/usr/local``). (e.g. ``/opt`` or ``~/software`` or ``/usr/local``).
Blender can now be launched by double-clicking the executable. Blender can now be launched by running the ``blender`` executable in the installed directory.
When using this method of installation, it is possible to have multiple versions of Blender installed. Getting icons to work is somewhat tedious, but does not have to be redone when updating
blender versions. See :doc:`Linux Example Install <linux_example_install>`.
For ease of access, you can configure your system by adding a menu entry or shortcut for Blender. When using this method of installation, it is possible to have multiple versions of Blender installed
You may also associate blend-files with Blender so that when selected from the file browser, as they each have a different directory name.
they will automatically open in Blender.
These settings are typically found in conjunction with the Window Manager settings. (Gnome or KDE.)
Install from Package Manager Install from Package Manager

View File

@ -0,0 +1,118 @@
*******************
Linux example install of downloaded Blender
*******************
The following commands sucessfully installed the downloaded 4.0.2 version of Blender
Review

References to exact blender versions and spesific distributions should be avoided.

If you want to note this it can be added in a comment which isn't included in the output.

.. Developer note:

   The following commands sucessfully installed the downloaded 4.0.2 on POP!_OS version 123.
References to exact blender versions and spesific distributions should be avoided. If you want to note this it can be added in a comment which isn't included in the output. ``` .. Developer note: The following commands sucessfully installed the downloaded 4.0.2 on POP!_OS version 123. ```
on POP!_OS (a spinoff of Ubuntu). This includes making the ``.blend`` files show
thumbnails and icons and making double-clicking of them launch Blender.
This should work for other Linux distributions, however the directories files must be
placed into, especially icons, can change depending on the distribution and the
desktop theme. Search around for similar directory names and files to locate where
they should go. `Freedesktop.org <https://www.freedesktop.org/wiki/Specifications/>`__
is the official specification for how these files work.
Use of ``sudo`` can be avoided by unpacking the download into your home directory, using
that instead of ``/opt``, and making all the links to ``~/.local`` instead of ``/usr/local``.
**Extract the downloaded ``.tar.xz`` file into a directory in ``/opt``**
.. code-block:: sh
sudo mkdir -p /opt
cd /opt
sudo tar -xf ~/Downloads/blender-4.0.2-linux-x64.tar.xz
**Add a symbolic link to skip the version number**
.. code-block:: sh
sudo ln -sTf blender-4.0.2-linux-x64 /opt/blender
**Make Blender commands work from the command line**
.. code-block:: sh
sudo ln -s /opt/blender/blender /usr/bin/blender
Review

Prefer ~/.local/bin over /usr/bin.

Prefer `~/.local/bin` over `/usr/bin`.
sudo ln -s /opt/blender/blender-thumbnailer /usr/bin/blender-thumbnailer
You should now be able to type ``blender`` in a shell to run it.
**Make the desktop know about the blender application**
.. code-block:: sh
sudo ln -s /opt/blender/blender.desktop /usr/share/applications/
Review

Prefer ~/.local/share/applications/ over /usr/share/applications/.

Prefer `~/.local/share/applications/` over `/usr/share/applications/`.
It should now appear in your Application selector, but the icon is missing.
**Make the icon for the blender application work**
.. code-block:: sh
sudo ln -s /opt/blender/blender.svg /usr/share/icons/hicolor/scalable/apps/blender.svg
Review

Prefer ~/.local/share/icons over /usr/share/icons

Prefer `~/.local/share/icons` over ` /usr/share/icons`
Here you need to locate the correct directory for your Linux distribution.
**Check if the "mime type" exists**
This should work on any modern Linux installation.
.. code-block:: console
$ mimetype foo.blend
foo.blend: application/x-blender
Alternative:
.. code-block:: console
$ grep blender /etc/mime.types
application/x-blender blend
**Add the mimetype if missing**
Put the following into ``/usr/share/mime/packages/Overrides.xml``:
.. code-block:: xml
Review

This seems like something Blender should bundle, then it can be installed via:

xdg-mime install x-blender.xml

Arch Linux for e.g. includes an x-blender.xml, so I assume we could bundle this too.

This seems like something Blender should bundle, then it can be installed via: ``` xdg-mime install x-blender.xml ``` Arch Linux for e.g. includes an `x-blender.xml`, so I assume we could bundle this too.
Review

My system also already contained the .blend file mime type, but no icon for it. I just copied these instructions from a web page about adding mime types, do not know for certain if they work. I do not know enough about how to cleanly remove things (there seem to be cache files) in order to be able to actually test if this stuff works.

My system also already contained the .blend file mime type, but no icon for it. I just copied these instructions from a web page about adding mime types, do not know for certain if they work. I do not know enough about how to cleanly remove things (there seem to be cache files) in order to be able to actually test if this stuff works.
<?xml version="1.0" encoding="UTF-8"?>
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
<mime-type type="application/x-blender">
<comment>Blender scene</comment>
<glob pattern="*.blend"/>
<sub-class-of type="text/plain"/>
</mime-type>
</mime-info>
And run this:
.. code-block:: sh
sudo update-mime-database /usr/share/mime
**Make the icon for .blend files work**
.. code-block:: sh
sudo ln -s /opt/blender/blender-symbolic.svg \
Review

This seems pop-os spesific, if we give instructions for a spesific distro I would rather use one of the main-stream Linux distros Ubuntu/Debian/Redhat for e.g.

This seems pop-os spesific, if we give instructions for a spesific distro I would rather use one of the main-stream Linux distros Ubuntu/Debian/Redhat for e.g.
Review

All I know is I had to try several directories before they appeared If anybody can decipher freedesktop.org's rules it would help. Would like something like "put it in $XDG_SECRET_DIRECTORY/scalable/blend.svg but have not found anything like that.

All I know is I had to try several directories before they appeared If anybody can decipher freedesktop.org's rules it would help. Would like something like "put it in `$XDG_SECRET_DIRECTORY/scalable/blend.svg` but have not found anything like that.
/usr/share/icons/Pop/scalable/mimetypes/application-x-blender.svg
sudo update-icon-caches /usr/share/icons/Pop/
At least for this system, an entirely different subdirectory had to be used than
the one for the execuatble icon.
**Make thumbnails work for .blend files**
Thumbnails may already be working, try saving a ``.blend`` file and then looking
at it in the files application. If not this should make them work:
Put the following into ``/usr/share/thumbnailers/x-blender.thumbnailer``:
Review

~/.local/share/thumbnailers can be used here.

`~/.local/share/thumbnailers` can be used here.
.. code-block:: ini
[Thumbnailer Entry]
TryExec=/usr/bin/blender-thumbnailer
Exec=/usr/bin/blender-thumbnailer %i %o
MimeType=application/x-blender;