From cfa8c9aa423ed728440141be0d5661e88a419e9c Mon Sep 17 00:00:00 2001 From: Bill Spitzak Date: Mon, 26 Feb 2024 14:55:23 -0800 Subject: [PATCH 1/2] Add instructions for installing Linux desktop icons and integration Note that these instructions are based on my own experiements and on searching the Gnome and freedesktop.org online instructions. I was unable to figure out any rule for placing icon files. These should be tested on other Linux versions and the instructions improved. However this is still a lot better than the instructions that existed previously. I also changed the recommended install location to /opt to avoid conflicts with packaged software. --- .gitignore | 1 + manual/getting_started/installing/index.rst | 1 + manual/getting_started/installing/linux.rst | 13 +-- .../installing/linux_freedesktop.rst | 109 ++++++++++++++++++ 4 files changed, 117 insertions(+), 7 deletions(-) create mode 100644 manual/getting_started/installing/linux_freedesktop.rst diff --git a/.gitignore b/.gitignore index 08a59fb10..a710d37db 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ # Editors +*~ .vscode/* # Python virtual environment diff --git a/manual/getting_started/installing/index.rst b/manual/getting_started/installing/index.rst index b96b02125..b5de8fb42 100644 --- a/manual/getting_started/installing/index.rst +++ b/manual/getting_started/installing/index.rst @@ -77,4 +77,5 @@ Follow the steps for your platform. .. toctree:: :hidden: + linux_freedesktop.rst linux_windowing_environment.rst diff --git a/manual/getting_started/installing/linux.rst b/manual/getting_started/installing/linux.rst index 33ce1b8c9..edb094db7 100644 --- a/manual/getting_started/installing/linux.rst +++ b/manual/getting_started/installing/linux.rst @@ -12,16 +12,15 @@ Install from blender.org ======================== Download the Linux version for your architecture and decompress the file to the desired location -(e.g. ``~/software`` or ``/usr/local``). +(e.g. ``/opt`` or ``~/software``). -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 `. -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 diff --git a/manual/getting_started/installing/linux_freedesktop.rst b/manual/getting_started/installing/linux_freedesktop.rst new file mode 100644 index 000000000..5f00c8d8d --- /dev/null +++ b/manual/getting_started/installing/linux_freedesktop.rst @@ -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. + +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 + 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 + +**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 + + 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/ + +**Check if the "mime type" exists** + + This may be true of any modern Linux install. + + .. code-block:: sh + :emphasize-lines: 2 + + mimetype foo.blend + foo.blend: application/x-blender + + 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 + + + + + Blender scene + + + + + + 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** + + 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; -- 2.30.2 From 585869313a6132e9d9763a6cc2276500e436fe6b Mon Sep 17 00:00:00 2001 From: Bill Spitzak Date: Sun, 3 Mar 2024 15:00:44 -0800 Subject: [PATCH 2/2] Address reviewer comments --- manual/getting_started/installing/index.rst | 2 +- manual/getting_started/installing/linux.rst | 4 +- ...edesktop.rst => linux_example_install.rst} | 55 +++++++++++-------- 3 files changed, 35 insertions(+), 26 deletions(-) rename manual/getting_started/installing/{linux_freedesktop.rst => linux_example_install.rst} (51%) diff --git a/manual/getting_started/installing/index.rst b/manual/getting_started/installing/index.rst index b5de8fb42..630fa61fc 100644 --- a/manual/getting_started/installing/index.rst +++ b/manual/getting_started/installing/index.rst @@ -77,5 +77,5 @@ Follow the steps for your platform. .. toctree:: :hidden: - linux_freedesktop.rst + linux_example_install.rst linux_windowing_environment.rst diff --git a/manual/getting_started/installing/linux.rst b/manual/getting_started/installing/linux.rst index edb094db7..550d1f7a2 100644 --- a/manual/getting_started/installing/linux.rst +++ b/manual/getting_started/installing/linux.rst @@ -12,12 +12,12 @@ Install from blender.org ======================== Download the Linux version for your architecture and decompress the file to the desired location -(e.g. ``/opt`` or ``~/software``). +(e.g. ``/opt`` or ``~/software`` or ``/usr/local``). Blender can now be launched by running the ``blender`` executable in the installed directory. Getting icons to work is somewhat tedious, but does not have to be redone when updating -blender versions. See :doc:`Installing freedesktop.org icons `. +blender versions. See :doc:`Linux Example Install `. When using this method of installation, it is possible to have multiple versions of Blender installed as they each have a different directory name. diff --git a/manual/getting_started/installing/linux_freedesktop.rst b/manual/getting_started/installing/linux_example_install.rst similarity index 51% rename from manual/getting_started/installing/linux_freedesktop.rst rename to manual/getting_started/installing/linux_example_install.rst index 5f00c8d8d..909a3b38c 100644 --- a/manual/getting_started/installing/linux_freedesktop.rst +++ b/manual/getting_started/installing/linux_example_install.rst @@ -1,33 +1,36 @@ ******************* -Installing freedesktop.org icons +Linux example install of downloaded Blender ******************* -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. +The following commands sucessfully installed the downloaded 4.0.2 version of Blender +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. -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``. +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 `__ +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 /opt + sudo mkdir -p /opt cd /opt - sudo tar -xf ~/Downloads/blender-'4.0.2-linux-x64'.tar.xz + 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 + sudo ln -sTf blender-4.0.2-linux-x64 /opt/blender -**Make running blender from the command line work** +**Make Blender commands work from the command line** .. code-block:: sh @@ -48,24 +51,24 @@ that directory instead of ``/opt`` and using ``~/.local`` instead of ``/usr``. .. code-block:: sh - sudo ln -s /opt/blender/blender.svg /usr/share/icons/'hicolor/'scalable/ + sudo ln -s /opt/blender/blender.svg /usr/share/icons/hicolor/scalable/apps/blender.svg + + Here you need to locate the correct directory for your Linux distribution. **Check if the "mime type" exists** - This may be true of any modern Linux install. + This should work on any modern Linux installation. - .. code-block:: sh - :emphasize-lines: 2 + .. code-block:: console - mimetype foo.blend + $ mimetype foo.blend foo.blend: application/x-blender Alternative: - .. code-block:: sh - :emphasize-lines: 2 + .. code-block:: console - grep blender /etc/mime.types + $ grep blender /etc/mime.types application/x-blender blend **Add the mimetype if missing** @@ -94,11 +97,17 @@ that directory instead of ``/opt`` and using ``~/.local`` instead of ``/usr``. .. 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/' + /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``: .. code-block:: ini -- 2.30.2