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 117 additions and 7 deletions
Showing only changes of commit cfa8c9aa42 - Show all commits

1
.gitignore vendored
View File

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

View File

@ -77,4 +77,5 @@ Follow the steps for your platform.
.. toctree::
:hidden:
linux_freedesktop.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
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``).
Bill-Spitzak marked this conversation as resolved Outdated

To be fair, /usr/local is a pretty popular location as well.

To be fair, `/usr/local` is a pretty popular location as well.
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:`Installing freedesktop.org icons <linux_freedesktop>`.
For ease of access, you can configure your system by adding a menu entry or shortcut for Blender.
You may also associate blend-files with Blender so that when selected from the file browser,
they will automatically open in Blender.
These settings are typically found in conjunction with the Window Manager settings. (Gnome or KDE.)
When using this method of installation, it is possible to have multiple versions of Blender installed
as they each have a different directory name.
Install from Package Manager

View File

@ -0,0 +1,109 @@
*******************
Installing freedesktop.org icons
*******************
Exactly where to place icons varies depending on the Linux distribution and the
desktop environment theme. These instructions worked for Pop!_OS, an Ubuntu
spinoff. In general you should search for similar files in order to figure out what
directory to place the icons in. Text you may have to change is in red.
Bill-Spitzak marked this conversation as resolved Outdated

I can't see anything in red. Are the parts supposed to be in red the ones inside single-quotes?

I can't see anything in red. Are the parts supposed to be in red the ones inside single-quotes?

For me the stuff in single quotes is red. If this is not true for everybody, I'm not sure what can be done. Possibly just not do anything except say outside the box that some of the text might change. Did it produce any kind of formatting for you?

For me the stuff in single quotes is red. If this is not true for everybody, I'm not sure what can be done. Possibly just not do anything except say outside the box that some of the text might change. Did it produce any kind of formatting for you?

I gave up on highlighting it.

I gave up on highlighting it.
These instructions assume you want to install system-wide in ``/opt``. You can avoid
the need for ``sudo`` by instead installing somewhere in your home directory, using
that directory instead of ``/opt`` and using ``~/.local`` instead of ``/usr``.
**Extract the downloaded ``.tar.xz`` file into a directory in ``/opt``**
.. code-block:: sh
sudo mkdir /opt
Bill-Spitzak marked this conversation as resolved Outdated

Is this necessary? If so, perhaps it'd better be addressed in the preceding text ("if you happen not to have /opt, then you're free to create it/use the appropriate folder for your setup.").
It'd be confusing for a newbie to start the tutorial getting an error on the first command (and it's going to happen to almost(?) every user that tries it).

Is this necessary? If so, perhaps it'd better be addressed in the preceding text ("*if you happen not to have `/opt`, then you're free to create it/use the appropriate folder for your setup.*"). It'd be confusing for a newbie to start the tutorial getting an error on the first command (and it's going to happen to almost(?) every user that tries it).

Can also put in -p similar to your suggestion for fixing the symbolic links.

Can also put in ``-p`` similar to your suggestion for fixing the symbolic links.
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 rm /opt/blender
sudo ln -s blender-'4.0.2-linux-x64' /opt/blender
Bill-Spitzak marked this conversation as resolved Outdated

You can substitute the existing link in a single command, with ln's -Tf flags:
sudo ln -sTf blender-'4.0.2-linux-x64' /opt/blender
instead of manually removing /opt/blender, which is going to yield an error in the probable case that it doesn't exist.

You can substitute the existing link in a single command, with `ln`'s `-Tf` flags: `sudo ln -sTf blender-'4.0.2-linux-x64' /opt/blender` instead of manually removing `/opt/blender`, which is going to yield an error in the probable case that it doesn't exist.
**Make running blender from the command line work**
.. code-block:: sh
sudo ln -s /opt/blender/blender /usr/bin/blender
sudo ln -s /opt/blender/blender-thumbnailer /usr/bin/blender-thumbnailer
Bill-Spitzak marked this conversation as resolved Outdated

Should this step be placed somewhere else?

Should this step be placed somewhere else?

I probably should change the text to "make the commands in the blender installation work from the command line". I was concerned that there may be more than these two in the future, and that putting all the similar commands next to each other is better.

I probably should change the text to "make the commands in the blender installation work from the command line". I was concerned that there may be more than these two in the future, and that putting all the similar commands next to each other is better.
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/
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/
Bill-Spitzak marked this conversation as resolved Outdated

I guess everything under /usr/share/icons/ is freedesktop-compliant, but based on what other apps on my machine do, I'd go one level further still: /usr/share/icons/hicolor/scalable/apps/.

I guess everything under `/usr/share/icons/` is freedesktop-compliant, but based on what other apps on my machine do, I'd go one level further still: `/usr/share/icons/hicolor/scalable/apps/`.

Yes looks like a good idea, and it works for me.

Yes looks like a good idea, and it works for me.
**Check if the "mime type" exists**
This may be true of any modern Linux install.
Bill-Spitzak marked this conversation as resolved Outdated

"This may be true"? Perhaps "This should work in any modern..."

"This may be true"? Perhaps "*This should work in any modern...*"
.. code-block:: sh
:emphasize-lines: 2
mimetype foo.blend
foo.blend: application/x-blender
Bill-Spitzak marked this conversation as resolved Outdated

The formatting makes it seem like this is another command, not an output from the previous command. You could put the prompt sign $ before every command, or write about the expected output here in text, out of the code-block, or something else. I'd favour the first option.

The formatting makes it seem like this is another command, not an output from the previous command. You could put the prompt sign `$` before every command, or write about the expected output here in text, out of the code-block, or something else. I'd favour the first option.
Alternative:
.. code-block:: sh
:emphasize-lines: 2
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
<?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 \
/usr/share/icons/'Pop/'scalable/mimetypes/application-x-blender.svg
sudo update-icon-caches /usr/share/icons/'Pop/'
**Make thumbnails work for .blend files**
Bill-Spitzak marked this conversation as resolved Outdated

Is this needed? Mine seem to have worked out-of-the-box.

Is this needed? Mine seem to have worked out-of-the-box.

I needed it but maybe you had something left over from a previous blender install, or it comes already setup on some systems? Also once a thumbnail is created it seems to stay around even if you remove the thumbnailing setup.

Probably should change the text to say "do this if thumbnails don't work".

I needed it but maybe you had something left over from a previous blender install, or it comes already setup on some systems? Also once a thumbnail is created it seems to stay around even if you remove the thumbnailing setup. Probably should change the text to say "do this if thumbnails don't work".
Put the following into ``/usr/share/thumbnailers/x-blender.thumbnailer``:
.. code-block:: ini
[Thumbnailer Entry]
TryExec=/usr/bin/blender-thumbnailer
Exec=/usr/bin/blender-thumbnailer %i %o
MimeType=application/x-blender;