<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Tags/Thunar on paapereira.xyz</title><link>https://paapereira.xyz/tags/thunar/</link><description>Recent content in Tags/Thunar on paapereira.xyz</description><generator>Hugo</generator><language>en-US</language><copyright>&lt;a href='https://creativecommons.org/licenses/by-nc/4.0/' target='_blank' rel='noopener'>©&lt;/a> 2008-2026 / &lt;a href='https://gitlab.com/paapereira/paapereira.gitlab.io' target='_blank' rel='noopener'>source code&lt;/a></copyright><lastBuildDate>Tue, 13 Aug 2019 21:12:35 +0000</lastBuildDate><atom:link href="https://paapereira.xyz/tags/thunar/index.xml" rel="self" type="application/rss+xml"/><item><title>Folder thumbnails in Thunar</title><link>https://paapereira.xyz/posts/2019/08/folder-thumbnails-thunar/</link><pubDate>Tue, 13 Aug 2019 21:12:35 +0000</pubDate><guid>https://paapereira.xyz/posts/2019/08/folder-thumbnails-thunar/</guid><description>&lt;p>My favorite file manager is &lt;a href="https://docs.xfce.org/xfce/thunar/start">Thunar&lt;/a>, but it hasn’t folder thumbnails by default.&lt;/p>
&lt;p>Here’s how to enable it.&lt;/p>
&lt;ul>
&lt;li>Install tumbler and imagemagick&lt;/li>
&lt;/ul>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">1&lt;/span>&lt;span>yay -S tumbler imagemagick
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;ul>
&lt;li>Create the following a folder.thumbnailer file and add the following&lt;/li>
&lt;/ul>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">1&lt;/span>&lt;span>sudo vi /usr/share/thumbnailers/folder.thumbnailer
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-text" data-lang="text">&lt;span style="display:flex;">&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">1&lt;/span>&lt;span>[Thumbnailer Entry]
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">2&lt;/span>&lt;span>Version=1.0
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">3&lt;/span>&lt;span>Encoding=UTF-8
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">4&lt;/span>&lt;span>Type=X-Thumbnailer
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">5&lt;/span>&lt;span>Name=Folder Thumbnailer
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">6&lt;/span>&lt;span>MimeType=inode/directory;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">7&lt;/span>&lt;span>Exec=/usr/bin/folder-thumbnailer %s %i %o %u
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;ul>
&lt;li>Create the folder-thumbnailer script&lt;/li>
&lt;/ul>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">1&lt;/span>&lt;span>sudo vi /usr/bin/folder-thumbnailer
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-text" data-lang="text">&lt;span style="display:flex;">&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 1&lt;/span>&lt;span>#!/bin/bash
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 2&lt;/span>&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 3&lt;/span>&lt;span>convert -thumbnail &amp;#34;$1&amp;#34; &amp;#34;$2/folder.jpg&amp;#34; &amp;#34;$3&amp;#34; 1&amp;gt;/dev/null 2&amp;gt;&amp;amp;1 ||\
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 4&lt;/span>&lt;span>convert -thumbnail &amp;#34;$1&amp;#34; &amp;#34;$2/.folder.jpg&amp;#34; &amp;#34;$3&amp;#34; 1&amp;gt;/dev/null 2&amp;gt;&amp;amp;1 ||\
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 5&lt;/span>&lt;span>convert -thumbnail &amp;#34;$1&amp;#34; &amp;#34;$2/folder.png&amp;#34; &amp;#34;$3&amp;#34; 1&amp;gt;/dev/null 2&amp;gt;&amp;amp;1 ||\
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 6&lt;/span>&lt;span>convert -thumbnail &amp;#34;$1&amp;#34; &amp;#34;$2/cover.jpg&amp;#34; &amp;#34;$3&amp;#34; 1&amp;gt;/dev/null 2&amp;gt;&amp;amp;1 ||\
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 7&lt;/span>&lt;span>rm -f &amp;#34;$HOME/.cache/thumbnails/normal/$(echo -n &amp;#34;$4&amp;#34; | md5sum | cut -d &amp;#34; &amp;#34; -f1).png&amp;#34; ||\
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 8&lt;/span>&lt;span>rm -f &amp;#34;$HOME/.thumbnails/normal/$(echo -n &amp;#34;$4&amp;#34; | md5sum | cut -d &amp;#34; &amp;#34; -f1).png&amp;#34; ||\
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 9&lt;/span>&lt;span>rm -f &amp;#34;$HOME/.cache/thumbnails/large/$(echo -n &amp;#34;$4&amp;#34; | md5sum | cut -d &amp;#34; &amp;#34; -f1).png&amp;#34; ||\
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">10&lt;/span>&lt;span>rm -f &amp;#34;$HOME/.thumbnails/large/$(echo -n &amp;#34;$4&amp;#34; | md5sum | cut -d &amp;#34; &amp;#34; -f1).png&amp;#34; ||\
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">11&lt;/span>&lt;span>exit 1
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">1&lt;/span>&lt;span>sudo chmod +x /usr/bin/folder-thumbnailer
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>To add a thumbnail to a folder you just need to add a &lt;code>.folder.jpg&lt;/code> file and your set. You can decide to use different names in the &lt;code>/usr/bin/folder-thumbnailer&lt;/code> script.&lt;/p></description></item></channel></rss>