<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>My Take on Tech</title>
    <description>A place where I document my findings as an advanced user and as a developer.</description>
    <link>/</link>
    <atom:link href="/feed.xml" rel="self" type="application/rss+xml"/>
    <pubDate>Mon, 28 Jun 2021 00:30:08 +0000</pubDate>
    <lastBuildDate>Mon, 28 Jun 2021 00:30:08 +0000</lastBuildDate>
    <generator>Jekyll v3.8.5</generator>
    
      <item>
        <title>Fix Docker cgroup errors after systemd 248 update</title>
        <description>&lt;p&gt;I’m running multiple Docker containers such as Pi-Hole on an &lt;a href=&quot;https://wiki.odroid.com/odroid-xu4/odroid-xu4&quot;&gt;Odroid XU4&lt;/a&gt; with &lt;a href=&quot;https://archlinuxarm.org&quot;&gt;Arch Linux ARM&lt;/a&gt;.  &lt;br /&gt;
After updating to Systemd version 248 last month, I noticed that all my Docker containers started throwing an error:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;ERROR: for &amp;lt;container name&amp;gt;  Cannot start service &amp;lt;container name&amp;gt;: failed to create shim: OCI runtime create failed: container_linux.go:367: starting container process caused: process_linux.go:495: container init caused: process_linux.go:458: setting cgroup config for procHooks process caused: can't load program: invalid argument: unknown
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;!--more--&gt;

&lt;p&gt;After &lt;a href=&quot;https://medium.com/nttlabs/cgroup-v2-596d035be4d7&quot;&gt;some reading&lt;/a&gt;, I discovered that with Systemd 248 cgroup v2 became the default and all containers that do not yet support it, will fail to load.  &lt;br /&gt;
I wasn’t the only one, as other people on the Arch Linux ARM forums also &lt;a href=&quot;https://archlinuxarm.org/forum/viewtopic.php?t=15289&quot;&gt;complained about a similar issue&lt;/a&gt;.&lt;br /&gt;
&lt;a href=&quot;https://medium.com/nttlabs/cgroup-v2-596d035be4d7&quot;&gt;This article&lt;/a&gt; explains in great details all about it, but what I was actually interested in was getting my Docker containers back and running.&lt;/p&gt;

&lt;p&gt;Both that article and the &lt;a href=&quot;https://man7.org/linux/man-pages/man1/systemd.1.html#KERNEL_COMMAND_LINE&quot;&gt;Systemd man&lt;/a&gt; page mention the kernel command line (also known as “kernel parameter”) &lt;code class=&quot;highlighter-rouge&quot;&gt;systemd.unified_cgroup_hierarchy&lt;/code&gt;.  &lt;br /&gt;
Quite naively, I thought to myself that running &lt;code class=&quot;highlighter-rouge&quot;&gt;sysctl systemd.unified_cgroup_hierarchy=0&lt;/code&gt; would let me disable it at runtime to test that it actually fixes the problem.&lt;br /&gt;
However, I quickly realized this wasn’t that easy:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;sysctl systemd.unified_cgroup_hierarchy&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;0
sysctl: cannot &lt;span class=&quot;nb&quot;&gt;stat&lt;/span&gt; /proc/sys/systemd/unified_cgroup_hierarchy: No such file or directory
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href=&quot;https://www.reddit.com/r/archlinux/comments/n6npzd/setting_systemd_kernel_params_at_runtime&quot;&gt;Asking around on Reddit&lt;/a&gt; I learned that there are parameters that cannot be set at runtime, and this was one of them.  &lt;br /&gt;
Oh well… I try as hard as I can to avoid messing with my cmdline (references &lt;a href=&quot;https://www.kernel.org/doc/html/v4.14/admin-guide/kernel-parameters.html&quot;&gt;here&lt;/a&gt; and &lt;a href=&quot;https://www.freedesktop.org/software/systemd/man/kernel-command-line.html&quot;&gt;here&lt;/a&gt;), but I went ahead and changed it.&lt;/p&gt;

&lt;p&gt;Every bootloader has &lt;a href=&quot;https://wiki.archlinux.org/title/Kernel_parameters&quot;&gt;a different way of setting its cmdline&lt;/a&gt;.  &lt;br /&gt;
The Odroid XU4 uses &lt;a href=&quot;https://github.com/u-boot/u-boot&quot;&gt;uboot&lt;/a&gt;, so I had to edit &lt;code class=&quot;highlighter-rouge&quot;&gt;/boot/boot.txt&lt;/code&gt;:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;setenv bootargs &lt;span class=&quot;s2&quot;&gt;&quot;... systemd.unified_cgroup_hierarchy=0&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Then, I had to run the &lt;code class=&quot;highlighter-rouge&quot;&gt;mkscr&lt;/code&gt; script in &lt;code class=&quot;highlighter-rouge&quot;&gt;/boot&lt;/code&gt;, only to find out that I’m missing the &lt;code class=&quot;highlighter-rouge&quot;&gt;uboot-tools&lt;/code&gt; package:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;./mkscr
mkimage not found. Please &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;uboot-tools:
  pacman &lt;span class=&quot;nt&quot;&gt;-S&lt;/span&gt; uboot-tools
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Installing it and rebooting, I could confirm that the parameter was correctly set:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cat&lt;/span&gt; /proc/cmdline
... systemd.unified_cgroup_hierarchy&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I ran Docker and… Success!&lt;/p&gt;

</description>
        <pubDate>Fri, 07 May 2021 13:21:00 +0000</pubDate>
        <link>/2021/05/07/fix-docker-cgroup-errors-after-systemd-248-update/</link>
        <guid isPermaLink="true">/2021/05/07/fix-docker-cgroup-errors-after-systemd-248-update/</guid>
        
        <category>Linux</category>
        
        <category>Systemd</category>
        
        <category>Docker</category>
        
        <category>Odroid</category>
        
        <category>Arch</category>
        
        
      </item>
    
      <item>
        <title>Some Tricks For sxhkd (and bspwm)</title>
        <description>&lt;p&gt;I love keyboard-based interfaces.&lt;br /&gt;
That’s why, pretty soon after publishing &lt;a href=&quot;/2018/05/17/my-linux-kde-setup/&quot;&gt;this post&lt;/a&gt;, I moved to using a tiling window manager, and never looked back.  &lt;br /&gt;
I chose &lt;a href=&quot;https://github.com/baskerville/bspwm&quot;&gt;bspwm&lt;/a&gt; for various reasons I won’t go into in this post, but one of the strong points that I see in its design is that it does only one thing - manage windows. The other stuff (namely, managing system key bindings) it leaves for other tools to do.  &lt;br /&gt;
To complement bspwm’s “missing feature”, the developer created another tool, &lt;a href=&quot;https://github.com/baskerville/sxhkd&quot;&gt;sxhkd&lt;/a&gt;, which helps managing key bindings on any Linux system, but works especially well with bspwm (of course).  &lt;br /&gt;
There are tones of articles on how to set up bspwm with sxhkd, so I won’t go into basic configuration here. Instead, I want to share some snippets of my configuration, that may help inspire people, or even convince them to switch to bspwm+sxhkd.&lt;/p&gt;

&lt;!--more--&gt;

&lt;p&gt;Some of the snippets I wrote myself, while some I found online. For the latter I’ll add a link to the author’s snippet.&lt;br /&gt;
One last thing: most of the snippets involve around bspwm, but some are not, so I hope that even users of other window managers will find them useful.&lt;/p&gt;

&lt;nav class=&quot;toc&quot;&gt;
  &lt;h4&gt;Quick Navigation&lt;/h4&gt;
&lt;ul id=&quot;markdown-toc&quot;&gt;
  &lt;li&gt;&lt;a href=&quot;#bspwm&quot; id=&quot;markdown-toc-bspwm&quot;&gt;bspwm&lt;/a&gt;    &lt;ul&gt;
      &lt;li&gt;&lt;a href=&quot;#easily-order-windows&quot; id=&quot;markdown-toc-easily-order-windows&quot;&gt;Easily order windows&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#rotating-windows-tree&quot; id=&quot;markdown-toc-rotating-windows-tree&quot;&gt;Rotating windows tree&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#move-window-to-a-workspace--switch-to-it&quot; id=&quot;markdown-toc-move-window-to-a-workspace--switch-to-it&quot;&gt;Move window to a workspace &amp;amp; switch to it&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#expanding-and-contracting-windows&quot; id=&quot;markdown-toc-expanding-and-contracting-windows&quot;&gt;Expanding and contracting windows&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#my-take-on-creating-a-scratchpad&quot; id=&quot;markdown-toc-my-take-on-creating-a-scratchpad&quot;&gt;My take on creating a scratchpad&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#other-stuff&quot; id=&quot;markdown-toc-other-stuff&quot;&gt;Other stuff&lt;/a&gt;    &lt;ul&gt;
      &lt;li&gt;&lt;a href=&quot;#show-a-help-menu-using-rofi&quot; id=&quot;markdown-toc-show-a-help-menu-using-rofi&quot;&gt;Show a help menu using rofi&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#reloading-sxhkdrc&quot; id=&quot;markdown-toc-reloading-sxhkdrc&quot;&gt;Reloading sxhkdrc&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#access-clipmenu-via-rofi&quot; id=&quot;markdown-toc-access-clipmenu-via-rofi&quot;&gt;Access clipmenu via rofi&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#generate-a-random-password-to-clipboard&quot; id=&quot;markdown-toc-generate-a-random-password-to-clipboard&quot;&gt;Generate a random password to clipboard&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#change-to-a-random-wallpaper&quot; id=&quot;markdown-toc-change-to-a-random-wallpaper&quot;&gt;Change to a random wallpaper&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#closelock-screen&quot; id=&quot;markdown-toc-closelock-screen&quot;&gt;Close/lock screen&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#mimic-chrome-os-shortcuts&quot; id=&quot;markdown-toc-mimic-chrome-os-shortcuts&quot;&gt;Mimic Chrome OS shortcuts&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#extra-organizing-and-running-sxhkd&quot; id=&quot;markdown-toc-extra-organizing-and-running-sxhkd&quot;&gt;Extra: Organizing and running sxhkd&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;/nav&gt;

&lt;h3 id=&quot;bspwm&quot;&gt;bspwm&lt;/h3&gt;

&lt;h4 id=&quot;easily-order-windows&quot;&gt;Easily order windows&lt;/h4&gt;

&lt;p&gt;&lt;img src=&quot;/img/sxhkd-01.png&quot; alt=&quot;Ordering windows&quot; class=&quot;gif&quot; data-mode=&quot;video&quot; /&gt;&lt;/p&gt;

&lt;p&gt;bspwm has this Fibonacci-style window opening order, where new windows get smaller and smaller.&lt;br /&gt;
Sometimes, people want to manually reorder windows to something like a grid of four windows. However, the common way of doing that is quite cumbersome where each step has its own separate keybinding:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Preselect a space for the new window.&lt;/li&gt;
  &lt;li&gt;Go to another window and mark it.&lt;/li&gt;
  &lt;li&gt;Move the marked window to the preselected space.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I found myself always doing step 2 and 3 without thinking too much, so I thought why not have a dedicated binding just for doing that.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# Move current window to a pre-selected space&lt;/span&gt;
super + &lt;span class=&quot;nb&quot;&gt;shift&lt;/span&gt; + m
    bspc node &lt;span class=&quot;nt&quot;&gt;-n&lt;/span&gt; last.!automatic
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;m&lt;/code&gt; for &lt;strong&gt;M&lt;/strong&gt;ove&lt;/p&gt;

&lt;p&gt;Thanks to &lt;a href=&quot;https://www.reddit.com/user/SataMaxx&quot;&gt;u/SataMaxx&lt;/a&gt; who pointed out to me &lt;a href=&quot;https://www.reddit.com/r/bspwm/comments/hksei7/some_less_common_tips_tricks_for_sxhkd_and_bspwm/fwuu422&quot;&gt;on Reddit&lt;/a&gt; that the original snippet introduced here was inefficient, and suggested a better one.&lt;/p&gt;

&lt;h4 id=&quot;rotating-windows-tree&quot;&gt;Rotating windows tree&lt;/h4&gt;

&lt;p&gt;&lt;img src=&quot;/img/sxhkd-02.png&quot; alt=&quot;Rotating windows&quot; class=&quot;gif&quot; data-mode=&quot;video&quot; /&gt;&lt;/p&gt;

&lt;p&gt;I came up with this little trick as a result of a question asked not too long ago &lt;a href=&quot;https://www.reddit.com/r/bspwm/comments/gz0pac/bspwm_rotating_and_flipping_understanding_of_the&quot;&gt;on Reddit&lt;/a&gt;.&lt;br /&gt;
It basically rotates the order of the windows on a single workspace clockwise/counterclockwise.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# Rotate tree&lt;/span&gt;
super + &lt;span class=&quot;nb&quot;&gt;shift&lt;/span&gt; + &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;d,a&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
    bspc node @/ &lt;span class=&quot;nt&quot;&gt;-C&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;forward,backward&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;a&lt;/code&gt;/&lt;code class=&quot;highlighter-rouge&quot;&gt;d&lt;/code&gt; do not have a special meaning, just easy right/left to do with one hand&lt;/p&gt;

&lt;h4 id=&quot;move-window-to-a-workspace--switch-to-it&quot;&gt;Move window to a workspace &amp;amp; switch to it&lt;/h4&gt;

&lt;p&gt;Arguably the most trivial thing to do with a window manager, but in bspwm it was quite a hassle to figure out. &lt;del&gt;Fortunately, &lt;a href=&quot;https://www.reddit.com/r/bspwm/comments/6jj6le/move_window_to_workspace_and_then_switch_to_that&quot;&gt;someone on Reddit&lt;/a&gt; did it already.&lt;/del&gt; Read below for an update.&lt;br /&gt;
I also added another binding of my own to send current window to the last used monitor. Note that this means that the monitor has to be “active” first before this works.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# Send to desktop&lt;/span&gt;
super + &lt;span class=&quot;nb&quot;&gt;shift&lt;/span&gt; + &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;1-9,0&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
    bspc node &lt;span class=&quot;nt&quot;&gt;-d&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'^{1-9,10}'&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--follow&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# Send to monitor&lt;/span&gt;
super + &lt;span class=&quot;nb&quot;&gt;shift&lt;/span&gt; + equal
    bspc node &lt;span class=&quot;nt&quot;&gt;-m&lt;/span&gt; last &lt;span class=&quot;nt&quot;&gt;--follow&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Thanks to &lt;a href=&quot;https://www.reddit.com/user/altercharlie&quot;&gt;u/altercharlie&lt;/a&gt; for pointing out &lt;a href=&quot;https://www.reddit.com/r/bspwm/comments/hksei7/some_less_common_tips_tricks_for_sxhkd_and_bspwm/fwv219q&quot;&gt;on Reddit&lt;/a&gt; that the original first snippet here was way too complicated, and suggested the use of &lt;code class=&quot;highlighter-rouge&quot;&gt;--follow&lt;/code&gt; instead.&lt;/p&gt;

&lt;h4 id=&quot;expanding-and-contracting-windows&quot;&gt;Expanding and contracting windows&lt;/h4&gt;

&lt;p&gt;&lt;img src=&quot;/img/sxhkd-03.png&quot; alt=&quot;Expanding/contracting windows&quot; class=&quot;gif&quot; data-mode=&quot;video&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Another one of those trivial tasks that are somewhat annoying to figure out how to do.&lt;br /&gt;
I came across a limitation of sxhkd here, where there are two sets of outputs for each key (one is a fallback, for when the other doesn’t work). Because of that, I had to resort to a not-so-elegant solution, but I found this trick to be working quite reliably for me.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# Expand/contract a window by moving one of its side outward/inward&lt;/span&gt;
super + s : &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;h,j,k,l&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;nv&quot;&gt;STEP&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;20&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;SELECTION&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;={&lt;/span&gt;1,2,3,4&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    bspc node &lt;span class=&quot;nt&quot;&gt;-z&lt;/span&gt; &lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;left -&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$STEP&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; 0,bottom 0 &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$STEP&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;,top 0 -&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$STEP&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;,right &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$STEP&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; 0&quot;&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;cut&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-d&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;','&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-f&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$SELECTION&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;||&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    bspc node &lt;span class=&quot;nt&quot;&gt;-z&lt;/span&gt; &lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;right -&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$STEP&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; 0,top 0 &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$STEP&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;,bottom 0 -&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$STEP&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;,left &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$STEP&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; 0&quot;&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;cut&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-d&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;','&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-f&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$SELECTION&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Pressing &lt;code class=&quot;highlighter-rouge&quot;&gt;super+s&lt;/code&gt; gets us into “resize mode” which is done via Vim-keys.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Sometimes it’s easy to forget to exit this “resize mode” and system would seem unresponsive, with hjkl keys not registering. Always remember to hit &lt;code class=&quot;highlighter-rouge&quot;&gt;Esc&lt;/code&gt; when finishing.&lt;/p&gt;

&lt;h4 id=&quot;my-take-on-creating-a-scratchpad&quot;&gt;My take on creating a scratchpad&lt;/h4&gt;

&lt;p&gt;First, I have to admit that this one is going &lt;em&gt;a little bit&lt;/em&gt; off track, since we’re discussing sxhkd, but I just had to include it here since I use it a lot on my sxhkdrc.&lt;br /&gt;
For those who don’t know, scratchpad is a feature that first debuted in the &lt;a href=&quot;https://i3wm.org/docs/userguide.html#_scratchpad&quot;&gt;i3 window manager&lt;/a&gt; (afaik). It allows sending any window to an “invisible workspace” and quickly retrieve it whenever needed. For example, I use Telegram all the time, so instead of having it on a single workspace I have to navigate to each time, I can quickly show or hide it with a single keystroke.&lt;br /&gt;
My approach to this mimics i3’s functionality (inspired by &lt;a href=&quot;https://www.reddit.com/r/bspwm/comments/85hr4c/making_a_scratchpaddropdown_terminal_in_bspwm&quot;&gt;this thread&lt;/a&gt; on Reddit), but while i3 allows only one program at a time to be sent to the scratchpad, I wanted to have infinite.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Usage: bspwm-toggle-visibility process_name &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;executable_name] &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;--take-first&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;
    process_name       As recognized by &lt;span class=&quot;s1&quot;&gt;'xdo'&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;command
    &lt;/span&gt;executable_name    As used &lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;launching from terminal
    &lt;span class=&quot;nt&quot;&gt;--take-first&lt;/span&gt;       In &lt;span class=&quot;k&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'xdo'&lt;/span&gt; returns multiple process IDs
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;In short, my script takes a process name (which is a class name or instance name, obtainable by &lt;code class=&quot;highlighter-rouge&quot;&gt;xprop&lt;/code&gt;) and searches for it. Then, it applies a rule based on its status:&lt;/p&gt;

&lt;table class=&quot;short-table&quot;&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Status&lt;/th&gt;
      &lt;th&gt;Rule&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Non-existent&lt;/td&gt;
      &lt;td&gt;Launch&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Visible&lt;/td&gt;
      &lt;td&gt;Hide&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Hidden&lt;/td&gt;
      &lt;td&gt;Show&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;Sometimes a process name will differ from its executable, so there’s also an option to specify an executable name.&lt;br /&gt;
Also, some programs will spawn multiple instances, while only the first one actually matters, so I implemented a &lt;code class=&quot;highlighter-rouge&quot;&gt;--take-first&lt;/code&gt; switcher to apply the show/hide only on the first instance of that program.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;#!/bin/bash&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$# &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; 0 &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;then
    &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cat&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;EOF&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;
Usage: &lt;/span&gt;&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;basename&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt; process_name [executable_name] [--take-first]
    process_name       As recognized by 'xdo' command
    executable_name    As used for launching from terminal
    --take-first       In case 'xdo' returns multiple process IDs
&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;EOF
&lt;/span&gt;    &lt;span class=&quot;nb&quot;&gt;exit &lt;/span&gt;0
&lt;span class=&quot;k&quot;&gt;fi&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# Get id of process by class name and then fallback to instance name&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;xdo &lt;span class=&quot;nb&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-N&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;||&lt;/span&gt; xdo &lt;span class=&quot;nb&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-n&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;nv&quot;&gt;executable&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;shift

&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;while&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-n&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do
    case&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;in&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--take-first&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;nb&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;head&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-1&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;cut&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-f1&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-d&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;' '&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;;;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;nv&quot;&gt;executable&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;;;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;esac&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;shift
&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;done

if&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-z&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;then&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;executable&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;else
    while &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;read&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-r&lt;/span&gt; instance&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do
        &lt;/span&gt;bspc node &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;instance&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--flag&lt;/span&gt; hidden &lt;span class=&quot;nt&quot;&gt;--to-monitor&lt;/span&gt; focused &lt;span class=&quot;nt&quot;&gt;--focus&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;done&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;fi&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;&lt;small&gt;→ Requires &lt;a href=&quot;https://github.com/baskerville/xdo&quot;&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;xdo&lt;/code&gt;&lt;/a&gt; for searching windows’ PIDs. (can be replaced by &lt;a href=&quot;https://github.com/jordansissel/xdotool&quot;&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;xdotool&lt;/code&gt;&lt;/a&gt; if necessary)&lt;/small&gt;&lt;/p&gt;

&lt;p&gt;I named this script &lt;code class=&quot;highlighter-rouge&quot;&gt;bspwm-toggle-visibility&lt;/code&gt; and here are some examples of how I use it with sxhkd:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# Toggle Telegram&lt;/span&gt;
alt + c
    bspwm-toggle-visibility TelegramDesktop telegram-desktop

&lt;span class=&quot;c&quot;&gt;# Toggle Tagaini Jisho&lt;/span&gt;
super + r &lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; t
    bspwm-toggle-visibility tagainijisho &lt;span class=&quot;nt&quot;&gt;--take-first&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# Toggle Ptpython&lt;/span&gt;
super + r &lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; p
    bspwm-toggle-visibility floating_ptpython &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$TERMCMD&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; --class floating_ptpython ptpython&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;other-stuff&quot;&gt;Other stuff&lt;/h3&gt;

&lt;h4 id=&quot;show-a-help-menu-using-rofi&quot;&gt;Show a help menu using rofi&lt;/h4&gt;

&lt;p&gt;&lt;img src=&quot;/img/sxhkd-04.png&quot; alt=&quot;sxhkd help menu using rofi&quot; class=&quot;gif&quot; data-mode=&quot;video&quot; /&gt;&lt;/p&gt;

&lt;p&gt;This trick comes in super handy in the beginning, and then when needing to quickly hint rarely-used key strokes.  &lt;br /&gt;
Its &lt;a href=&quot;https://www.reddit.com/r/bspwm/comments/aejyze/tip_show_sxhkd_keybindings_with_fuzzy_search&quot;&gt;original author&lt;/a&gt; used &lt;a href=&quot;https://github.com/junegunn/fzf&quot;&gt;fzf&lt;/a&gt; with a floating terminal, but I use it with &lt;a href=&quot;https://github.com/davatorium/rofi&quot;&gt;rofi&lt;/a&gt;, which I think is slightly more convenient.  &lt;br /&gt;
I also included a small change (pun intended) to make more text fit in the rofi window. This, of course, can be changed.  &lt;br /&gt;
Unlike other tricks, this trick must be included in a separate &lt;strong&gt;bash&lt;/strong&gt; script. I have it in a file called &lt;code class=&quot;highlighter-rouge&quot;&gt;sxhkd-help&lt;/code&gt; which is inside my &lt;code class=&quot;highlighter-rouge&quot;&gt;PATH&lt;/code&gt;, but it can also be called using a full path (like &lt;code class=&quot;highlighter-rouge&quot;&gt;~/scripts/sxhkd-help&lt;/code&gt;).&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;#!/bin/bash&lt;/span&gt;

&lt;span class=&quot;nb&quot;&gt;awk&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'/^[a-z]/ &amp;amp;&amp;amp; last {print &quot;&amp;lt;small&amp;gt;&quot;,$0,&quot;\t&quot;,last,&quot;&amp;lt;/small&amp;gt;&quot;} {last=&quot;&quot;} /^#/{last=$0}'&lt;/span&gt; ~/.config/sxhkd/sxhkdrc&lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;,.common&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt; |
    column &lt;span class=&quot;nt&quot;&gt;-t&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-s&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;$'&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\t&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'&lt;/span&gt; |
    rofi &lt;span class=&quot;nt&quot;&gt;-dmenu&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-i&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-markup-rows&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-no-show-icons&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-width&lt;/span&gt; 1000 &lt;span class=&quot;nt&quot;&gt;-lines&lt;/span&gt; 15 &lt;span class=&quot;nt&quot;&gt;-yoffset&lt;/span&gt; 40
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; In my case, sxhkd config files are split across two separate files, so I’m using them both (&lt;code class=&quot;highlighter-rouge&quot;&gt;sxhkdrc&lt;/code&gt; and &lt;code class=&quot;highlighter-rouge&quot;&gt;sxhkdrc.common&lt;/code&gt;). More on that &lt;a href=&quot;#extra-organizing-and-running-sxhkd&quot;&gt;in the extra section&lt;/a&gt;.&lt;br /&gt;
&lt;strong&gt;Note_2:&lt;/strong&gt; rofi options are unique to my setup.&lt;/p&gt;

&lt;p&gt;And inside &lt;code class=&quot;highlighter-rouge&quot;&gt;sxhkdrc&lt;/code&gt;:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# Show help&lt;/span&gt;
super + slash
    sxhkd-help
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;&lt;small&gt;→ Requires &lt;a href=&quot;https://github.com/davatorium/rofi&quot;&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;rofi&lt;/code&gt;&lt;/a&gt;&lt;/small&gt;&lt;/p&gt;

&lt;p&gt;This binding makes sense because on qwerty keyboards, slash (&lt;code class=&quot;highlighter-rouge&quot;&gt;/&lt;/code&gt;) is also the same key as question mark (&lt;code class=&quot;highlighter-rouge&quot;&gt;?&lt;/code&gt;).&lt;/p&gt;

&lt;h4 id=&quot;reloading-sxhkdrc&quot;&gt;Reloading sxhkdrc&lt;/h4&gt;

&lt;p&gt;This is just classic stuff, reloading sxhkd using sxhkd. Useful after making changes to sxhkdrc.&lt;br /&gt;
However, I remember seeing some weird techniques out there, while sxhkd has this built-in.&lt;br /&gt;
Here’s the relevant excerpt from sxhkd(1):&lt;/p&gt;
&lt;blockquote&gt;
  &lt;p&gt;If sxhkd receives a SIGUSR1 (resp. SIGUSR2) signal, it will reload its configuration file (resp. toggle the grabbing state of all its bindings).&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So all we need to do to reload sxhkdrc is send sxhkd a SIGUSR1 signal, and why not throw in a nice little notification on the way? ;)&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# Reload sxhkdrc&lt;/span&gt;
super + &lt;span class=&quot;nb&quot;&gt;shift&lt;/span&gt; + r
    pkill &lt;span class=&quot;nt&quot;&gt;-usr1&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-x&lt;/span&gt; sxhkd&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; notify-send &lt;span class=&quot;s1&quot;&gt;'sxhkd'&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'Reloaded config'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;&lt;small&gt;→ Requires libnotify (for &lt;code class=&quot;highlighter-rouge&quot;&gt;notify-send&lt;/code&gt;)&lt;/small&gt;&lt;/p&gt;

&lt;h4 id=&quot;access-clipmenu-via-rofi&quot;&gt;Access clipmenu via rofi&lt;/h4&gt;

&lt;p&gt;&lt;img src=&quot;/img/sxhkd-05.png&quot; alt=&quot;clipmenu with rofi&quot; class=&quot;gif&quot; data-mode=&quot;video&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/cdown/clipmenu&quot;&gt;clipmenu&lt;/a&gt; is an awesome clipboard manager that also integrates with &lt;a href=&quot;https://github.com/davatorium/rofi&quot;&gt;rofi&lt;/a&gt;. I use it to create a small clipboard history menu at cursor position.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# Show clipmenu&lt;/span&gt;
alt + v
    &lt;span class=&quot;nv&quot;&gt;CM_LAUNCHER&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;rofi clipmenu &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
        &lt;span class=&quot;nt&quot;&gt;-location&lt;/span&gt; 1 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
        &lt;span class=&quot;nt&quot;&gt;-m&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-3&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
        &lt;span class=&quot;nt&quot;&gt;-no-show-icons&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
        &lt;span class=&quot;nt&quot;&gt;-theme-str&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'* \{ font: 10px; \}'&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
        &lt;span class=&quot;nt&quot;&gt;-theme-str&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'listview \{ spacing: 0; \}'&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
        &lt;span class=&quot;nt&quot;&gt;-theme-str&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'window \{ width: 20em; \}'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;&lt;small&gt;→ Requires &lt;a href=&quot;https://github.com/cdown/clipmenu&quot;&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;clipmenu&lt;/code&gt;&lt;/a&gt;&lt;/small&gt;&lt;/p&gt;

&lt;h4 id=&quot;generate-a-random-password-to-clipboard&quot;&gt;Generate a random password to clipboard&lt;/h4&gt;

&lt;p&gt;This one is more of a shell trick (and I do have it as a shell alias as well), but it’s very handy to also have the ability to generate a random password just by hitting some keystrokes and then pasting them into wherever.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# Generate password&lt;/span&gt;
super + r &lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; g &lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; p
    &lt;span class=&quot;nb&quot;&gt;tr&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-dc&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;a-zA-Z0-9_#@.-&quot;&lt;/span&gt; &amp;lt; /dev/urandom | &lt;span class=&quot;nb&quot;&gt;head&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-c&lt;/span&gt; 14 | xclip &lt;span class=&quot;nt&quot;&gt;-selection&lt;/span&gt; clipboard
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;&lt;small&gt;Requires &lt;code class=&quot;highlighter-rouge&quot;&gt;xclip&lt;/code&gt; (for interfacing with system clipboard)&lt;/small&gt;&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;g ; p&lt;/code&gt; for &lt;strong&gt;G&lt;/strong&gt;enerate &lt;strong&gt;P&lt;/strong&gt;assword&lt;/p&gt;

&lt;h4 id=&quot;change-to-a-random-wallpaper&quot;&gt;Change to a random wallpaper&lt;/h4&gt;

&lt;p&gt;&lt;img src=&quot;/img/sxhkd-06.png&quot; alt=&quot;changing wallpapers&quot; class=&quot;gif&quot; data-mode=&quot;video&quot; /&gt;&lt;/p&gt;

&lt;p&gt;I’m exporting my wallpapers location at &lt;code class=&quot;highlighter-rouge&quot;&gt;~/.wallpapers&lt;/code&gt; inside my &lt;code class=&quot;highlighter-rouge&quot;&gt;.xprofile&lt;/code&gt;:&lt;code class=&quot;highlighter-rouge&quot;&gt;export WALLPAPERS=&quot;$HOME&quot;/.wallpapers&lt;/code&gt;.&lt;br /&gt;
Then, I choose a random file from this directory, and set it as a wallpaper.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# Change wallpaper&lt;/span&gt;
super + r &lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; c &lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; b
    &lt;span class=&quot;nv&quot;&gt;RAND&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;find &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$WALLPAPERS&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-xtype&lt;/span&gt; f | &lt;span class=&quot;nb&quot;&gt;sort&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-R&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;head&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-1&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
        xwallpaper &lt;span class=&quot;nt&quot;&gt;--zoom&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$WALLPAPERS&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$RAND&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;&lt;small&gt;→ Requires &lt;a href=&quot;https://github.com/stoeckmann/xwallpaper&quot;&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;xwallpaper&lt;/code&gt;&lt;/a&gt; (for setting up image files as wallpaper on Xorg)&lt;/small&gt;&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;c ; b&lt;/code&gt; for &lt;strong&gt;C&lt;/strong&gt;hange &lt;strong&gt;B&lt;/strong&gt;ackground&lt;/p&gt;

&lt;p&gt;The same can be done to the lockscreen wallpaper, but depends on the particular setup.&lt;br /&gt;
I use &lt;a href=&quot;https://github.com/pavanjadhaw/betterlockscreen&quot;&gt;betterlockscreen&lt;/a&gt; and since it can take quite a while to process the given image, I added a notification at the end.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# Change lock screen wallpaper&lt;/span&gt;
super + r &lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; c &lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; l
    betterlockscreen &lt;span class=&quot;nt&quot;&gt;-u&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$WALLPAPERS&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    notify-send &lt;span class=&quot;s1&quot;&gt;'betterlockscreen'&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'Changed background'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;&lt;small&gt;→ Requires &lt;a href=&quot;https://github.com/pavanjadhaw/betterlockscreen&quot;&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;betterlockscreen&lt;/code&gt;&lt;/a&gt; &amp;amp; libnotify (for &lt;code class=&quot;highlighter-rouge&quot;&gt;notify-send&lt;/code&gt;)&lt;/small&gt;&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;c ; l&lt;/code&gt; for &lt;strong&gt;C&lt;/strong&gt;hange &lt;strong&gt;L&lt;/strong&gt;ockscreen&lt;/p&gt;

&lt;h4 id=&quot;closelock-screen&quot;&gt;Close/lock screen&lt;/h4&gt;

&lt;p&gt;Closing the screen just makes the display go blank, while locking it actually brings up the lock screen (&lt;a href=&quot;https://github.com/pavanjadhaw/betterlockscreen&quot;&gt;betterlockscreen&lt;/a&gt; in my case).&lt;br /&gt;
Extremely important at work - locking up the screen when leaving desk.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# Close screen&lt;/span&gt;
super + &lt;span class=&quot;nb&quot;&gt;shift&lt;/span&gt; + c
    &lt;span class=&quot;nb&quot;&gt;sleep &lt;/span&gt;0.5&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; xset dpms force standby

&lt;span class=&quot;c&quot;&gt;# Lock screen&lt;/span&gt;
super + &lt;span class=&quot;nb&quot;&gt;shift&lt;/span&gt; + x
    betterlockscreen &lt;span class=&quot;nt&quot;&gt;-l&lt;/span&gt; dim &lt;span class=&quot;nt&quot;&gt;-t&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;''&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;small&gt;→ Requires &lt;code class=&quot;highlighter-rouge&quot;&gt;xset&lt;/code&gt; (for closing the screen) &amp;amp; &lt;a href=&quot;https://github.com/pavanjadhaw/betterlockscreen&quot;&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;betterlockscreen&lt;/code&gt;&lt;/a&gt;&lt;/small&gt;&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;c&lt;/code&gt; for &lt;strong&gt;C&lt;/strong&gt;lose, &lt;code class=&quot;highlighter-rouge&quot;&gt;x&lt;/code&gt; just because it’s right next to it :D&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Closing the screen requires half a second sleep time, otherwise the screen could be accidentally awaken from the initiating keystrokes.&lt;/p&gt;

&lt;h4 id=&quot;mimic-chrome-os-shortcuts&quot;&gt;Mimic Chrome OS shortcuts&lt;/h4&gt;

&lt;p&gt;I really love small and compact keyboards. However, one of their downsides is that they lack some of the useful keys, such as Home/End, and even Delete.&lt;br /&gt;
Chrome OS solved this problem by introducing some interesting keybindings for those missing keys, and I love them so much that I find myself using them even when I have dedicated keys on my keyboard.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# Emulate home/end keys&lt;/span&gt;
ctrl + alt + @&lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;Up,Down&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
    xte &lt;span class=&quot;s1&quot;&gt;'keyup Control_L'&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'keyup Alt_L'&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'key {Home,End}'&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# Emulate home/end keys with shift&lt;/span&gt;
ctrl + alt + &lt;span class=&quot;nb&quot;&gt;shift&lt;/span&gt; + @&lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;Up,Down&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
    xte &lt;span class=&quot;s1&quot;&gt;'keyup Control_L'&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'keyup Alt_L'&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'key {Home,End}'&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# Emulate delete key&lt;/span&gt;
~alt + BackSpace
    xte &lt;span class=&quot;s1&quot;&gt;'keyup Alt_L'&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'key Delete'&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'keydown Alt_L'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;&lt;small&gt;→ Requires &lt;a href=&quot;https://www.hoopajoo.net/projects/xautomation.html&quot;&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;xautomation&lt;/code&gt;&lt;/a&gt; (&lt;code class=&quot;highlighter-rouge&quot;&gt;xte&lt;/code&gt; tool)&lt;/small&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Performance of this tweak could use some improvement, mainly due to the usage of the old &lt;a href=&quot;https://www.hoopajoo.net/projects/xautomation.html&quot;&gt;xautomation&lt;/a&gt; tool. I tried using &lt;a href=&quot;https://github.com/jordansissel/xdotool&quot;&gt;xdotool&lt;/a&gt; and &lt;a href=&quot;https://github.com/baskerville/xdo&quot;&gt;xdo&lt;/a&gt; instead, but both of them offered far worse responsiveness.&lt;/p&gt;

&lt;h3 id=&quot;extra-organizing-and-running-sxhkd&quot;&gt;Extra: Organizing and running sxhkd&lt;/h3&gt;

&lt;p&gt;I have multiple systems running sxhkd. Most of my configuration applies to all of them, but inevitably some machines require small modifications.&lt;br /&gt;
While searching for a solution that’ll allow me to share the “core” configuration between machines, I noticed that sxhkd supported loading config files from multiple different sources at once.&lt;br /&gt;
I split my config file into 2 files, one I called &lt;code class=&quot;highlighter-rouge&quot;&gt;sxhkdrc.common&lt;/code&gt; and the other &lt;code class=&quot;highlighter-rouge&quot;&gt;sxhkdrc&lt;/code&gt;. The first contains the configuration common among all my machines, and the other is unique to each machine, adds extra stuff &lt;strong&gt;AND&lt;/strong&gt; also rewrites bindings from the common config file.&lt;br /&gt;
The latter is extremely important, because it allows me to have the same keybinding do different things on different machines.&lt;/p&gt;

&lt;p&gt;Here’s a simple example to help better illustrate what I mean.&lt;br /&gt;
On &lt;a href=&quot;#change-to-a-random-wallpaper&quot;&gt;this section&lt;/a&gt; I showed my snippet for changing the lock screen wallpaper.&lt;br /&gt;
In that snippet I choose a wallpaper from my “normal” wallpaper collection. However, on my desktop I have a multi-monitor setup, and therefore want to choose a wallpaper from my widescreen wallpapers directory instead. So, on my desktop’s sxhkdrc I rewrite that binding. Here’s how it looks:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sxhkdrc.common
&lt;span class=&quot;nt&quot;&gt;--------------&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# Change lock screen wallpaper&lt;/span&gt;
super + r &lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; c &lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; l
    betterlockscreen &lt;span class=&quot;nt&quot;&gt;-u&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$WALLPAPERS&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    notify-send &lt;span class=&quot;s1&quot;&gt;'betterlockscreen'&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'Changed background'&lt;/span&gt;

sxhkdrc &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;desktop&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;-----------------&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# Change lock screen wallpaper&lt;/span&gt;
super + r &lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; c &lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; l
    betterlockscreen &lt;span class=&quot;nt&quot;&gt;-u&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$WALLPAPERS&lt;/span&gt;/ultrawide&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    notify-send &lt;span class=&quot;s1&quot;&gt;'betterlockscreen'&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'Changed background'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;It’s important to make sure that the common config file is loaded as an &lt;em&gt;EXTRA_CONFIG&lt;/em&gt;, since the config file supplied with the &lt;code class=&quot;highlighter-rouge&quot;&gt;-c&lt;/code&gt; switcher supersedes it.&lt;br /&gt;
Here’s how I run my sxhkd:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sxhkd &lt;span class=&quot;nt&quot;&gt;-c&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$HOME&lt;/span&gt;/.config/sxhkd/sxhkdrc &lt;span class=&quot;nv&quot;&gt;$HOME&lt;/span&gt;/.config/sxhkd/sxhkdrc.common
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

</description>
        <pubDate>Fri, 03 Jul 2020 20:22:00 +0000</pubDate>
        <link>/2020/07/03/some-tricks-for-sxhkd-and-bspwm/</link>
        <guid isPermaLink="true">/2020/07/03/some-tricks-for-sxhkd-and-bspwm/</guid>
        
        <category>Linux,</category>
        
        <category>Tricks</category>
        
        
      </item>
    
      <item>
        <title>Why I stopped believing in Magi Coin</title>
        <description>&lt;p&gt;One of my first posts was about Magi Coin. This post was featured on the official Magi Coin Twitter account and probably on other channels as well. It has also been the most viewed post on the blog to this day.&lt;/p&gt;

&lt;p&gt;Every once in a while I get an email from someone asking for help with something regarding Magi Coin, and I’m happily helping them with whatever I can. However, it’s becoming more and more difficult for me since I simply stopped using it over a year ago.&lt;/p&gt;

&lt;!--more--&gt;

&lt;h3 id=&quot;magi---the-promise&quot;&gt;Magi - The Promise&lt;/h3&gt;

&lt;p&gt;From the start, Magi Coin was different. While all other alternative coins (“Altcoins”) targeted high-end hardware, Magi Coin was the only one targeting the lower section of the “market”. This strategy was extremely popular among Raspberry Pi users who simply wanted an easier opening to the cryprocurrency market. Magi Coin allowed those people to experiment and also get a chance to earn something in the process.  &lt;br /&gt;
Magi also introduced some &lt;a href=&quot;https://coinswitch.co/info/magi/what-is-magi&quot;&gt;unique features&lt;/a&gt; with the most well-received one being the staking mechanism.&lt;/p&gt;

&lt;h3 id=&quot;everything-starts-to-crumble&quot;&gt;Everything starts to crumble&lt;/h3&gt;

&lt;p&gt;Since the beginning, Magi Coin was a single developer project. The lead developer, Joe (joelao95) saw Magi as his own pet project and while sharing the source code &lt;a href=&quot;https://github.com/m-pays/magi&quot;&gt;on GitHub&lt;/a&gt;, he almost never accepted any pull requests or replied to user issue reports.&lt;/p&gt;

&lt;p&gt;Due to the nature of this kind of project some vulnerability were found, which forced a &lt;a href=&quot;https://twitter.com/Coin_Magi_XMG/status/942800807929499648&quot;&gt;hardfork&lt;/a&gt; on the Magi Coin network. Later on, more issues were found, but they were not addressed.  &lt;br /&gt;
As of right now, the project is completely dormant. No update was made on the main Magi Coin GitHub page for almost two years, and Joe has gone AWOL.&lt;/p&gt;

&lt;p&gt;One of the driving forces for any cryprocurrency are the exchange platforms. For Magi Coin (also known as XMG), Bittrex was the biggest exchange and Magi was &lt;a href=&quot;https://bittrex.zendesk.com/hc/en-us/articles/360001383023-Pending-Market-Removals-10-26-2018&quot;&gt;delisted&lt;/a&gt; from that one on October 2018, followed by a couple of other exchanges.&lt;/p&gt;

&lt;h3 id=&quot;time-to-give-up&quot;&gt;Time to give up&lt;/h3&gt;

&lt;p&gt;A short while after the Bittrex fiasco, I was offered the coins of some of the people that I helped to over the years, but after only a short while I, too, realized that this is not going anywhere.  &lt;br /&gt;
I sold my coins and got rid of my wallet. &lt;br /&gt;
This was a nice educational ride for me, but now is the time to truly say goodbye to Magi Coin.&lt;/p&gt;

</description>
        <pubDate>Thu, 30 Jan 2020 16:18:00 +0000</pubDate>
        <link>/2020/01/30/why-i-stopped-believing-in-magi-coin/</link>
        <guid isPermaLink="true">/2020/01/30/why-i-stopped-believing-in-magi-coin/</guid>
        
        <category>Cryptocurrency</category>
        
        <category>Magi Coin</category>
        
        
      </item>
    
      <item>
        <title>A new domain</title>
        <description>&lt;p&gt;I started this blog exactly two years ago on a whim and as a means for myself to document my findings in the ever-evolving tech world.  &lt;br /&gt;
While not being extremely active, I still plan to maintain this blog and add new posts on various topics that I find interesting or enriching.&lt;/p&gt;

&lt;!--more--&gt;

&lt;p&gt;Because I decided from the beginning to update this blog only on rare occasions, I never intended to put any money on it.  &lt;br /&gt;
However, the &lt;code class=&quot;highlighter-rouge&quot;&gt;.tk&lt;/code&gt; domain provider, &lt;a href=&quot;http://www.freenom.com&quot;&gt;Freenom&lt;/a&gt; which seemed like a too-good-to-be-true deal at first, finally decided out of the blue to cancel my domain (&lt;code class=&quot;highlighter-rouge&quot;&gt;www.my-take-on.tk&lt;/code&gt;) without any notice. To be exact, they sent me an email on December 2018 asking for a renewal, which I did - for two years (this was free, after all). On December 2019 no renewal notice arrived (which was to be expected), and just a couple of days ago I found out that it stopped working.  &lt;br /&gt;
The strangest thing of all was that all records of me ever owning this domain just disappeared from my account at Freenom’s website. ¯_(ツ)_/¯&lt;/p&gt;

&lt;p&gt;To cut a long story short, I decided it was a good chance to get a real domain. I checked a couple of domain registration providers such as GoDaddy and Hover, but finally found out that the cheapest of them all (by quite a margin) was &lt;a href=&quot;http://www.namecheap.com&quot;&gt;NameCheap&lt;/a&gt;.  &lt;br /&gt;
I actually registered to their &lt;em&gt;hosting&lt;/em&gt; service earlier last year and was extremely disappointed with the lack of control (even though the price was great) AND for some reason their website sometimes throws a “500 Internal Server Error” page only on Firefox (wut?!). So I ended up canceling my subscription.  &lt;br /&gt;
On domain registration, however, there was no problem at all and I was able to register the new domain for the next two years for $19.24, which I thought was a decent deal.&lt;/p&gt;

&lt;p&gt;New domain registrations take time and in my case, I had to wait 24 hours before Firebase could verify my ownership. Other than that, everything looks good so far.&lt;/p&gt;

&lt;p&gt;Welcome to &lt;a href=&quot;http://my-take-on.tech&quot;&gt;my-take-on.tech&lt;/a&gt;!&lt;/p&gt;

</description>
        <pubDate>Sun, 12 Jan 2020 04:45:00 +0000</pubDate>
        <link>/2020/01/12/a-new-domain/</link>
        <guid isPermaLink="true">/2020/01/12/a-new-domain/</guid>
        
        <category>Blogging</category>
        
        
      </item>
    
      <item>
        <title>Setting IRQ CPU affinities to improve performance on the Odroid XU4</title>
        <description>&lt;p&gt;I recently came across &lt;a href=&quot;https://www.reddit.com/r/ODroid/comments/cyalnt/collected_all_odroid_xu4_tweaks_i_know_in_one&quot;&gt;this post&lt;/a&gt; on the Odroid subreddit which featured an article offering tweaking tips for the &lt;a href=&quot;https://wiki.odroid.com/odroid-xu4/odroid-xu4&quot;&gt;Odroid XU4&lt;/a&gt;. The article was originally written in German and was later translated into English and published on the &lt;a href=&quot;https://magazine.odroid.com/article/odroid-xu4-tweaks-a-collection-of-popular-modifications&quot;&gt;Odroid Magazine&lt;/a&gt;.  &lt;br /&gt;
As a long time owner of the XU4, most of the tips were not new to me since they existed on the Odroid forums for quite some time now. However, there was this one tip I was not aware of and caught my attention, and not in a good way.&lt;/p&gt;

&lt;!--more--&gt;

&lt;p class=&quot;notice&quot;&gt;&lt;strong&gt;Update (February 2020):&lt;/strong&gt; This article is now &lt;a href=&quot;https://magazine.odroid.com/article/setting-irq-cpu-affinities-improving-irq-performance-on-the-odroid-xu4&quot;&gt;featured&lt;/a&gt; as part of Odroid Magazine February 2020 issue.&lt;/p&gt;

&lt;nav class=&quot;toc&quot;&gt;
  &lt;h4&gt;Quick Navigation&lt;/h4&gt;
&lt;ul id=&quot;markdown-toc&quot;&gt;
  &lt;li&gt;&lt;a href=&quot;#irqs&quot; id=&quot;markdown-toc-irqs&quot;&gt;IRQs&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#irqs-on-linux&quot; id=&quot;markdown-toc-irqs-on-linux&quot;&gt;IRQs on Linux&lt;/a&gt;    &lt;ul&gt;
      &lt;li&gt;&lt;a href=&quot;#changing-irq-cpu-affinity&quot; id=&quot;markdown-toc-changing-irq-cpu-affinity&quot;&gt;Changing IRQ CPU Affinity&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#the-tweaks&quot; id=&quot;markdown-toc-the-tweaks&quot;&gt;The “tweaks”&lt;/a&gt;    &lt;ul&gt;
      &lt;li&gt;&lt;a href=&quot;#irqbalance&quot; id=&quot;markdown-toc-irqbalance&quot;&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;irqbalance&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#using-a-fixed-irq-ids&quot; id=&quot;markdown-toc-using-a-fixed-irq-ids&quot;&gt;Using a fixed IRQ IDs&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#binding-each-interrupt-to-a-single-cpu&quot; id=&quot;markdown-toc-binding-each-interrupt-to-a-single-cpu&quot;&gt;Binding each interrupt to a single CPU&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#afterword&quot; id=&quot;markdown-toc-afterword&quot;&gt;Afterword&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;/nav&gt;

&lt;h3 id=&quot;irqs&quot;&gt;IRQs&lt;/h3&gt;

&lt;p&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Interrupt_request_(PC_architecture)&quot;&gt;IRQs&lt;/a&gt; (Interrupt Requests) are allowing hardware to access the CPU even when it’s busy doing something else. So our keyboard, mice and network for example won’t stop working if we’re maxing out our CPU.  &lt;br /&gt;
Anyone who has used computers for enough time knows this phenomenon where the mouse and keyboard stutter, lag or become unresponsive for some time when the CPU is doing an intensive task. This was way more common on early computers and has become less common as CPUs became more powerful, operating systems evolved and &lt;a href=&quot;https://en.wikipedia.org/wiki/Advanced_Programmable_Interrupt_Controller&quot;&gt;APIC architecture&lt;/a&gt; was introduced.&lt;/p&gt;

&lt;p&gt;To get the absolute best performance out of hardware peripherals on a multi-core system we need to make sure we’re addressing IRQs to the most idle core, increasing the chances they’re going to be executed immediately.  &lt;br /&gt;
On systems with &lt;a href=&quot;https://www.arm.com/why-arm/technologies/big-little&quot;&gt;Arm big.LITTLE&lt;/a&gt; chipsets (such as the XU4) we’re more likely to get the best responsiveness for IRQs out of the “big” cores. This makes perfect sense.&lt;/p&gt;

&lt;h3 id=&quot;irqs-on-linux&quot;&gt;IRQs on Linux&lt;/h3&gt;

&lt;p&gt;To get a list of IRQs and their CPU affinities we can simply peak inside &lt;code class=&quot;highlighter-rouge&quot;&gt;/proc/interrupts&lt;/code&gt;.  &lt;br /&gt;
This is how it looks on my XU4 running Arch Linux ARM with kernel v4.14.157:  &lt;br /&gt;
&lt;strong&gt;Note:&lt;/strong&gt; The output is quite long so I’ll use &lt;code class=&quot;highlighter-rouge&quot;&gt;head&lt;/code&gt; to trim it.&lt;/p&gt;

&lt;div class=&quot;language-sh highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cat&lt;/span&gt; /proc/interrupts | &lt;span class=&quot;nb&quot;&gt;head
           &lt;/span&gt;CPU0       CPU1       CPU2       CPU3       CPU4       CPU5       CPU6       CPU7       
 49:          0          0          0          0          0          0          0          0  COMBINER 187 Edge      mct_comp_irq
 50:    8344372          0          0          0          0          0          0          0     GICv2 152 Edge      mct_tick0
 51:          0    5765406          0          0          0          0          0          0     GICv2 153 Edge      mct_tick1
 52:          0          0    4389485          0          0          0          0          0     GICv2 154 Edge      mct_tick2
 53:          0          0          0    3384898          0          0          0          0     GICv2 155 Edge      mct_tick3
 54:          0          0          0          0   55211190          0          0          0     GICv2 160 Edge      mct_tick4
 55:          0          0          0          0          0   48058391          0          0     GICv2 161 Edge      mct_tick5
 56:          0          0          0          0          0          0   33449904          0     GICv2 162 Edge      mct_tick6
 57:          0          0          0          0          0          0          0   20020736     GICv2 163 Edge      mct_tick7
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;In the above output we got IRQs #49-57 which seem like the system clock ticks. One for each of the 8 cores. Basically, each IRQ has its own ID and is bound to a single CPU.&lt;/p&gt;

&lt;p&gt;The last statement may be hard to understand from the last example, so let’s take a look at how MMC and SD-Card readers interrupts look:  &lt;br /&gt;
&lt;strong&gt;Note:&lt;/strong&gt; I know that &lt;code class=&quot;highlighter-rouge&quot;&gt;dw-mci&lt;/code&gt; are interrupts for the I/O devices simply from looking at &lt;a href=&quot;https://github.com/hardkernel/linux/blob/odroidxu4-4.14.y/drivers/mmc/host/dw_mmc-exynos.c&quot;&gt;the source code&lt;/a&gt;.&lt;/p&gt;

&lt;div class=&quot;language-sh highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cat&lt;/span&gt; /proc/interrupts | &lt;span class=&quot;nb&quot;&gt;grep &lt;/span&gt;dw-mci
 83:          0          0          0          0          0          0          0          0     GICv2 107 Edge      dw-mci
 84:  103693202          0          0          0          0          0          0          0     GICv2 109 Edge      dw-mci
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;IRQ #83 is for eMMC (which I don’t have) and IRQ #84 is for the Micro SD-Card which is obviously installed.&lt;/p&gt;

&lt;p&gt;By default, all non-CPU-clock IRQs are bound to all cores but in reality CPU0 will be used most of the time since it’s simply the first one.  &lt;br /&gt;
In my kernel version on the XU4, CPU0 is one of the “little” cores. The easiest way to confirm that is by looking at the max CPU frequency of each core, since the “little” ones are running at a slower speed:&lt;/p&gt;

&lt;div class=&quot;language-sh highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cat&lt;/span&gt; /sys/devices/system/cpu/cpu&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;/cpufreq/cpuinfo_max_freq
1500000
1500000
1500000
1500000
2000000
2000000
2000000
2000000
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;First 4 CPUs (=cores) are running at 1.5GHz and the last ones at 2GHz, which matche XU4’s &lt;a href=&quot;https://en.wikichip.org/wiki/samsung/exynos/5422&quot;&gt;Samsung Exynos5422&lt;/a&gt; CPU speeds (my “big” cores are running 100MHz slower).&lt;/p&gt;

&lt;h4 id=&quot;changing-irq-cpu-affinity&quot;&gt;Changing IRQ CPU Affinity&lt;/h4&gt;

&lt;p&gt;It’s quite easy to change the CPU affinity of IRQs.  &lt;br /&gt;
All IRQs are listed in &lt;code class=&quot;highlighter-rouge&quot;&gt;/proc/irq/&lt;/code&gt; and each one’s affinity is conveniently written inside &lt;code class=&quot;highlighter-rouge&quot;&gt;smp_affinity&lt;/code&gt; and &lt;code class=&quot;highlighter-rouge&quot;&gt;smp_affinity_list&lt;/code&gt; with the former containing an hexadecimal value and the latter a decimal value.&lt;/p&gt;

&lt;p&gt;So, to change our SD-Card’s IRQ CPU affinity all we have to do it change the value of &lt;code class=&quot;highlighter-rouge&quot;&gt;/proc/irq/84/smp_affinity_list&lt;/code&gt; to whatever CPU number we’d like, say &lt;code class=&quot;highlighter-rouge&quot;&gt;5&lt;/code&gt;.  &lt;br /&gt;
Of course, we cannot do that as a normal user so we’ll have to use &lt;code class=&quot;highlighter-rouge&quot;&gt;sudo&lt;/code&gt;.  &lt;br /&gt;
The easiest way to do that is as follows:&lt;/p&gt;

&lt;div class=&quot;language-sh highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;sh &lt;span class=&quot;nt&quot;&gt;-c&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;echo 5 &amp;gt; /proc/irq/84/smp_affinity_list&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And we can confirm that it worked:&lt;/p&gt;

&lt;div class=&quot;language-sh highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cat&lt;/span&gt; /proc/irq/84/smp_affinity_list
5
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cat&lt;/span&gt; /proc/interrupts | &lt;span class=&quot;nb&quot;&gt;grep &lt;/span&gt;dw-mci
 83:          0          0          0          0          0          0          0          0     GICv2 107 Edge      dw-mci
 84:  103699631          0          0          0     152288          0          0          0     GICv2 109 Edge      dw-mci
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; This value will not stick after boot, but this is the general idea.&lt;/p&gt;

&lt;h3 id=&quot;the-tweaks&quot;&gt;The “tweaks”&lt;/h3&gt;

&lt;p&gt;Going back to where we started, &lt;a href=&quot;https://magazine.odroid.com/article/odroid-xu4-tweaks-a-collection-of-popular-modifications&quot;&gt;the article&lt;/a&gt; suggested doing exactly what I wrote above, so why was I unsatisfied with it?&lt;/p&gt;

&lt;h4 id=&quot;irqbalance&quot;&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;irqbalance&lt;/code&gt;&lt;/h4&gt;

&lt;p&gt;Putting aside the poor choice of using &lt;code class=&quot;highlighter-rouge&quot;&gt;/etc/rc.local&lt;/code&gt; for applying this tweak, the first step was the one that caught my attention the most:&lt;/p&gt;

&lt;div class=&quot;language-sh highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;systemctl disable irqbalance
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;There’s a dedicated program that its whole purpose is doing IRQ balancing and we’re going ahead and disabling it? Sounds extremely fishy.&lt;/p&gt;

&lt;p&gt;What I immediately thought was that maybe &lt;code class=&quot;highlighter-rouge&quot;&gt;irqbalance&lt;/code&gt; did not allow limiting its assignments to specific CPUs, and therefore disabling it would make sense. However that was not the case.  &lt;br /&gt;
Looking at the &lt;a href=&quot;https://linux.die.net/man/1/irqbalance&quot;&gt;man page&lt;/a&gt; of &lt;code class=&quot;highlighter-rouge&quot;&gt;irqbalance&lt;/code&gt;, there’s an environment variable &lt;code class=&quot;highlighter-rouge&quot;&gt;IRQBALANCE_BANNED_CPUS&lt;/code&gt; which can tell the program to avoid assigning IRQs to those CPUs, which is exactly what we want.&lt;/p&gt;

&lt;p&gt;The value of this environment variable is &lt;a href=&quot;https://en.wikipedia.org/wiki/Mask_(computing)&quot;&gt;a hexadecimal mask&lt;/a&gt;. We simply need to say which CPUs we want active and which we don’t. Each CPU is either on or off (=1 or 0) and in our case we want to turn off the first four and leave the last ones. That means our mask in binary would be:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;00001111
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The value must be hexadecimal, which is a fairly easy conversion from binary in this case: &lt;code class=&quot;highlighter-rouge&quot;&gt;0F&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;All we have to do now is set our environment variable to &lt;code class=&quot;highlighter-rouge&quot;&gt;0F&lt;/code&gt; (or just &lt;code class=&quot;highlighter-rouge&quot;&gt;F&lt;/code&gt; since the leading &lt;code class=&quot;highlighter-rouge&quot;&gt;0&lt;/code&gt; has no meaning).  &lt;br /&gt;
Let’s test that to make sure we got the math right:&lt;/p&gt;

&lt;div class=&quot;language-sh highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;su
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;IRQBALANCE_BANNED_CPUS&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;f&quot;&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;irqbalance &lt;span class=&quot;nt&quot;&gt;-d&lt;/span&gt;
This machine seems not NUMA capable.
Isolated CPUs: 00000000
Adaptive-ticks CPUs: 00000000
Banned CPUs: 0000000f
...
Package 0:  numa_node &lt;span class=&quot;nt&quot;&gt;-1&lt;/span&gt; cpu mask is 000000f0 &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;load 520000000&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
        Cache domain 0:  numa_node is &lt;span class=&quot;nt&quot;&gt;-1&lt;/span&gt; cpu mask is 00000080  &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;load 90000000&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
                CPU number 7  numa_node is &lt;span class=&quot;nt&quot;&gt;-1&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;load 90000000&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
        Cache domain 1:  numa_node is &lt;span class=&quot;nt&quot;&gt;-1&lt;/span&gt; cpu mask is 00000020  &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;load 100000000&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
                CPU number 5  numa_node is &lt;span class=&quot;nt&quot;&gt;-1&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;load 100000000&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
        Cache domain 2:  numa_node is &lt;span class=&quot;nt&quot;&gt;-1&lt;/span&gt; cpu mask is 00000040  &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;load 130000000&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
                CPU number 6  numa_node is &lt;span class=&quot;nt&quot;&gt;-1&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;load 130000000&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
        Cache domain 3:  numa_node is &lt;span class=&quot;nt&quot;&gt;-1&lt;/span&gt; cpu mask is 00000010  &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;load 200000000&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
                CPU number 4  numa_node is &lt;span class=&quot;nt&quot;&gt;-1&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;load 200000000&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;First we change user to root to make it easier for us.&lt;/li&gt;
  &lt;li&gt;Then export the environment variable for &lt;code class=&quot;highlighter-rouge&quot;&gt;irqbalance&lt;/code&gt;.&lt;/li&gt;
  &lt;li&gt;Run &lt;code class=&quot;highlighter-rouge&quot;&gt;irqbalance&lt;/code&gt; in debug &lt;code class=&quot;highlighter-rouge&quot;&gt;-d&lt;/code&gt; mode.&lt;/li&gt;
  &lt;li&gt;Output:
    &lt;ul&gt;
      &lt;li&gt;The first part shows in &lt;code class=&quot;highlighter-rouge&quot;&gt;Banned CPUs&lt;/code&gt; that our value was accepted.&lt;/li&gt;
      &lt;li&gt;Then, if we look at the rest of the output we can spot it assigning stuff to CPUs #4-7(5th to 8th), which is exactly what we wanted.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To set this environment variable so the systemd unit will be able to access it, we need to inspect it:&lt;/p&gt;

&lt;div class=&quot;language-sh highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;systemctl show irqbalance
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;There we look for &lt;code class=&quot;highlighter-rouge&quot;&gt;EnvironmentFile&lt;/code&gt; value which could be anything depending on the operating system. On Ubuntu 18.04 it’s &lt;code class=&quot;highlighter-rouge&quot;&gt;/etc/default/irqbalance&lt;/code&gt; and on my Arch system it’s &lt;code class=&quot;highlighter-rouge&quot;&gt;/etc/irqbalance.env&lt;/code&gt;.  &lt;br /&gt;
There’s probably already a template file there and all we have to do it make sure it’s uncommented and set with the right value.&lt;/p&gt;

&lt;h4 id=&quot;using-a-fixed-irq-ids&quot;&gt;Using a fixed IRQ IDs&lt;/h4&gt;

&lt;p&gt;The “tip” instructs putting each line that corresponds to a different hardware controller’s IRQ ID. However, IRQ IDs are not consistent and depend on the kernel version.  &lt;br /&gt;
For example, on my system IRQs IDs #103-105 map to some gpio pins:&lt;/p&gt;

&lt;div class=&quot;language-sh highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cat&lt;/span&gt; /proc/interrupts | &lt;span class=&quot;nb&quot;&gt;awk&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'$1 ~ /103|104|105/'&lt;/span&gt;
103:          0          0          0          0          0          0          0          0     GICv2 110 Edge      13410000.pinctrl
104:          0          0          0          0          0          0          0          0     GICv2  78 Edge      14000000.pinctrl
105:          0          0          0          0          0          0          0          0     GICv2  82 Edge      14010000.pinctrl
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;binding-each-interrupt-to-a-single-cpu&quot;&gt;Binding each interrupt to a single CPU&lt;/h4&gt;

&lt;p&gt;Last but not least, the article suggests binding each interrupt to a different CPU. Networking card gets CPU4, USB3 adapter gets CPU5, etc…  &lt;br /&gt;
Why bother limiting the CPUs our kernel can choose? What if a program locks that specific CPU for a long period of time? The kernel wouldn’t be able to assign the IRQ to a different CPU to avoid slowdowns.&lt;/p&gt;

&lt;h3 id=&quot;afterword&quot;&gt;Afterword&lt;/h3&gt;

&lt;p&gt;While I like those tweak compilations as much as the next guy, I always tend to make sure I completely understand what each tweak is doing and double check them to see how they apply to my particular system and use case.  &lt;br /&gt;
Moreover, if there exists a dedicated tool for a certain purpose (like &lt;code class=&quot;highlighter-rouge&quot;&gt;irqbalance&lt;/code&gt; for this matter), one should first consider using it, otherwise its existence wouldn’t be justified.&lt;/p&gt;

&lt;p&gt;This article’s purpose is by no means to offend or condemn u/blaumedia who wrote the original article, and is meant to raise awareness to why users must consider their situation and understand what they’re doing.&lt;/p&gt;

</description>
        <pubDate>Sun, 12 Jan 2020 03:36:00 +0000</pubDate>
        <link>/2020/01/12/setting-irq-cpu-affinities-to-improve-performance-on-the-odroid-xu4/</link>
        <guid isPermaLink="true">/2020/01/12/setting-irq-cpu-affinities-to-improve-performance-on-the-odroid-xu4/</guid>
        
        <category>Linux</category>
        
        <category>Odroid-XU4</category>
        
        
      </item>
    
      <item>
        <title>Safely storing git credentials</title>
        <description>&lt;p&gt;When working with a remote git repository, typing the password every single pull/push is quite tiresome.&lt;br /&gt;
A good way would be to store the credentials locally, however the most common way of doing so is just wrong from a security point of view.&lt;br /&gt;
&lt;!--more--&gt;&lt;/p&gt;

&lt;nav class=&quot;toc&quot;&gt;
  &lt;h4&gt;Quick Navigation&lt;/h4&gt;
&lt;ul id=&quot;markdown-toc&quot;&gt;
  &lt;li&gt;&lt;a href=&quot;#the-problem&quot; id=&quot;markdown-toc-the-problem&quot;&gt;The problem&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#the-solution&quot; id=&quot;markdown-toc-the-solution&quot;&gt;The solution&lt;/a&gt;    &lt;ul&gt;
      &lt;li&gt;&lt;a href=&quot;#the-gnome-way-libsecret&quot; id=&quot;markdown-toc-the-gnome-way-libsecret&quot;&gt;The GNOME way: &lt;code class=&quot;highlighter-rouge&quot;&gt;libsecret&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#encrypting-using-gnupg&quot; id=&quot;markdown-toc-encrypting-using-gnupg&quot;&gt;Encrypting using GnuPG&lt;/a&gt;        &lt;ul&gt;
          &lt;li&gt;&lt;a href=&quot;#encrypting-manually-using-gnupg-without-pass&quot; id=&quot;markdown-toc-encrypting-manually-using-gnupg-without-pass&quot;&gt;Encrypting manually using GnuPG (without &lt;code class=&quot;highlighter-rouge&quot;&gt;pass&lt;/code&gt;)&lt;/a&gt;&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#troubleshooting&quot; id=&quot;markdown-toc-troubleshooting&quot;&gt;Troubleshooting&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#not-a-git-command-error&quot; id=&quot;markdown-toc-not-a-git-command-error&quot;&gt;“Not a git command” error&lt;/a&gt;        &lt;ul&gt;
          &lt;li&gt;&lt;a href=&quot;#for-libsecret-only&quot; id=&quot;markdown-toc-for-libsecret-only&quot;&gt;For &lt;code class=&quot;highlighter-rouge&quot;&gt;libsecret&lt;/code&gt; only&lt;/a&gt;&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#lookup-failed-error&quot; id=&quot;markdown-toc-lookup-failed-error&quot;&gt;“lookup failed” error&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#plain-text-git-credentials-keeps-coming-back&quot; id=&quot;markdown-toc-plain-text-git-credentials-keeps-coming-back&quot;&gt;Plain text &lt;code class=&quot;highlighter-rouge&quot;&gt;~/.git-credentials&lt;/code&gt; keeps coming back&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#cant-type-in-gnupg-password-on-a-headless-machine&quot; id=&quot;markdown-toc-cant-type-in-gnupg-password-on-a-headless-machine&quot;&gt;Can’t type in GnuPG password on a headless machine&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#extra-gui-for-credentials-management&quot; id=&quot;markdown-toc-extra-gui-for-credentials-management&quot;&gt;Extra: GUI for credentials management&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;/nav&gt;

&lt;h3 id=&quot;the-problem&quot;&gt;The problem&lt;/h3&gt;

&lt;p&gt;Most people will search online for &lt;em&gt;“how to store git credentials”&lt;/em&gt; and resort to this “solution”:&lt;/p&gt;

&lt;div class=&quot;language-sh highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;git config credential.helper store
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This “trick” will actually create a &lt;strong&gt;plain text&lt;/strong&gt; file &lt;code class=&quot;highlighter-rouge&quot;&gt;~/.git-credentials&lt;/code&gt; with the password, when it’s typed the next time with &lt;code class=&quot;highlighter-rouge&quot;&gt;git pull&lt;/code&gt; or &lt;code class=&quot;highlighter-rouge&quot;&gt;git push&lt;/code&gt; commands.&lt;br /&gt;
Here’s what this file usually looks like:&lt;/p&gt;
&lt;div class=&quot;language-ini highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;err&quot;&gt;https://&amp;lt;username&amp;gt;:&amp;lt;password&amp;gt;@&amp;lt;url&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This file gets 0600 permission by default, so only the current user can see it.&lt;br /&gt;
But that’s not good enough.&lt;/p&gt;

&lt;h3 id=&quot;the-solution&quot;&gt;The solution&lt;/h3&gt;

&lt;p&gt;It starts with a simple command:&lt;/p&gt;

&lt;div class=&quot;language-sh highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;shred&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-u&lt;/span&gt; ~/.git-credentials
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This command makes sure to remove the file &lt;strong&gt;and&lt;/strong&gt; overwrite where it was stored on the drive, making it impossible to recover even if someone physically got hold of the machine.&lt;/p&gt;

&lt;p&gt;Once we made sure nobody will ever be able to recover our password again, we’re left with two main options for encrypting the credentials.&lt;/p&gt;

&lt;h4 id=&quot;the-gnome-way-libsecret&quot;&gt;The GNOME way: &lt;code class=&quot;highlighter-rouge&quot;&gt;libsecret&lt;/code&gt;&lt;/h4&gt;

&lt;p&gt;This solution simply uses GNOME’s &lt;code class=&quot;highlighter-rouge&quot;&gt;libsecret&lt;/code&gt; for encrypting and storing the credentials. However, even though it’s GNOME, it should work on basically any UNIX system.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Get and install &lt;code class=&quot;highlighter-rouge&quot;&gt;libsecret&lt;/code&gt; which presents in any modern Linux distribution’s software repository.&lt;br /&gt;
Debian-based distributions: &lt;code class=&quot;highlighter-rouge&quot;&gt;libsecret-1-0&lt;/code&gt; and &lt;code class=&quot;highlighter-rouge&quot;&gt;libsecret-1-dev&lt;/code&gt; packages.&lt;/li&gt;
  &lt;li&gt;Configure git to use &lt;code class=&quot;highlighter-rouge&quot;&gt;libsecret&lt;/code&gt; (mind the &lt;code class=&quot;highlighter-rouge&quot;&gt;--global&lt;/code&gt; flag):
    &lt;div class=&quot;language-sh highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt; &lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;git config &lt;span class=&quot;nt&quot;&gt;--global&lt;/span&gt; credential.helper libsecret
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
    &lt;p&gt;This will effectively create a file &lt;code class=&quot;highlighter-rouge&quot;&gt;~/.gitconfig&lt;/code&gt; with the following content (or append to the existing one):&lt;/p&gt;
    &lt;div class=&quot;language-ini highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nn&quot;&gt;[credential]&lt;/span&gt;
&lt;span class=&quot;py&quot;&gt;helper&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;libsecret&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;On the next &lt;code class=&quot;highlighter-rouge&quot;&gt;pull&lt;/code&gt; or &lt;code class=&quot;highlighter-rouge&quot;&gt;push&lt;/code&gt; commands, a popup should come up asking for a password:&lt;br /&gt;
&lt;img src=&quot;/img/safely-storing-git-credentials-libsecret.png&quot; alt=&quot;Insert password to create a new keyring&quot; style=&quot;display: inline-block&quot; /&gt;&lt;/p&gt;

    &lt;p&gt;This password will be used for encrypting what’s called a “keyring” which is used for encrypting the git password.&lt;br /&gt;
All keyrings are stored in &lt;code class=&quot;highlighter-rouge&quot;&gt;~/.local/share/keyrings&lt;/code&gt;.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;With the default settings it’s required to type in the password only once per login session, which is much more convenient compared to each &lt;code class=&quot;highlighter-rouge&quot;&gt;git&lt;/code&gt; command.&lt;/p&gt;

&lt;h4 id=&quot;encrypting-using-gnupg&quot;&gt;Encrypting using GnuPG&lt;/h4&gt;

&lt;p&gt;For people who use &lt;a href=&quot;https://www.passwordstore.org&quot;&gt;pass&lt;/a&gt;, this should be the preferred option.&lt;/p&gt;
&lt;ol&gt;
  &lt;li&gt;Create a new password file (the name doesn’t matter):
    &lt;div class=&quot;language-sh highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt; &lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;pass add &lt;span class=&quot;nt&quot;&gt;-m&lt;/span&gt; &amp;lt;name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
    &lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; The &lt;code class=&quot;highlighter-rouge&quot;&gt;-m&lt;/code&gt; switch allows typing multi-line credentials.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;Here’s the content that should be inside:
    &lt;div class=&quot;language-ini highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;err&quot;&gt;machine&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;&amp;lt;domain&amp;gt;&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;protocol&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;&amp;lt;http|https|ssh&amp;gt;&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;login&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;&amp;lt;username&amp;gt;&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;password&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;&amp;lt;password&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
    &lt;p&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;machine&lt;/code&gt; → The repository’s domain name. (Ex: GitHub: &lt;code class=&quot;highlighter-rouge&quot;&gt;github.com&lt;/code&gt;, Bitbucket: &lt;code class=&quot;highlighter-rouge&quot;&gt;bitbucket.org&lt;/code&gt;)&lt;br /&gt;
&lt;code class=&quot;highlighter-rouge&quot;&gt;protocol&lt;/code&gt; → Whatever fits the repository: &lt;code class=&quot;highlighter-rouge&quot;&gt;http&lt;/code&gt;, &lt;code class=&quot;highlighter-rouge&quot;&gt;https&lt;/code&gt; or &lt;code class=&quot;highlighter-rouge&quot;&gt;ssh&lt;/code&gt;&lt;br /&gt;
&lt;code class=&quot;highlighter-rouge&quot;&gt;login&lt;/code&gt;/&lt;code class=&quot;highlighter-rouge&quot;&gt;password&lt;/code&gt; → The username and password for the service&lt;br /&gt;
&lt;strong&gt;Note:&lt;/strong&gt; It’s possible to store multiple service’s credentials. Simply add another paragraph for each service.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;em&gt;Optional:&lt;/em&gt; By default, the credentials file is stored at &lt;code class=&quot;highlighter-rouge&quot;&gt;pass&lt;/code&gt; main directory (usually &lt;code class=&quot;highlighter-rouge&quot;&gt;~/.password-store&lt;/code&gt;) but I recommend linking it to &lt;code class=&quot;highlighter-rouge&quot;&gt;$HOME&lt;/code&gt; for convenience:
    &lt;div class=&quot;language-sh highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;ln&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-s&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$HOME&lt;/span&gt;/.password-store/&amp;lt;file-name&amp;gt; &lt;span class=&quot;nv&quot;&gt;$HOME&lt;/span&gt;/.git.gpg
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
    &lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; When linking files it’s usually safer to use &lt;code class=&quot;highlighter-rouge&quot;&gt;$HOME&lt;/code&gt; instead of &lt;code class=&quot;highlighter-rouge&quot;&gt;~/&lt;/code&gt; to indicate the home directory.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;Next, configure &lt;code class=&quot;highlighter-rouge&quot;&gt;git&lt;/code&gt; accordingly, to use the &lt;code class=&quot;highlighter-rouge&quot;&gt;netrc&lt;/code&gt; script:
    &lt;div class=&quot;language-sh highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;git config &lt;span class=&quot;nt&quot;&gt;--global&lt;/span&gt; credential.helper &lt;span class=&quot;s2&quot;&gt;&quot;netrc -v -f &amp;lt;path-to-file&amp;gt;&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;h5 id=&quot;encrypting-manually-using-gnupg-without-pass&quot;&gt;Encrypting manually using GnuPG (without &lt;code class=&quot;highlighter-rouge&quot;&gt;pass&lt;/code&gt;)&lt;/h5&gt;

&lt;p&gt;Those who don’t use &lt;code class=&quot;highlighter-rouge&quot;&gt;pass&lt;/code&gt; can still use this option, however it requires (a little bit of) extra work:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Create a file with the content mentioned in step 2 above.&lt;/li&gt;
  &lt;li&gt;Generate a new GPG key (if there’s none already):
    &lt;div class=&quot;language-sh highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;gpg &lt;span class=&quot;nt&quot;&gt;--gen-key&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;Encrypt the file:
    &lt;div class=&quot;language-sh highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;gpg &lt;span class=&quot;nt&quot;&gt;-e&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-r&lt;/span&gt; &amp;lt;recipient&amp;gt; &amp;lt;path-to-file&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
    &lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; &lt;code class=&quot;highlighter-rouge&quot;&gt;&amp;lt;recipient&amp;gt;&lt;/code&gt; is usually the email address (of yourself). Use &lt;code class=&quot;highlighter-rouge&quot;&gt;gpg --list-keys&lt;/code&gt; to confirm.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;Continue to step 4 above.&lt;/li&gt;
&lt;/ol&gt;

&lt;h4 id=&quot;troubleshooting&quot;&gt;Troubleshooting&lt;/h4&gt;

&lt;h4 id=&quot;not-a-git-command-error&quot;&gt;“Not a git command” error&lt;/h4&gt;

&lt;p&gt;When running &lt;code class=&quot;highlighter-rouge&quot;&gt;git pull&lt;/code&gt; or &lt;code class=&quot;highlighter-rouge&quot;&gt;git push&lt;/code&gt; for the first time, the following error might show up:&lt;/p&gt;

&lt;div class=&quot;language-sh highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;git: &lt;span class=&quot;s1&quot;&gt;'credential-&amp;lt;libsecret|netrc&amp;gt;'&lt;/span&gt; is not a git command. See &lt;span class=&quot;s1&quot;&gt;'git --help'&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;It happens because on some distribution the required binary is not in &lt;code class=&quot;highlighter-rouge&quot;&gt;$PATH&lt;/code&gt; or even compiled.&lt;br /&gt;
To fix this, we need to find a file named &lt;code class=&quot;highlighter-rouge&quot;&gt;git-credentials-libsecret&lt;/code&gt; for &lt;code class=&quot;highlighter-rouge&quot;&gt;libsecret&lt;/code&gt; or &lt;code class=&quot;highlighter-rouge&quot;&gt;git-credentials-netrc&lt;/code&gt; for GnuPG.&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th style=&quot;text-align: left&quot;&gt;Distribution&lt;/th&gt;
      &lt;th style=&quot;text-align: left&quot;&gt;Path&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;Debian&lt;/td&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;/usr/share/doc/git/contrib/credential/&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;Arch&lt;/td&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;/usr/lib/git-core/&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;Then, choose one of the following:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Copy &lt;code class=&quot;highlighter-rouge&quot;&gt;git-credentials-&amp;lt;libsecret|netrc&amp;gt;&lt;/code&gt; to any directory in &lt;code class=&quot;highlighter-rouge&quot;&gt;$PATH&lt;/code&gt;.&lt;/li&gt;
  &lt;li&gt;Direct &lt;code class=&quot;highlighter-rouge&quot;&gt;git&lt;/code&gt; to use &lt;code class=&quot;highlighter-rouge&quot;&gt;git-credentials-&amp;lt;libsecret|netrc&amp;gt;&lt;/code&gt; from this location. Simply re-run the config command:
    &lt;div class=&quot;language-sh highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;  &lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;git config &lt;span class=&quot;nt&quot;&gt;--global&lt;/span&gt; credential.helper &lt;span class=&quot;nv&quot;&gt;$PWD&lt;/span&gt;/git-credentials-&amp;lt;libsecret|netrc&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
    &lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; We’re using &lt;code class=&quot;highlighter-rouge&quot;&gt;$PWD&lt;/code&gt; that indicates the current path. This should be where the &lt;code class=&quot;highlighter-rouge&quot;&gt;git-credentials-&amp;lt;libsecret|netrc&amp;gt;&lt;/code&gt; file is.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Notes:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;If the target file is in &lt;code class=&quot;highlighter-rouge&quot;&gt;$PATH&lt;/code&gt;, &lt;code class=&quot;highlighter-rouge&quot;&gt;git-credentials-&lt;/code&gt; prefix will be automatically prepended to &lt;code class=&quot;highlighter-rouge&quot;&gt;libsecret&lt;/code&gt; or &lt;code class=&quot;highlighter-rouge&quot;&gt;netrc&lt;/code&gt;.&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;git-credentials-netrc&lt;/code&gt; supports &lt;code class=&quot;highlighter-rouge&quot;&gt;--help&lt;/code&gt; for more information (when running the script directly) and &lt;code class=&quot;highlighter-rouge&quot;&gt;-d&lt;/code&gt; for debugging.&lt;/li&gt;
&lt;/ul&gt;

&lt;h5 id=&quot;for-libsecret-only&quot;&gt;For &lt;code class=&quot;highlighter-rouge&quot;&gt;libsecret&lt;/code&gt; only&lt;/h5&gt;

&lt;p&gt;If only a file named &lt;code class=&quot;highlighter-rouge&quot;&gt;git-credentials-libsecret.c&lt;/code&gt; is present, it means we have to compile it.&lt;br /&gt;
Make sure basic build packages are present on the system (&lt;code class=&quot;highlighter-rouge&quot;&gt;build-essential&lt;/code&gt; on Debian-based systems, for example):&lt;/p&gt;
&lt;div class=&quot;language-sh highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;make
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; The &lt;code class=&quot;highlighter-rouge&quot;&gt;sudo&lt;/code&gt; part is essential since we’re inside &lt;code class=&quot;highlighter-rouge&quot;&gt;/usr&lt;/code&gt; which is probably not owned by the current user.&lt;br /&gt;
This process should end in a fraction of a second on any machine.&lt;/p&gt;

&lt;h4 id=&quot;lookup-failed-error&quot;&gt;“lookup failed” error&lt;/h4&gt;

&lt;p&gt;On Arch, the following error may show up:&lt;/p&gt;

&lt;div class=&quot;language-sh highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;**&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;process:6182&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;: CRITICAL &lt;span class=&quot;k&quot;&gt;**&lt;/span&gt;: 22:10:58.547: lookup failed: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.secrets was not provided by any .service files
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;It can be fixed by installing the &lt;code class=&quot;highlighter-rouge&quot;&gt;gnome-keyring&lt;/code&gt; package which provides the necessary service for &lt;code class=&quot;highlighter-rouge&quot;&gt;libsecret&lt;/code&gt; to run.&lt;/p&gt;

&lt;h4 id=&quot;plain-text-git-credentials-keeps-coming-back&quot;&gt;Plain text &lt;code class=&quot;highlighter-rouge&quot;&gt;~/.git-credentials&lt;/code&gt; keeps coming back&lt;/h4&gt;

&lt;p&gt;Some repositories might have been configured to use the &lt;code class=&quot;highlighter-rouge&quot;&gt;store&lt;/code&gt; plugin locally and those settings override the global ones.&lt;br /&gt;
To reset this setting, simply run inside the suspected repository:&lt;/p&gt;
&lt;div class=&quot;language-sh highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;git config &lt;span class=&quot;nt&quot;&gt;--unset&lt;/span&gt; credential.helper
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;By the way, it’s possible to confirm (or change) those settings manually by editing &lt;code class=&quot;highlighter-rouge&quot;&gt;.git/config&lt;/code&gt; in every repository.&lt;/p&gt;

&lt;h4 id=&quot;cant-type-in-gnupg-password-on-a-headless-machine&quot;&gt;Can’t type in GnuPG password on a headless machine&lt;/h4&gt;

&lt;p&gt;GnuPG assumes that it runs inside an Xserver environment and tries to launch a window asking for a password. However, on a headless machine it’s not the case.&lt;/p&gt;

&lt;p&gt;There’s a global variable &lt;code class=&quot;highlighter-rouge&quot;&gt;$GPG_TTY&lt;/code&gt; that can be set to fix this:&lt;/p&gt;
&lt;div class=&quot;language-sh highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;GPG_TTY&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;tty&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; This line can be added to &lt;code class=&quot;highlighter-rouge&quot;&gt;.bashrc&lt;/code&gt;/&lt;code class=&quot;highlighter-rouge&quot;&gt;.zshrc&lt;/code&gt; for convenience.&lt;/p&gt;

&lt;h3 id=&quot;extra-gui-for-credentials-management&quot;&gt;Extra: GUI for credentials management&lt;/h3&gt;

&lt;p&gt;The &lt;a href=&quot;seahorse&quot;&gt;Seahorse&lt;/a&gt; GUI utility can be used for managing all passwords stored by &lt;code class=&quot;highlighter-rouge&quot;&gt;libsecret&lt;/code&gt; or the keys for GnuPG.&lt;br /&gt;
It can even manage SSH keys and do a lot more.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/img/seahorse.png&quot; alt=&quot;Seahorse GUI Utility&quot; /&gt;&lt;/p&gt;

</description>
        <pubDate>Fri, 23 Aug 2019 06:34:00 +0000</pubDate>
        <link>/2019/08/23/safely-storing-git-credentials/</link>
        <guid isPermaLink="true">/2019/08/23/safely-storing-git-credentials/</guid>
        
        <category>git</category>
        
        <category>cryptography</category>
        
        
      </item>
    
      <item>
        <title>Installing latest Python 3.x and PIP on any Debian-based system</title>
        <description>&lt;p&gt;I’m still running Debian Jessie on one of my machines and it bugs me that the latest Python 3 I can install is 3.4, released over 4(!!!) years ago,&lt;br /&gt;
with the latest now being 3.7. Also, pip keeps breaking every time for some reason, so I decided to fix it properly - once and for all!&lt;br /&gt;
&lt;!--more--&gt;&lt;/p&gt;

&lt;nav class=&quot;toc&quot;&gt;
  &lt;h4&gt;Quick Navigation&lt;/h4&gt;
&lt;ul id=&quot;markdown-toc&quot;&gt;
  &lt;li&gt;&lt;a href=&quot;#remove-old-version&quot; id=&quot;markdown-toc-remove-old-version&quot;&gt;Remove old version&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#installing-dependencies&quot; id=&quot;markdown-toc-installing-dependencies&quot;&gt;Installing dependencies&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#building-from-source&quot; id=&quot;markdown-toc-building-from-source&quot;&gt;Building from source&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#creating-aliases&quot; id=&quot;markdown-toc-creating-aliases&quot;&gt;Creating aliases&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#possible-errors&quot; id=&quot;markdown-toc-possible-errors&quot;&gt;Possible errors&lt;/a&gt;    &lt;ul&gt;
      &lt;li&gt;&lt;a href=&quot;#libssl-dev--102&quot; id=&quot;markdown-toc-libssl-dev--102&quot;&gt;libssl-dev &amp;lt; 1.0.2&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#old-gcc-version&quot; id=&quot;markdown-toc-old-gcc-version&quot;&gt;Old gcc version&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#bonus-upgrading-pip&quot; id=&quot;markdown-toc-bonus-upgrading-pip&quot;&gt;Bonus: Upgrading PIP&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;/nav&gt;

&lt;h3 id=&quot;remove-old-version&quot;&gt;Remove old version&lt;/h3&gt;
&lt;ol&gt;
  &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;sudo apt purge python3 python3-pip&lt;/code&gt; → will remove Python 3 and PIP from the system.&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;sudo apt-get autoremove&lt;/code&gt; → will remove all traces of unnecessary dependencies (&lt;code class=&quot;highlighter-rouge&quot;&gt;apt&lt;/code&gt; may not always work).&lt;/li&gt;
&lt;/ol&gt;

&lt;h3 id=&quot;installing-dependencies&quot;&gt;Installing dependencies&lt;/h3&gt;
&lt;p&gt;As noted in &lt;a href=&quot;https://github.com/pyenv/pyenv/wiki/Common-build-problems&quot;&gt;pyenv wiki&lt;/a&gt;:&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;apt &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;build-essential llvm libncurses5-dev libncursesw5-dev wget curl zlib1g-dev libbz2-dev liblzma-dev xz-utils libffi-dev tk-dev libreadline-dev libsqlite3-dev libssl-dev
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://packages.debian.org/jessie/build-essential&quot;&gt;build-essential&lt;/a&gt; → &lt;code class=&quot;highlighter-rouge&quot;&gt;dpkg-dev&lt;/code&gt; &lt;code class=&quot;highlighter-rouge&quot;&gt;g++&lt;/code&gt; &lt;code class=&quot;highlighter-rouge&quot;&gt;gcc&lt;/code&gt; &lt;code class=&quot;highlighter-rouge&quot;&gt;libc-dev&lt;/code&gt; and &lt;code class=&quot;highlighter-rouge&quot;&gt;make&lt;/code&gt;.&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://llvm.org&quot;&gt;llvm&lt;/a&gt; → Compiling optimizer.&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.opencsw.org/package/libncurses5&quot;&gt;libncurses5-dev&lt;/a&gt; and &lt;a href=&quot;https://www.opencsw.org/package/libncursesw5&quot;&gt;libncursesw5-dev&lt;/a&gt; → An implementation of &lt;a href=&quot;https://www.gnu.org/software/ncurses/ncurses.html&quot;&gt;GNU ncurses&lt;/a&gt;.&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/wget&quot;&gt;wget&lt;/a&gt; and &lt;a href=&quot;https://curl.haxx.se&quot;&gt;curl&lt;/a&gt; → Should already be installed. Used for transfering files over the network.&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://packages.debian.org/jessie/zlib1g&quot;&gt;zlib1g-dev&lt;/a&gt;, &lt;a href=&quot;https://packages.debian.org/jessie/libbz2-1.0&quot;&gt;libbz2-dev&lt;/a&gt;, &lt;a href=&quot;https://packages.debian.org/jessie/liblzma-dev&quot;&gt;liblzma-dev&lt;/a&gt; and &lt;a href=&quot;https://tukaani.org/xz&quot;&gt;xz-utils&lt;/a&gt; → Compressors (similar to zip).&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://sourceware.org/libffi&quot;&gt;libffi-dev&lt;/a&gt;, &lt;a href=&quot;https://www.tcl.tk/about/&quot;&gt;tk-dev&lt;/a&gt;, &lt;a href=&quot;https://tiswww.case.edu/php/chet/readline/rltop.html&quot;&gt;libreadline-dev&lt;/a&gt;, &lt;a href=&quot;https://www.sqlite.org&quot;&gt;libsqlite3-dev&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.openssl.org&quot;&gt;libssl-dev&lt;/a&gt; → OpenSSL library. See bottom note on possible errors to make sure the right version is installed (&amp;gt;=1.0.2).&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;building-from-source&quot;&gt;Building from source&lt;/h3&gt;
&lt;ol&gt;
  &lt;li&gt;Obtain the latest version from &lt;a href=&quot;https://www.python.org/ftp/python&quot;&gt;Python.org ftp folder&lt;/a&gt;.&lt;br /&gt;
 We’re looking for a &lt;code class=&quot;highlighter-rouge&quot;&gt;.tgz&lt;/code&gt; file with the name &lt;code class=&quot;highlighter-rouge&quot;&gt;Python-3.x.x.tgz&lt;/code&gt;. For example: &lt;code class=&quot;highlighter-rouge&quot;&gt;Python-3.7.0.tgz&lt;/code&gt;.&lt;br /&gt;
 Copy the link and download it with &lt;code class=&quot;highlighter-rouge&quot;&gt;wget https://www.python.org/ftp/python/3.x.x/Python-3.x.x.tgz&lt;/code&gt;.&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;tar xvf Python-3.x.x.tgz&lt;/code&gt; → Untar it&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;cd  Python-3.x.x&lt;/code&gt; → Enter the folder&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;./configure --enable-optimizations --with-ensurepip=install&lt;/code&gt; → Run configuration with optimizations and install pip flags (those can be removed if unneeded).&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;make&lt;/code&gt; (Can be sped-up with &lt;code class=&quot;highlighter-rouge&quot;&gt;-j4&lt;/code&gt; flag, while 4=no. of cpu cores on the machine)&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;sudo make install&lt;/code&gt; (&lt;a href=&quot;https://docs.python.org/3/using/unix.html#building-python&quot;&gt;The official docs&lt;/a&gt; recommend using &lt;code class=&quot;highlighter-rouge&quot;&gt;altinstall&lt;/code&gt; but since we’re reinstalling everything from scratch, it should be fine).&lt;/li&gt;
&lt;/ol&gt;

&lt;h3 id=&quot;creating-aliases&quot;&gt;Creating aliases&lt;/h3&gt;
&lt;p&gt;By default, Python will install as &lt;code class=&quot;highlighter-rouge&quot;&gt;python3.x&lt;/code&gt; and PIP as &lt;code class=&quot;highlighter-rouge&quot;&gt;pip3.x&lt;/code&gt;. However, it’s also very important to create an alias to &lt;code class=&quot;highlighter-rouge&quot;&gt;python&lt;/code&gt; (and maybe even &lt;code class=&quot;highlighter-rouge&quot;&gt;python3&lt;/code&gt;) since a lot of programs and scripts depend on it.&lt;/p&gt;
&lt;ol&gt;
  &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;whereis python&lt;/code&gt; → First, we look for our current available executable python binaries. Please note that this command will return a lot more than what we actually need. Look for the latest version stored in a &lt;code class=&quot;highlighter-rouge&quot;&gt;bin&lt;/code&gt; folder and maybe also for Python 2.x, if installed. In my case I have &lt;code class=&quot;highlighter-rouge&quot;&gt;/usr/bin/python2.7&lt;/code&gt; for Python 2.7 and &lt;code class=&quot;highlighter-rouge&quot;&gt;/usr/local/bin/python3.7&lt;/code&gt; for Python 3.7.&lt;/li&gt;
  &lt;li&gt;In the following example we setup alias (alternative) that will reside in &lt;code class=&quot;highlighter-rouge&quot;&gt;/usr/bin/python&lt;/code&gt;, will be called &lt;code class=&quot;highlighter-rouge&quot;&gt;python&lt;/code&gt; with priority 50 and 30 for versions 3.7 and 2.7.
    &lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;update-alternatives &lt;span class=&quot;nt&quot;&gt;--install&lt;/span&gt; /usr/bin/python python /usr/local/bin/python3.7 50
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;update-alternatives &lt;span class=&quot;nt&quot;&gt;--install&lt;/span&gt; /usr/bin/python python /usr/bin/python2.7 30
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;And the same can be done for pip:
    &lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;update-alternatives &lt;span class=&quot;nt&quot;&gt;--install&lt;/span&gt; /usr/local/bin/pip pip /usr/local/bin/pip3.7 50
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;update-alternatives &lt;span class=&quot;nt&quot;&gt;--install&lt;/span&gt; /usr/local/bin/pip pip /usr/local/bin/pip2.7 30
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
    &lt;p&gt;&lt;small&gt;&lt;strong&gt;Note:&lt;/strong&gt; Make sure to check first where PIP is located using &lt;code class=&quot;highlighter-rouge&quot;&gt;which pip&lt;/code&gt; (notice that the target is different)&lt;/small&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;Check that both are working:
    &lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;python &lt;span class=&quot;nt&quot;&gt;--version&lt;/span&gt;
Python 3.7.0
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;pip &lt;span class=&quot;nt&quot;&gt;--version&lt;/span&gt;
pip 10.0.1 from /usr/local/lib/python3.7/site-packages/pip &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;python 3.7&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;p class=&quot;small&quot;&gt;&lt;strong&gt;Note:&lt;/strong&gt; Aliases can be changed later on via &lt;code class=&quot;highlighter-rouge&quot;&gt;update-alternatives --config python&lt;/code&gt;&lt;/p&gt;

&lt;h3 id=&quot;possible-errors&quot;&gt;Possible errors&lt;/h3&gt;
&lt;h5 id=&quot;libssl-dev--102&quot;&gt;libssl-dev &amp;lt; 1.0.2&lt;/h5&gt;
&lt;p&gt;After about an hour the &lt;code class=&quot;highlighter-rouge&quot;&gt;make&lt;/code&gt; process finished and I noticed an error:&lt;/p&gt;

&lt;p class=&quot;notice&quot;&gt;Could not build the ssl module!&lt;br /&gt;
Python requires an OpenSSL 1.0.2 or 1.1 compatible libssl with X509_VERIFY_PARAM_set1_host().&lt;br /&gt;
LibreSSL 2.6.4 and earlier do not provide the necessary APIs, https://github.com/libressl-portable/portable/issues/381&lt;/p&gt;

&lt;p&gt;Trying to install anything via &lt;code class=&quot;highlighter-rouge&quot;&gt;pip&lt;/code&gt; resulted in the following error:&lt;/p&gt;

&lt;p class=&quot;notice&quot;&gt;&lt;span style=&quot;color: orange&quot;&gt;pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red&quot;&gt;Could not find a version that satisfies the requirement PACKAGE_NAME (from versions: )&lt;/span&gt;&lt;br /&gt;
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host=’pypi.org’, port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError(“Can’t connect to HTTPS URL because the SSL module is not available.”)) - skipping&lt;/p&gt;

&lt;p&gt;Digging further, I found out that the latest version of &lt;code class=&quot;highlighter-rouge&quot;&gt;libssl-dev&lt;/code&gt; available for jessie official channel was 1.0.1 (via &lt;code class=&quot;highlighter-rouge&quot;&gt;sudo apt-cache policy libssl-dev&lt;/code&gt;).&lt;br /&gt;
In order to fix that I had to do the following:&lt;/p&gt;
&lt;ol&gt;
  &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;sudo echo &quot;deb http://ftp.debian.org/debian jessie-backports jessie main contrib non-free&quot; &amp;gt;&amp;gt; /etc/apt/sources.list&lt;/code&gt; → Add the jessie-backports to apt sources list. (&lt;a href=&quot;https://backports.debian.org/Instructions&quot;&gt;More on backports&lt;/a&gt;)&lt;br /&gt;
&lt;small&gt;&lt;strong&gt;Note:&lt;/strong&gt; Ubuntu Trusty (14.04) users can use &lt;code class=&quot;highlighter-rouge&quot;&gt;deb http://security.ubuntu.com/ubuntu xenial-security main&lt;/code&gt; instead.&lt;/small&gt;&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;sudo apt update&lt;/code&gt; → To acquire date from the new source.&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;sudo apt install -t jessie-backports libssl-dev=1.0.2l-1~bpo8+1&lt;/code&gt; → Reinstall &lt;code class=&quot;highlighter-rouge&quot;&gt;libssl-dev&lt;/code&gt;, this time explicitly defining the source (&lt;code class=&quot;highlighter-rouge&quot;&gt;jessie-backports&lt;/code&gt;) and version (&lt;code class=&quot;highlighter-rouge&quot;&gt;1.0.2l-1~bpo8+1&lt;/code&gt;). If this version is no longer supported, it’s possible to check it with &lt;code class=&quot;highlighter-rouge&quot;&gt;sudo apt-cache policy libssl-dev&lt;/code&gt; or simply passing &lt;code class=&quot;highlighter-rouge&quot;&gt;1.0.2*&lt;/code&gt; as the version.&lt;/li&gt;
  &lt;li&gt;Recomile Python again :(&lt;br /&gt;
&lt;small&gt;&lt;strong&gt;Note:&lt;/strong&gt; The easiest way would be to remove the untarred &lt;code class=&quot;highlighter-rouge&quot;&gt;Python-3.x.x&lt;/code&gt; folder, untar it again and restart the process from there.&lt;/small&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h5 id=&quot;old-gcc-version&quot;&gt;Old gcc version&lt;/h5&gt;
&lt;p&gt;The latest version of gcc (the C compiler) on Ubuntu Trusty (14.04) is 4.8.2 and this is the error I got while running &lt;code class=&quot;highlighter-rouge&quot;&gt;make&lt;/code&gt;:&lt;/p&gt;

&lt;p class=&quot;notice&quot;&gt;Current thread 0x00002aba1f9b8400 (most recent call first):&lt;br /&gt;
Aborted&lt;br /&gt;
generate-posix-vars failed&lt;br /&gt;
make[1]: *** [pybuilddir.txt] Error 1&lt;br /&gt;
make[1]: Leaving directory `/home/ubuntu/workspace/Python-3.7.0’&lt;br /&gt;
make: *** [profile-opt] Error 2&lt;/p&gt;

&lt;p&gt;In order to fix that we need at least version 4.9.2 (from my experience), but if we’re upgrading, we might as well upgrade to the latest version, right?&lt;br /&gt;
Fortunately, there’s &lt;a href=&quot;https://launchpad.net/~ubuntu-toolchain-r/+archive/ubuntu/test&quot;&gt;a ppa&lt;/a&gt; that contains a backlog of all gcc versions from 4 to 8.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;add-apt-repository ppa:ubuntu-toolchain-r/test
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;apt update
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;apt &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;gcc-8
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;So we add the new ppa, refresh the database and install the latest gcc version 8. (I recommend checking the ppa link first to see if there’s an updated version)&lt;br /&gt;
Next, it’s important to make sure that &lt;code class=&quot;highlighter-rouge&quot;&gt;gcc&lt;/code&gt; is tied to the new version:&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;update-alternatives &lt;span class=&quot;nt&quot;&gt;--install&lt;/span&gt; /usr/bin/gcc gcc /usr/bin/gcc-8 50
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; On some Ubuntu systems &lt;code class=&quot;highlighter-rouge&quot;&gt;apt-add-repository&lt;/code&gt; may not be present and can be installed via &lt;code class=&quot;highlighter-rouge&quot;&gt;sudo apt install software-properties-common&lt;/code&gt;.&lt;br /&gt;
Alternatively (or if the above command is broken for some reason), it’s possible to manually add the ppa:&lt;br /&gt;
&lt;code class=&quot;highlighter-rouge&quot;&gt;sudo echo &quot;deb http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu trusty main&quot; &amp;gt;&amp;gt; /etc/apt/sources.list&lt;/code&gt; (Mind the &lt;code class=&quot;highlighter-rouge&quot;&gt;trusty&lt;/code&gt; part).&lt;br /&gt;
Then, add the signing key (otherwise &lt;code class=&quot;highlighter-rouge&quot;&gt;apt update&lt;/code&gt; will give an error):&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;gpg &lt;span class=&quot;nt&quot;&gt;--ignore-time-conflict&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--no-options&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--no-default-keyring&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--secret-keyring&lt;/span&gt; /etc/apt/securing.gpg &lt;span class=&quot;nt&quot;&gt;--trustdb-name&lt;/span&gt; /etc/apt/trustdb.gpg &lt;span class=&quot;nt&quot;&gt;--keyring&lt;/span&gt; /etc/apt/trusted.gpg &lt;span class=&quot;nt&quot;&gt;--keyserver&lt;/span&gt; keyserver.ubuntu.com &lt;span class=&quot;nt&quot;&gt;--recv&lt;/span&gt; 60C317803A41BA51845E371A1E9377A2BA9EF27F
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;The signing key can be found under “Technical details about this PPA” on the &lt;a href=&quot;https://launchpad.net/~ubuntu-toolchain-r/+archive/ubuntu/test&quot;&gt;ppa page&lt;/a&gt;.&lt;/p&gt;

&lt;h3 id=&quot;bonus-upgrading-pip&quot;&gt;Bonus: Upgrading PIP&lt;/h3&gt;
&lt;p&gt;PIP versions are not always in par with the latest Python version, so an annoying notice may appear whenever installing packages:&lt;/p&gt;

&lt;p class=&quot;notice&quot;&gt;&lt;span style=&quot;color: orange&quot;&gt;
You are using pip version 10.0.1, however version 18.0 is available.&lt;br /&gt;
You should consider upgrading via the ‘pip install –upgrade pip’ command.
&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;So let’s do it ;) &lt;code class=&quot;highlighter-rouge&quot;&gt;sudo pip install --upgrade pip&lt;/code&gt;&lt;/p&gt;

</description>
        <pubDate>Mon, 10 Sep 2018 00:00:00 +0000</pubDate>
        <link>/2018/09/10/installing-latest-python-3x-and-pip-on-any-debian-based-system/</link>
        <guid isPermaLink="true">/2018/09/10/installing-latest-python-3x-and-pip-on-any-debian-based-system/</guid>
        
        <category>linux</category>
        
        <category>python</category>
        
        <category>pip</category>
        
        
      </item>
    
      <item>
        <title>Performance of CSS animations</title>
        <description>&lt;p&gt;When I worked on adding a “scroll to top” button to this blog today, I was surprised to find out about performance issues with CSS animations. I always considered CSS to be lighweight and fast, unlike JavaScript (or more accurately, jQuery), but apparently not everything is as simple as it looks.&lt;br /&gt;
&lt;!--more--&gt;&lt;br /&gt;
I was playing around with the following CSS code:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;
  &lt;pre&gt;&lt;code class=&quot;language-css&quot; data-lang=&quot;css&quot;&gt;&lt;span class=&quot;nf&quot;&gt;#scrollToTop&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nl&quot;&gt;bottom&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;-2.5em&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;nl&quot;&gt;animation&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;slideFromBottom&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0.8s&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ease&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;both&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;@keyframes&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;slideFromBottom&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;bottom&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0.9em&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;

&lt;p&gt;That went along with this JavaScript:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;
  &lt;pre&gt;&lt;code class=&quot;language-js&quot; data-lang=&quot;js&quot;&gt;&lt;span class=&quot;nb&quot;&gt;window&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;onscroll&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;scrollFunction&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;scrollFunction&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;window&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;scrollY&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;window&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;innerHeight&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;nb&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;getElementById&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;scrollToTop&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;display&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;block&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;nb&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;getElementById&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;scrollToTop&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;display&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;none&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;

&lt;p&gt;Nothing fancy there, really. The button &lt;code class=&quot;highlighter-rouge&quot;&gt;#scrollToTop&lt;/code&gt; is hidden from sight when loaded, and when the distance from top is greater than the screen size (i.e. one screen has been scrolled) it pops out by changing distance from bottom with a nice animation.&lt;br /&gt;
It worked, of course. No surprise there. But then I picked up my smartphone to check how it looked there, and here’s how it was performing on Chrome:&lt;br /&gt;
&lt;img src=&quot;/img/performance-of-css-animations-mobile.png&quot; alt=&quot;Performance on Chrome (Mobile)&quot; class=&quot;gif&quot; data-mode=&quot;video&quot; /&gt;&lt;/p&gt;

&lt;p&gt;In comparison, this is how it performs on Firefox on my desktop:&lt;br /&gt;
&lt;img src=&quot;/img/performance-of-css-animations-desktop.png&quot; alt=&quot;Performance on Firefox (Desktop)&quot; class=&quot;gif&quot; data-mode=&quot;video&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Looking into it, I learned about &lt;code class=&quot;highlighter-rouge&quot;&gt;will-change&lt;/code&gt; CSS property. It’s &lt;em&gt;supposed&lt;/em&gt; to tell the browser which elements are about to be changed, to let it prepare resources for processing them. I tried using &lt;code class=&quot;highlighter-rouge&quot;&gt;will-change: animation&lt;/code&gt;, &lt;code class=&quot;highlighter-rouge&quot;&gt;will-change: bottom&lt;/code&gt; and even &lt;code class=&quot;highlighter-rouge&quot;&gt;will-change: all&lt;/code&gt;, but performance didn’t improve.&lt;br /&gt;
Reading about &lt;code class=&quot;highlighter-rouge&quot;&gt;will-change&lt;/code&gt; I noticed that it’s usually used with the &lt;code class=&quot;highlighter-rouge&quot;&gt;transform&lt;/code&gt; property, so I decided to try and give it a shot, and… voila!&lt;/p&gt;

&lt;p&gt;Apparenly, &lt;code class=&quot;highlighter-rouge&quot;&gt;transform&lt;/code&gt; properties are more tuned for GPU acceleration, which is widely used by mobile browsers. The more you know…&lt;/p&gt;

&lt;p&gt;Oh, and those curious to see how it ended up, here it is:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;
  &lt;pre&gt;&lt;code class=&quot;language-scss&quot; data-lang=&quot;scss&quot;&gt;&lt;span class=&quot;nn&quot;&gt;#scrollToTop&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nl&quot;&gt;background-color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$background-color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;nl&quot;&gt;position&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;fixed&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;nl&quot;&gt;bottom&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;.9em&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;nl&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;.9em&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;nl&quot;&gt;border&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;none&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;nl&quot;&gt;outline&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;none&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;nl&quot;&gt;cursor&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;pointer&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;nl&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;.1em&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;.7em&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;nl&quot;&gt;border-radius&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;50%&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;nl&quot;&gt;box-shadow&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;inset&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;-1px&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;-2px&lt;/span&gt; &lt;span class=&quot;mh&quot;&gt;#1b1b1b&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;nl&quot;&gt;z-index&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;999&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;will-change&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;transform&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;nl&quot;&gt;transform&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;translateY&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;70px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;nl&quot;&gt;transition&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;transform&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0s&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ease&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;

&lt;figure class=&quot;highlight&quot;&gt;
  &lt;pre&gt;&lt;code class=&quot;language-js&quot; data-lang=&quot;js&quot;&gt;&lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;isDesktop&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;scrollElement&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;distanceFromTop&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;window&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;onload&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;scrollFunction&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;window&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;onresize&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;scrollFunction&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;setVars&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;isDesktop&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;window&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;innerWidth&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;992&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;?&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;true&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;scrollElement&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;isDesktop&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;?&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;getElementById&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;posts&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;window&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;distanceFromTop&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;isDesktop&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;?&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;scrollElement&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;scrollTop&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;scrollElement&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;scrollY&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;scrollElement&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;onscroll&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;scrollFunction&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;scrollFunction&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;setVars&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;distance&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;70&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;distanceFromTop&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;documentElement&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;clientHeight&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;distance&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;distance&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;?&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;distance&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;getElementById&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;scrollToTop&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;transform&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;translateY(&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;distance&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;px)&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;

&lt;p&gt;By the way, I tweaked the appearance logic a little bit to follow the page scroll.&lt;br /&gt;
Also, the responsive nature of this blog’s design forced me to bind the scroll event to different elements, based on screen width (that’s what &lt;code class=&quot;highlighter-rouge&quot;&gt;setVars()&lt;/code&gt; is for).&lt;/p&gt;
</description>
        <pubDate>Thu, 24 May 2018 00:00:00 +0000</pubDate>
        <link>/2018/05/24/performance-of-css-animations/</link>
        <guid isPermaLink="true">/2018/05/24/performance-of-css-animations/</guid>
        
        <category>css</category>
        
        
      </item>
    
      <item>
        <title>My Manjaro KDE setup</title>
        <description>&lt;p&gt;After using Debian and its descendants for a long time I thought I’d never change anything, but then, on a whim, I decided to just “try” and see what the guys on the Arch side of the Linux big lane have got to offer.&lt;br /&gt;
It was actually when I tried Manjaro Linux Live USB last year that got me all excited for this specific distribution, and then falling in love with &lt;a href=&quot;https://kubuntu.org&quot;&gt;Kubuntu’s&lt;/a&gt; new Plasma desktop (after literally 5 years of not touching it), that got me to choose the KDE flavor of Manjaro.&lt;br /&gt;
It was two weeks ago, when I created a new partition on my main machine, alongside the XFCE edition of &lt;a href=&quot;https://linuxmint.com&quot;&gt;Linux Mint&lt;/a&gt; which I was using as my daily driver (and hated almost every bit of it, btw), grabbed and installed the Manjaro KDE image, and have been using it since then.&lt;br /&gt;
And guess what? I absolutely LOVE it. And only after this short period of time, I don’t see myself going back to Debian any time soon, if at all. More than that, I even think of migrating my other machines to Arch Linux whenever I have the chance to do it. The reason for that basically comes down to the &lt;a href=&quot;https://wiki.archlinux.org/index.php/pacman&quot;&gt;pacman package manager&lt;/a&gt;, the simply amazing documentation of Arch Linux and the absolute customizability of KDE.&lt;br /&gt;
&lt;!--more--&gt;&lt;br /&gt;
I will not go on details regarding those, and other benefits such as &lt;a href=&quot;https://en.wikipedia.org/wiki/Rolling_release&quot;&gt;rolling release&lt;/a&gt;. Instead, in this post I’m going to document my configuration, installed software and tweaks I’ve been applying to my system. Not for anyone to replicate my setup (although it’s also possible), but to inspire, so anyone can take from it whatever they think is for them.&lt;br /&gt;
I will also try to keep this post updated with further changes and improvements I do down the road.&lt;/p&gt;

&lt;nav class=&quot;toc&quot;&gt;
  &lt;h4&gt;Quick Navigation&lt;/h4&gt;
&lt;ul id=&quot;markdown-toc&quot;&gt;
  &lt;li&gt;&lt;a href=&quot;#installed-software&quot; id=&quot;markdown-toc-installed-software&quot;&gt;Installed software&lt;/a&gt;    &lt;ul&gt;
      &lt;li&gt;&lt;a href=&quot;#package-managers&quot; id=&quot;markdown-toc-package-managers&quot;&gt;Package Managers&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#cli-tools&quot; id=&quot;markdown-toc-cli-tools&quot;&gt;CLI Tools&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#system-stuff&quot; id=&quot;markdown-toc-system-stuff&quot;&gt;System Stuff&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#gui-software&quot; id=&quot;markdown-toc-gui-software&quot;&gt;GUI Software&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#dolphin-service-menu--kde-applets&quot; id=&quot;markdown-toc-dolphin-service-menu--kde-applets&quot;&gt;Dolphin Service Menu &amp;amp; KDE Applets&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#removed-software&quot; id=&quot;markdown-toc-removed-software&quot;&gt;Removed Software&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#theme-and-icons&quot; id=&quot;markdown-toc-theme-and-icons&quot;&gt;Theme and Icons&lt;/a&gt;    &lt;ul&gt;
      &lt;li&gt;&lt;a href=&quot;#how-to-apply-everything-correctly&quot; id=&quot;markdown-toc-how-to-apply-everything-correctly&quot;&gt;How to apply everything correctly&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#ime&quot; id=&quot;markdown-toc-ime&quot;&gt;IME&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#tweaks-and-fixes&quot; id=&quot;markdown-toc-tweaks-and-fixes&quot;&gt;Tweaks and Fixes&lt;/a&gt;    &lt;ul&gt;
      &lt;li&gt;&lt;a href=&quot;#team-viewer&quot; id=&quot;markdown-toc-team-viewer&quot;&gt;Team Viewer&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#autokey&quot; id=&quot;markdown-toc-autokey&quot;&gt;Autokey&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#set-local-server-mirrors-to-pacman&quot; id=&quot;markdown-toc-set-local-server-mirrors-to-pacman&quot;&gt;Set local server mirrors to pacman&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#some-bashrc-aliases&quot; id=&quot;markdown-toc-some-bashrc-aliases&quot;&gt;Some &lt;code class=&quot;highlighter-rouge&quot;&gt;bashrc&lt;/code&gt; aliases&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#system-settings&quot; id=&quot;markdown-toc-system-settings&quot;&gt;System Settings&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#bringing-back-transfer-dialog-boxes&quot; id=&quot;markdown-toc-bringing-back-transfer-dialog-boxes&quot;&gt;Bringing back transfer dialog boxes&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#lower-timeout-and-smaller--osds&quot; id=&quot;markdown-toc-lower-timeout-and-smaller--osds&quot;&gt;Lower timeout and smaller  OSDs&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#add-custom-scripts-to-dolphin-service-menu&quot; id=&quot;markdown-toc-add-custom-scripts-to-dolphin-service-menu&quot;&gt;Add custom scripts to Dolphin Service Menu&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#per-activity-browser-profiles&quot; id=&quot;markdown-toc-per-activity-browser-profiles&quot;&gt;Per-Activity browser profiles&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#per-app-gtk3-theme&quot; id=&quot;markdown-toc-per-app-gtk3-theme&quot;&gt;Per-app GTK3 theme&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;/nav&gt;

&lt;h3 id=&quot;installed-software&quot;&gt;Installed software&lt;/h3&gt;
&lt;p&gt;Just a quick note: All applications are available as pacman and/or AUR packages. I installed nothing manually, and for anything that wasn’t available I created and uploaded an AUR package to the repository.&lt;/p&gt;

&lt;h4 id=&quot;package-managers&quot;&gt;Package Managers&lt;/h4&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://archlinux.fr/yaourt-en&quot;&gt;yaourt&lt;/a&gt; → It’s basically a piece of software complimentary to pacman.&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;yaourt-gui&lt;/code&gt; → While saying “GUI” in the name, it’s actually terminal-based. I use it all the time: option 9 to install new software and option 5 to remove.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4 id=&quot;cli-tools&quot;&gt;CLI Tools&lt;/h4&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://iperf.fr&quot;&gt;iperf3&lt;/a&gt; → An amazing tool for measuring transfer speeds and troubleshooting networks.&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.mono-project.com&quot;&gt;mono&lt;/a&gt; → Sometimes I need to run little .NET applications, so this comes in handy.&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://wiki.linuxfoundation.org/networking/net-tools&quot;&gt;net-tools&lt;/a&gt; → I mainly use it for &lt;code class=&quot;highlighter-rouge&quot;&gt;ifconfig&lt;/code&gt; command.&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://mkvtoolnix.download&quot;&gt;mkvtoolnix-cli&lt;/a&gt; → A handy tool for muxing and demuxing video files.&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/laurent22/massren&quot;&gt;massren&lt;/a&gt; → This one I discovered quite recently. It lets the user rename files inside a text editor. Very handy if the editor supports &lt;a href=&quot;https://en.wikipedia.org/wiki/Simultaneous_editing&quot;&gt;muli-cursor editing&lt;/a&gt;. &lt;strong&gt;Beware:&lt;/strong&gt; To install this one, the Go language package (~300 MB) needs to be installed. It can be removed after &lt;code class=&quot;highlighter-rouge&quot;&gt;massren&lt;/code&gt; has been compiled and installed.&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/scop/bash-completion&quot;&gt;bash-completion&lt;/a&gt; → This guy is a real time saver! It extends the usual completion from just commands to also their options.&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/aplatanado/yakuake-session&quot;&gt;yakuake-session&lt;/a&gt; → A script that allow for automatic creation of Yakuake sessions. (More on Yakuake in GUI Software section)&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.passwordstore.org&quot;&gt;pass&lt;/a&gt; → Great tool for privately managing passwords.&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/stow/manual/stow.html&quot;&gt;stow&lt;/a&gt; → For managing dotfiles&lt;/li&gt;
&lt;/ul&gt;

&lt;h4 id=&quot;system-stuff&quot;&gt;System Stuff&lt;/h4&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;libva-intel-driver&lt;/code&gt; → This one is extremely important for video playback on Intel Graphics devices.&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;libva-utils&lt;/code&gt;  → I use this one for its &lt;code class=&quot;highlighter-rouge&quot;&gt;vainfo&lt;/code&gt; tool, that confirm the integrity of the display driver and shows its hardware decoding capabilities.&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;nfs-utils&lt;/code&gt; → For mounting NFS shares :)&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;ttf-ms-fonts&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h4 id=&quot;gui-software&quot;&gt;GUI Software&lt;/h4&gt;
&lt;ul&gt;
  &lt;li&gt;Web browser: &lt;img src=&quot;/img/icon-opera.png&quot; alt=&quot;opera&quot; /&gt; &lt;a href=&quot;http://opera.com&quot;&gt;opera&lt;/a&gt; → My go-to web browser for the past 10 years or so.&lt;/li&gt;
  &lt;li&gt;Media Player: &lt;img src=&quot;/img/icon-mpv.png&quot; alt=&quot;mpv&quot; /&gt; &lt;a href=&quot;https://mpv.io&quot;&gt;mpv&lt;/a&gt; → Those who still use VLC these days really don’t know what they’re missing…&lt;/li&gt;
  &lt;li&gt;Instant Messaging: &lt;img src=&quot;/img/icon-telegram.png&quot; alt=&quot;telegram&quot; /&gt; &lt;a href=&quot;https://telegram.org&quot;&gt;telegram&lt;/a&gt; → It’s the best instant messaging app. Period.&lt;/li&gt;
  &lt;li&gt;Text Editors: &lt;img src=&quot;/img/icon-atom.png&quot; alt=&quot;atom&quot; /&gt; &lt;a href=&quot;https://atom.io&quot;&gt;atom&lt;/a&gt; and &lt;img src=&quot;/img/icon-kate.png&quot; alt=&quot;kate&quot; /&gt; &lt;a href=&quot;https://www.kde.org/applications/utilities/kate&quot;&gt;kate&lt;/a&gt; → Kate comes built-in with KDE.&lt;/li&gt;
  &lt;li&gt;Terminal: &lt;img src=&quot;/img/icon-yakuake.png&quot; alt=&quot;yakuake&quot; /&gt; &lt;a href=&quot;https://www.kde.org/applications/system/yakuake&quot;&gt;yakuake&lt;/a&gt; → I’ve been looking for a replacement for Guake terminal for quite some time now. Who thought it would come pre-installed with KDE!&lt;/li&gt;
  &lt;li&gt;Music: &lt;img src=&quot;/img/icon-headset.png&quot; alt=&quot;headset&quot; /&gt; &lt;a href=&quot;https://headsetapp.co&quot;&gt;headset&lt;/a&gt;, &lt;img src=&quot;/img/icon-gpmdp.png&quot; alt=&quot;gpmdp&quot; /&gt; &lt;a href=&quot;https://www.googleplaymusicdesktopplayer.com&quot;&gt;gpmdp&lt;/a&gt; and &lt;img src=&quot;/img/icon-google-musicmanager.png&quot; alt=&quot;google-musicmanager&quot; /&gt; &lt;a href=&quot;https://aur.archlinux.org/packages/google-musicmanager&quot;&gt;google-musicmanager&lt;/a&gt;.&lt;/li&gt;
  &lt;li&gt;Image processing: &lt;img src=&quot;/img/icon-krita.png&quot; alt=&quot;krita&quot; /&gt; &lt;a href=&quot;https://krita.org&quot;&gt;krita&lt;/a&gt; → Nothing is like Photoshop, but this one is the closest one on Linux… (Don’t even dare to mention &lt;a href=&quot;https://www.gimp.org&quot;&gt;Gimp&lt;/a&gt;).&lt;/li&gt;
  &lt;li&gt;Launcher: &lt;img src=&quot;/img/icon-ulauncher.png&quot; alt=&quot;ulauncher&quot; /&gt; &lt;a href=&quot;https://ulauncher.io&quot;&gt;ulauncher&lt;/a&gt; → While I like the built-in Krunner, something about Ulauncher just makes me want to use it.&lt;/li&gt;
  &lt;li&gt;Clipboard Manager: &lt;img src=&quot;/img/icon-clipit.png&quot; alt=&quot;clipit&quot; /&gt; &lt;a href=&quot;https://github.com/CristianHenzel/ClipIt&quot;&gt;clipit&lt;/a&gt; → The clipboard manager in KDE just won’t do… This one actually allows pasting the content right after choosing an history item and its actions feature is actually useful.&lt;/li&gt;
  &lt;li&gt;Comic Reader: &lt;img src=&quot;/img/icon-yacreader.png&quot; alt=&quot;yacreader&quot; /&gt; &lt;a href=&quot;http://yacreader.com&quot;&gt;yacreader&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;Others:
    &lt;ul&gt;
      &lt;li&gt;&lt;img src=&quot;/img/icon-avidemux.png&quot; alt=&quot;avidemux&quot; /&gt; &lt;a href=&quot;http://avidemux.sourceforge.net&quot;&gt;avidemux&lt;/a&gt; → For casual video editing.&lt;/li&gt;
      &lt;li&gt;&lt;img src=&quot;/img/icon-wavebox.png&quot; alt=&quot;wavebox&quot; /&gt; &lt;a href=&quot;https://wavebox.io&quot;&gt;wavebox&lt;/a&gt; → It’s like a Swiss Army Knife for web applications. Quite resource-heavy though.&lt;/li&gt;
      &lt;li&gt;&lt;img src=&quot;/img/icon-aegisub.png&quot; alt=&quot;aegisub&quot; /&gt; &lt;a href=&quot;http://www.aegisub.org&quot;&gt;aegisub&lt;/a&gt; → Best subtitles editor.&lt;/li&gt;
      &lt;li&gt;&lt;img src=&quot;/img/icon-syncplay.png&quot; alt=&quot;syncplay&quot; /&gt; &lt;a href=&quot;https://syncplay.pl&quot;&gt;syncplay&lt;/a&gt; → Watching videos together!&lt;/li&gt;
      &lt;li&gt;&lt;img src=&quot;/img/icon-autokey.png&quot; alt=&quot;autokey&quot; /&gt; &lt;a href=&quot;https://github.com/autokey/autokey&quot;&gt;autokey&lt;/a&gt; → Great application for keyboard automation. Should be noted that the QT version is broken so only GTK on this one.&lt;/li&gt;
      &lt;li&gt;&lt;img src=&quot;/img/icon-barrier.png&quot; alt=&quot;barrier&quot; /&gt; &lt;a href=&quot;https://github.com/debauchee/barrier&quot;&gt;barrier&lt;/a&gt; → I can’t say how happy I am that someone picked up the open-source &lt;a href=&quot;https://symless.com/synergy&quot;&gt;Synergy&lt;/a&gt; project.&lt;/li&gt;
      &lt;li&gt;&lt;img src=&quot;/img/icon-deluge.png&quot; alt=&quot;deluge&quot; /&gt; &lt;a href=&quot;https://deluge-torrent.org&quot;&gt;deluge&lt;/a&gt; → I use this to control remote clients. My ISP won’t allow torrenting :(&lt;/li&gt;
      &lt;li&gt;&lt;img src=&quot;/img/icon-fsearch.png&quot; alt=&quot;fsearch&quot; /&gt; &lt;a href=&quot;http://www.fsearch.org&quot;&gt;fsearch-git&lt;/a&gt; → The closest one can get to Everything on Linux.&lt;/li&gt;
      &lt;li&gt;&lt;img src=&quot;/img/icon-teamviewer.png&quot; alt=&quot;teamviewer&quot; /&gt; &lt;a href=&quot;https://www.teamviewer.com&quot;&gt;teamviewer&lt;/a&gt; → Controlling remote machines without opening ports.&lt;/li&gt;
      &lt;li&gt;&lt;img src=&quot;/img/icon-tagainijisho.png&quot; alt=&quot;tagainijisho&quot; /&gt; &lt;a href=&quot;https://www.tagaini.net&quot;&gt;tagainijisho&lt;/a&gt; → Japanese-English dictionary. It’s okay, but could be better.&lt;/li&gt;
      &lt;li&gt;&lt;img src=&quot;/img/icon-peek.png&quot; alt=&quot;peek&quot; /&gt; &lt;a href=&quot;https://github.com/phw/peek&quot;&gt;peek&lt;/a&gt; → Screen capture app… Sort of.&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;https://qtpass.org&quot;&gt;qtpass&lt;/a&gt; → GUI manager for &lt;code class=&quot;highlighter-rouge&quot;&gt;pass&lt;/code&gt;.&lt;/li&gt;
      &lt;li&gt;KDE’s &lt;a href=&quot;https://www.kde.org/applications/development/kompare&quot;&gt;kompare&lt;/a&gt;, &lt;a href=&quot;http://www.krename.net/home&quot;&gt;krename&lt;/a&gt;, and &lt;a href=&quot;https://www.kde.org/applications/utilities/kbackup&quot;&gt;kbackup&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;Not really GUI software, but…  &lt;a href=&quot;https://syncthing.net&quot;&gt;syncthing&lt;/a&gt; for syncing stuff and &lt;a href=&quot;http://jonls.dk/redshift&quot;&gt;redshift&lt;/a&gt; for blocking blue light at night.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h4 id=&quot;dolphin-service-menu--kde-applets&quot;&gt;Dolphin Service Menu &amp;amp; KDE Applets&lt;/h4&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://store.kde.org/p/998445&quot;&gt;kde-servicemenus-getmediainfo&lt;/a&gt; → Right-click on any video file to get detailed info about it.&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/udeved/kde-servicemenus-pkg-tools&quot;&gt;kde-servicemenus-pkg-tools&lt;/a&gt; → Extremely helpful with building Arch Packages.&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://store.kde.org/p/1231579&quot;&gt;kde-service-menu-reimage&lt;/a&gt; → Image manipulation using &lt;code class=&quot;highlighter-rouge&quot;&gt;imagemagick&lt;/code&gt;. Very handy!&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/Martchus/syncthingtray&quot;&gt;syncthingtray&lt;/a&gt; → A great system tray applet for managing Syncthing. Will also register a Service Menu for Dolphin. Can do multiple servers as well!&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/kotelnik/plasma-applet-redshift-control&quot;&gt;plasma5-applets-redshift-control&lt;/a&gt; → A great tray applet for managing Redshift. So great that it’s probably going to be part of KDE soon!&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;removed-software&quot;&gt;Removed Software&lt;/h3&gt;
&lt;p&gt;Some packages that come pre-installed with Manjaro KDE have no use for me, and I removed them:&lt;br /&gt;
&lt;code class=&quot;highlighter-rouge&quot;&gt;steam-manjaro&lt;/code&gt;, &lt;code class=&quot;highlighter-rouge&quot;&gt;libreoffice-fresh&lt;/code&gt;, &lt;code class=&quot;highlighter-rouge&quot;&gt;konversation&lt;/code&gt;, &lt;code class=&quot;highlighter-rouge&quot;&gt;skanlite&lt;/code&gt;, &lt;code class=&quot;highlighter-rouge&quot;&gt;thunderbird&lt;/code&gt;, &lt;code class=&quot;highlighter-rouge&quot;&gt;inkscape&lt;/code&gt;,  &lt;code class=&quot;highlighter-rouge&quot;&gt;qbittorrent&lt;/code&gt;, &lt;code class=&quot;highlighter-rouge&quot;&gt;print-manager&lt;/code&gt;, &lt;code class=&quot;highlighter-rouge&quot;&gt;hplip&lt;/code&gt; (w/o dependencies)&lt;/p&gt;

&lt;h3 id=&quot;theme-and-icons&quot;&gt;Theme and Icons&lt;/h3&gt;
&lt;p&gt;It’s not a great setup without a good theme.&lt;br /&gt;
I always prefer dark themes, and for this one I chose &lt;a href=&quot;https://github.com/adapta-project/adapta-gtk-theme&quot;&gt;Adapta&lt;/a&gt; (actually Adapta-Nokto), which I’ve been adoring pretty much ever since it came out.&lt;br /&gt;
Adapta was originally designed for being a GTK theme, but there’s &lt;a href=&quot;https://github.com/PapirusDevelopmentTeam/adapta-kde&quot;&gt;a separate project for KDE&lt;/a&gt;.&lt;br /&gt;
I ended up installing both &lt;code class=&quot;highlighter-rouge&quot;&gt;adapta-kde&lt;/code&gt; and &lt;code class=&quot;highlighter-rouge&quot;&gt;adapta-gtk-theme&lt;/code&gt; for unifying the look on all applications.&lt;br /&gt;
For the icon set I went with Adapta’s complementary &lt;code class=&quot;highlighter-rouge&quot;&gt;papirus-maia-icon-theme&lt;/code&gt; which is the Manjaro-flavor of &lt;a href=&quot;https://github.com/PapirusDevelopmentTeam/papirus-icon-theme&quot;&gt;papirus-icon-theme&lt;/a&gt; (green instead of blue main color).&lt;/p&gt;

&lt;h5 id=&quot;how-to-apply-everything-correctly&quot;&gt;How to apply everything correctly&lt;/h5&gt;
&lt;p&gt;Now I don’t know why it has to be like that, but setting a theme on any Linux distribution I’ve used so far always has to be complicated. Even if the main theme is set to the desired one, there are other places where the configuration need to be set.&lt;br /&gt;
Here’s how to do it correctly (all options in System Settings):&lt;/p&gt;
&lt;ol&gt;
  &lt;li&gt;Workspace Theme:
    &lt;ul&gt;
      &lt;li&gt;Look And Feel → Adapta&lt;/li&gt;
      &lt;li&gt;Desktop Theme → Adapta&lt;/li&gt;
      &lt;li&gt;Splash Screen → Adapta&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Colors → Adapta Nokto, check “Apply colors to non-Qt applications”&lt;/li&gt;
  &lt;li&gt;Icons → Papirus-Adapta-Nokto-Maia&lt;/li&gt;
  &lt;li&gt;Application Style:
    &lt;ul&gt;
      &lt;li&gt;Widget Style → Skip for now&lt;/li&gt;
      &lt;li&gt;Window Decorations → Adapta&lt;/li&gt;
      &lt;li&gt;GNOME Application Style (GTK):
        &lt;ul&gt;
          &lt;li&gt;Set both GTK2 and GTK2 themes to Adapta-Nokto&lt;/li&gt;
          &lt;li&gt;Icon theme → Papirus-Adapta-Nokto-Maia&lt;/li&gt;
          &lt;li&gt;Fallback Theme → Breeze Dark (better be safe here)&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Here’s where things get more complicated. KDE also has a theme engine called Kvantum, which cannot be easily changed. Fortunately, there’s an application for that! &lt;code class=&quot;highlighter-rouge&quot;&gt;kvantum-qt5&lt;/code&gt; will add “kvantum” and “kvantum-dark” to Application Style → Widget Style. Choose “kvantum-dark” and head over to the Kvantum Manager application → Change/Delete Theme → KvAdaptaDark.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;img src=&quot;/img/kde-adapta-theme.png&quot; alt=&quot;KDE Adapta-Nokto Theme&quot; /&gt; &lt;em&gt;Not too shabby, eh?&lt;/em&gt;&lt;/p&gt;

&lt;h3 id=&quot;ime&quot;&gt;IME&lt;/h3&gt;
&lt;p&gt;I also use Japanese as a language, and anyone who has tried installing Japanese IME on Linux know how hard it can be. I’ll try to keep it simple.&lt;br /&gt;
First I grabbed the following packages: &lt;code class=&quot;highlighter-rouge&quot;&gt;fcitx&lt;/code&gt; &lt;code class=&quot;highlighter-rouge&quot;&gt;fcitx-mozc&lt;/code&gt; &lt;code class=&quot;highlighter-rouge&quot;&gt;fcitx-gtk2&lt;/code&gt; &lt;code class=&quot;highlighter-rouge&quot;&gt;fcitx-gtk3&lt;/code&gt; &lt;code class=&quot;highlighter-rouge&quot;&gt;fcitx-qt4&lt;/code&gt; &lt;code class=&quot;highlighter-rouge&quot;&gt;fcitx-qt5&lt;/code&gt; &lt;code class=&quot;highlighter-rouge&quot;&gt;kcm-fcitx&lt;/code&gt;.&lt;br /&gt;
Then, I added the following to &lt;code class=&quot;highlighter-rouge&quot;&gt;~/.xprofile&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;XMODIFIERS&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;@im=fcitx&quot;&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;XMODIFIER&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;@im=fcitx&quot;&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;GTK_IM_MODULE&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;fcitx
&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;QT_IM_MODULE&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;fcitx
&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;DefaultIMModule&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;fcitx
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Lastly, it’s important to disable the system IME management:&lt;br /&gt;
Settings → Input Devices → Keyboard → Layouts&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Untick all from Layout Indicator.&lt;/li&gt;
  &lt;li&gt;Reset all shortcuts to None.&lt;/li&gt;
  &lt;li&gt;Untick “Configure layouts”.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;tweaks-and-fixes&quot;&gt;Tweaks and Fixes&lt;/h3&gt;
&lt;p&gt;Before we begin, some changes to the KDE interface will require a full system restart. However, it’s also possible to apply them  immediately by restarting &lt;code class=&quot;highlighter-rouge&quot;&gt;plasmashell&lt;/code&gt; only: &lt;code class=&quot;highlighter-rouge&quot;&gt;kquitapp5 plasmashell &amp;amp;&amp;amp; kstart plasmashell&lt;/code&gt;.&lt;/p&gt;

&lt;h5 id=&quot;team-viewer&quot;&gt;Team Viewer&lt;/h5&gt;
&lt;p&gt;Team viewer won’t work right after without a reboot. However, it’s possible to force it to start with &lt;code class=&quot;highlighter-rouge&quot;&gt;sudo teamviewer --daemon enable&lt;/code&gt;.&lt;/p&gt;

&lt;h5 id=&quot;autokey&quot;&gt;Autokey&lt;/h5&gt;
&lt;p&gt;This application uses the LC_ALL constant to determine the system locale.&lt;br /&gt;
Apparently it’s not set by default so in order to fix that we have to add it to our environment: &lt;code class=&quot;highlighter-rouge&quot;&gt;sudo sh -c 'echo LC_ALL=\&quot;en_US.UTF-8\&quot; &amp;gt;&amp;gt; /etc/environment'&lt;/code&gt;&lt;/p&gt;

&lt;h5 id=&quot;set-local-server-mirrors-to-pacman&quot;&gt;Set local server mirrors to pacman&lt;/h5&gt;
&lt;p&gt;This command finds servers with the lowest ping and adds them to &lt;code class=&quot;highlighter-rouge&quot;&gt;/etc/pacman.d/mirrorlist&lt;/code&gt; automatically:&lt;br /&gt;
&lt;code class=&quot;highlighter-rouge&quot;&gt;pacman-mirrors -g&lt;/code&gt;&lt;/p&gt;

&lt;h5 id=&quot;some-bashrc-aliases&quot;&gt;Some &lt;code class=&quot;highlighter-rouge&quot;&gt;bashrc&lt;/code&gt; aliases&lt;/h5&gt;
&lt;p&gt;Nothing big here, actually. I mostly use &lt;code class=&quot;highlighter-rouge&quot;&gt;yaourt-gui&lt;/code&gt; but sometimes it’s handy to have direct pacman shortcuts:&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;alias &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;pact&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'sudo pacman -Syyu'&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;alias &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;paci&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'sudo pacman -Syu'&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;alias &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;pacr&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'sudo pacman -Rs'&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;alias &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;paclean&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'sudo pacman -Rs $(pacman -Qdtq)'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Usage:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;pact&lt;/code&gt; → Update sources and perform applications and system upgrade.&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;paci &amp;lt;Application Name&amp;gt;&lt;/code&gt; → Install a new application.&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;pacr &amp;lt;Application Name&amp;gt;&lt;/code&gt; → Remove an application.&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;paclean&lt;/code&gt; → Clean unnecessary packages and dependencies.&lt;/li&gt;
&lt;/ul&gt;

&lt;h5 id=&quot;system-settings&quot;&gt;System Settings&lt;/h5&gt;
&lt;p&gt;I did lots of tweaks to customize the system (via the different menus), and I won’t be listing all of them here. Instead, I decided to list only the not-so-obvious ones:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;With the default settings I experienced many UI freezes and window unresponsiveness. After lots of digging, I found out it was the compositor rendering backend. This is probably very specific to my system, but it appears &lt;a href=&quot;https://forum.manjaro.org/t/kde-plasma-desktop-freezing/34855/14&quot;&gt;I’m not the only one&lt;/a&gt;. I was able to fix this by changing from OpenGL to XRender in:&lt;br /&gt;
Display and Monitor → Compositor → Rendering backend.&lt;/li&gt;
  &lt;li&gt;For some reason, my Gigabit Ethernet connection was capped to 100 MBit/s by default. To change that I had to allow auto-negotiation:&lt;br /&gt;
Network → Connections → Wired Connection → Wired → Allow auto-negotiation.&lt;/li&gt;
  &lt;li&gt;Choosing grouped Task Manager items invokes an annoying side-by-side window effect. This is how I brought back the simple drop-down menu:&lt;br /&gt;
Desktop Behavior → Desktop Effects → Untick Present Windows&lt;/li&gt;
&lt;/ul&gt;

&lt;h5 id=&quot;bringing-back-transfer-dialog-boxes&quot;&gt;Bringing back transfer dialog boxes&lt;/h5&gt;
&lt;p&gt;By default, Dolphin file transfers are handled via system notifications, but I wanted to have the good-old transfer dialog. I did that with the solution I found &lt;a href=&quot;https://forum.kde.org/viewtopic.php?f=67&amp;amp;t=99407&quot;&gt;here&lt;/a&gt;:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;In Notifications (right-click on system tray icon) → Notifications Settings… → Untick “Track file transfer and other jobs”.&lt;/li&gt;
  &lt;li&gt;In Task Manager settings (right-click on task manager) → Task → Untick “Show progress and status information in task buttons”.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;However, KDE also has a nasty bug right now where dialog boxes won’t come to the front when invoked, so I had to create a custom rule that catches them all and forces them to come to the front:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Settings → Window Management → Window Rules → New&lt;/li&gt;
  &lt;li&gt;Window class (application) → Regular Expression → &lt;code class=&quot;highlighter-rouge&quot;&gt;dolphin|ark&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;Window title → Regular Expression → &lt;code class=&quot;highlighter-rouge&quot;&gt;Moving|Copying|Already|Extracting&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;Appearance &amp;amp; Fixes tab → Accept focus → Force → Yes&lt;/li&gt;
&lt;/ul&gt;

&lt;h5 id=&quot;lower-timeout-and-smaller--osds&quot;&gt;Lower timeout and smaller  OSDs&lt;/h5&gt;
&lt;p&gt;Volume, IME and brightness (on laptops) OSDs appear right in the middle of the screen when invoked, and they stay there way too long for my taste. I found a solution &lt;a href=&quot;https://forum.kde.org/viewtopic.php?f=67&amp;amp;t=131991&quot;&gt;here&lt;/a&gt;:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;nano /usr/share/plasma/look-and-feel/org.kde.breeze.desktop/contents/osd/Osd.qml&lt;/code&gt;
    &lt;ul&gt;
      &lt;li&gt;Change &lt;code class=&quot;highlighter-rouge&quot;&gt;property int timeout&lt;/code&gt; value (I lowered it from 1800 to 1500)&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;nano  /usr/share/plasma/look-and-feel/org.kde.breeze.desktop/contents/osd/OsdItem.qml&lt;/code&gt;
    &lt;ul&gt;
      &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;width: Math.min(units.gridUnit * 15, Screen.desktopAvailableHeight / 10)&lt;/code&gt;&lt;/li&gt;
      &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;height: width - 35&lt;/code&gt; (make it narrow)&lt;/li&gt;
      &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;PlasmaCore.IconItem&lt;/code&gt; → &lt;code class=&quot;highlighter-rouge&quot;&gt;height: parent.height - Math.max(progressBar.height, label.height) - ((units.smallSpacing/2) * 2) + 20&lt;/code&gt;&lt;/li&gt;
      &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;PlasmaComponents.ProgressBar&lt;/code&gt; → &lt;code class=&quot;highlighter-rouge&quot;&gt;anchors&lt;/code&gt; → &lt;code class=&quot;highlighter-rouge&quot;&gt;margins: Math.floor(units.smallSpacing / 2) - 5&lt;/code&gt;&lt;/li&gt;
      &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;PlasmaExtra.Heading&lt;/code&gt; → &lt;code class=&quot;highlighter-rouge&quot;&gt;anchors&lt;/code&gt; → &lt;code class=&quot;highlighter-rouge&quot;&gt;margins: Math.floor(units.smallSpacing / 2) - 7&lt;/code&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;img src=&quot;/img/kde-osd-beforeafter.jpg&quot; alt=&quot;OSD Before and After&quot; /&gt; &lt;em&gt;Spot the difference. Before and after.&lt;/em&gt;&lt;/p&gt;

&lt;h5 id=&quot;add-custom-scripts-to-dolphin-service-menu&quot;&gt;Add custom scripts to Dolphin Service Menu&lt;/h5&gt;
&lt;p&gt;Create a &lt;code class=&quot;highlighter-rouge&quot;&gt;.desktop&lt;/code&gt; file inside &lt;code class=&quot;highlighter-rouge&quot;&gt;~/.local/share/kservices5/ServiceMenus/&lt;/code&gt;.&lt;br /&gt;
An example &lt;code class=&quot;highlighter-rouge&quot;&gt;.desktop&lt;/code&gt; file:&lt;/p&gt;
&lt;div class=&quot;language-ini highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nn&quot;&gt;[Desktop Entry]&lt;/span&gt;
&lt;span class=&quot;py&quot;&gt;Name&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;lt;Menu Name&amp;gt;&lt;/span&gt;
&lt;span class=&quot;py&quot;&gt;Type&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Service&lt;/span&gt;
&lt;span class=&quot;py&quot;&gt;MimeType&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;all/allfiles;&lt;/span&gt;
&lt;span class=&quot;py&quot;&gt;Encoding&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;UTF-8&lt;/span&gt;
&lt;span class=&quot;py&quot;&gt;Icon&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;lt;system icon name OR icon path&amp;gt;&lt;/span&gt;
&lt;span class=&quot;py&quot;&gt;Actions&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;lt;Action&amp;gt;;&lt;/span&gt;
&lt;span class=&quot;py&quot;&gt;X-KDE-ServiceTypes&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;KonqPopupMenu/Plugin&lt;/span&gt;
&lt;span class=&quot;py&quot;&gt;X-KDE-Priority&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;TopLevel&lt;/span&gt;
&lt;span class=&quot;py&quot;&gt;X-KDE-Submenu&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;lt;Menu name&amp;gt;&lt;/span&gt;

&lt;span class=&quot;nn&quot;&gt;[Desktop Action &amp;lt;Action&amp;gt;]&lt;/span&gt;
&lt;span class=&quot;py&quot;&gt;Name&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Upload To Google Drive&lt;/span&gt;
&lt;span class=&quot;py&quot;&gt;Icon&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;~/Documents/Graphics/google-drive.png&lt;/span&gt;
&lt;span class=&quot;py&quot;&gt;Exec&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/usr/bin/python2 ~/Scripts/gd-upload.py %U&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;At last, this command forces the system to rebuild &lt;code class=&quot;highlighter-rouge&quot;&gt;.desktop&lt;/code&gt; cache: &lt;code class=&quot;highlighter-rouge&quot;&gt;kbuildsycoca5&lt;/code&gt;.&lt;br /&gt;
Further information about option, etc.: &lt;a href=&quot;https://askubuntu.com/questions/719262/how-do-i-add-custom-items-to-the-context-menu-in-dolphin-in-kde-5/719757&quot;&gt;Here&lt;/a&gt; and &lt;a href=&quot;https://techbase.kde.org/Development/Tutorials/Creating_Konqueror_Service_Menus&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h5 id=&quot;per-activity-browser-profiles&quot;&gt;Per-Activity browser profiles&lt;/h5&gt;
&lt;p&gt;KDE Activities are great. For those who don’t know, it’s basically a feature that allows having multiple desktop sessions (=activities) run at the same time. It’s like booting into a new machine without rebooting.&lt;br /&gt;
Most applications work just fine, but browsers usually have one session which they use. It doesn’t play very well with the idea of activities, since there’s no point of having the same browser session opened twice on two “different desktop”, and it might as well cause problems.&lt;br /&gt;
Inspiration for a solution I took from &lt;a href=&quot;https://github.com/alxlg/ff-kactivities&quot;&gt;ff-kactivities&lt;/a&gt; script, which doesn’t work as I wanted.&lt;br /&gt;
My main browser is Opera, but I also use Firefox as a secondary option.&lt;br /&gt;
For Firefox there’s a built-in profile manager, but Opera allows to only specify a user data directory (&lt;a href=&quot;https://peter.sh/experiments/chromium-command-line-switches/#user-data-dir&quot;&gt;thanks to Chrome&lt;/a&gt;, actually).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For Opera:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
  &lt;li&gt;Copy the original Opera shortcut to the user space: &lt;code class=&quot;highlighter-rouge&quot;&gt;cp /usr/share/applications/opera.desktop ~/.local/share/applications/opera-&amp;lt;Activity Name&amp;gt;.desktop&lt;/code&gt; (it’s best not to include spaces in the name due to &lt;a href=&quot;https://bugs.kde.org/show_bug.cgi?id=385942&quot;&gt;this bug&lt;/a&gt;).&lt;/li&gt;
  &lt;li&gt;Edit the copied file &lt;code class=&quot;highlighter-rouge&quot;&gt;nano ~/.local/share/applications/opera-&amp;lt;Activity Name&amp;gt;.desktop&lt;/code&gt;.&lt;/li&gt;
  &lt;li&gt;Under &lt;code class=&quot;highlighter-rouge&quot;&gt;[Desktop Entry]&lt;/code&gt; section change:
    &lt;ul&gt;
      &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;Name=Opera (&amp;lt;Profile Name&amp;gt;)&lt;/code&gt;&lt;/li&gt;
      &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;Exec=opera --user-data-dir=&quot;&amp;lt;Path To a Custom Directory&amp;gt;&quot;&lt;/code&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;A new shortcut with the new name that is tied to the new profile should appear in the menu. This shortcut should be used to run Opera inside the new activity.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;For Firefox:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
  &lt;li&gt;Run &lt;code class=&quot;highlighter-rouge&quot;&gt;firefox --ProfileManager&lt;/code&gt;.&lt;/li&gt;
  &lt;li&gt;Create a new profile (it’s best to name it after the new activity, otherwise it might get messy).&lt;/li&gt;
  &lt;li&gt;Copy the original Firefox shortcut to the user space: &lt;code class=&quot;highlighter-rouge&quot;&gt;cp /usr/share/applications/firefox.desktop ~/.local/share/applications/firefox-&amp;lt;Activity Name&amp;gt;.desktop&lt;/code&gt; (it’s best not to include spaces in the name due to &lt;a href=&quot;https://bugs.kde.org/show_bug.cgi?id=385942&quot;&gt;this bug&lt;/a&gt;).&lt;/li&gt;
  &lt;li&gt;Edit the copied file &lt;code class=&quot;highlighter-rouge&quot;&gt;nano ~/.local/share/applications/firefox-&amp;lt;Activity Name&amp;gt;.desktop&lt;/code&gt;.&lt;/li&gt;
  &lt;li&gt;Under &lt;code class=&quot;highlighter-rouge&quot;&gt;[Desktop Entry]&lt;/code&gt; section change:
    &lt;ul&gt;
      &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;Name=Firefox (&amp;lt;Profile Name&amp;gt;)&lt;/code&gt;&lt;/li&gt;
      &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;Exec=/usr/lib/firefox/firefox -P &quot;&amp;lt;Profile Name&amp;gt;&quot;&lt;/code&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;A new shortcut with the new name that is tied to the new profile should appear in the menu. This shortcut should be used to run Firefox inside the new activity.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; It might be necessary to run &lt;code class=&quot;highlighter-rouge&quot;&gt;kbuildsycoca5&lt;/code&gt; in order to rebuild &lt;code class=&quot;highlighter-rouge&quot;&gt;.desktop&lt;/code&gt; cache.&lt;/p&gt;

&lt;h5 id=&quot;per-app-gtk3-theme&quot;&gt;Per-app GTK3 theme&lt;/h5&gt;
&lt;p&gt;I found that some apps are poorly designed to work with themes (especially dark ones). One of those apps is &lt;a href=&quot;http://www.aegisub.org&quot;&gt;Aegisub&lt;/a&gt;, which becomes unusable with a dark GTK3 theme like Adapta-Nokto.&lt;br /&gt;
Fortunately it’s an easy fix. I just added &lt;code class=&quot;highlighter-rouge&quot;&gt;GTK_THEME=Breeze:light&lt;/code&gt; before the program name in its &lt;code class=&quot;highlighter-rouge&quot;&gt;.desktop&lt;/code&gt; file &lt;code class=&quot;highlighter-rouge&quot;&gt;Exec&lt;/code&gt; command, and now it opens with the light version of the KDE default Breeze theme.&lt;/p&gt;

&lt;style&gt;
    #post li &gt; img {
        display: inline;
        position: relative;
        top: 5px;
    }
&lt;/style&gt;

&lt;!--stackedit_data:
eyJoaXN0b3J5IjpbMjgzMTUyNDYwLDEwOTUyMjM2MzMsMTk4OD
IwNTcwMSwtNDk2MTk5MzQ4LC00NzExOTI0MTIsNDc4NjQ4MDk3
LC0xMjEyNjQ4ODg0LDM2OTQ5MDM5MiwxMzY1MjE1MzU2LDEyNj
U0ODg4OCwtNjEyNzE0NzI1LDU3NjEyNjc3NCwtMTU2NjI2NzAz
MSwyMDYwNjk4MTEyLC01MDQwMjk3NDAsMjA1MDc5NzI0NiwtNj
U1Mzk4NzkwLC01MjkxNDcyODUsMTY2MjU3Mjg3OCw1NzY5MDM2
MTFdfQ==
--&gt;
</description>
        <pubDate>Thu, 17 May 2018 00:00:00 +0000</pubDate>
        <link>/2018/05/17/my-linux-kde-setup/</link>
        <guid isPermaLink="true">/2018/05/17/my-linux-kde-setup/</guid>
        
        <category>linux</category>
        
        <category>manjaro</category>
        
        <category>kde</category>
        
        
      </item>
    
      <item>
        <title>Assembling the Rock64 Acrylic Open Enclosure</title>
        <description>&lt;p&gt;The &lt;a href=&quot;https://www.pine64.org/?product=rock64-acrylic-open-enclosure&quot;&gt;Acrylic Open Enclosure&lt;/a&gt; for the Rock64 comes without a manual, and while it’s not a rocket science to put it together, this picture guide may help those who bought and wish to assemble it.&lt;/p&gt;

&lt;!--more--&gt;

&lt;h3 id=&quot;in-the-box-2-acrylic-plates-and-some-screws&quot;&gt;In the box: 2 acrylic plates and some screws&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;/img/rock64-case-assembly-1.jpg&quot; alt=&quot;In the box&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;1-screw-the-board-from-below&quot;&gt;1. Screw the board from below&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;/img/rock64-case-assembly-2.jpg&quot; alt=&quot;Step 1&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;2-put-the-gold-raisers-from-the-other-side&quot;&gt;2. Put the gold raisers from the other side&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;/img/rock64-case-assembly-3.jpg&quot; alt=&quot;Step 2&quot; /&gt;&lt;br /&gt;
&lt;img src=&quot;/img/rock64-case-assembly-4.jpg&quot; alt=&quot;Step 2&quot; /&gt;&lt;br /&gt;
&lt;img src=&quot;/img/rock64-case-assembly-5.jpg&quot; alt=&quot;Step 2&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;3-assemble-the-tube-raisers&quot;&gt;3. Assemble the tube raisers&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;/img/rock64-case-assembly-6.jpg&quot; alt=&quot;Step 3&quot; /&gt;&lt;br /&gt;
&lt;img src=&quot;/img/rock64-case-assembly-7.jpg&quot; alt=&quot;Step 3&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;4-and-the-same-at-the-top&quot;&gt;4. …and the same at the top&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;/img/rock64-case-assembly-8.jpg&quot; alt=&quot;Step 4&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;5-done&quot;&gt;5. Done!&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;/img/rock64-case-assembly-9.jpg&quot; alt=&quot;Step 5&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;6-these-parts-are-spare&quot;&gt;6. These parts are spare&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;/img/rock64-case-assembly-10.jpg&quot; alt=&quot;Spare Parts&quot; /&gt;&lt;/p&gt;

&lt;!--stackedit_data:
eyJoaXN0b3J5IjpbLTk1MTkyNDM1Ml19
--&gt;
</description>
        <pubDate>Thu, 19 Apr 2018 00:00:00 +0000</pubDate>
        <link>/2018/04/19/assembling-the-rock64-acrylic-open-enclosure/</link>
        <guid isPermaLink="true">/2018/04/19/assembling-the-rock64-acrylic-open-enclosure/</guid>
        
        <category>Rock64</category>
        
        
      </item>
    
  </channel>
</rss>
