<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.8" -->
<?xml-stylesheet href="https://baszerr.eu/lib/exe/css.php?s=feed" type="text/css"?>
<rss version="2.0">
    <channel xmlns:g="http://base.google.com/ns/1.0">
        <title>BaSzErr - blog:2026:01:11</title>
        <description></description>
        <link>https://baszerr.eu/</link>
        <lastBuildDate>Tue, 14 Apr 2026 19:49:21 +0000</lastBuildDate>
        <generator>FeedCreator 1.8</generator>
        <image>
            <url>https://baszerr.eu/lib/exe/fetch.php?media=wiki:dokuwiki.svg</url>
            <title>BaSzErr</title>
            <link>https://baszerr.eu/</link>
        </image>
        <item>
            <title>2026-01-11_-_redundant_internet_at_home</title>
            <link>https://baszerr.eu/doku.php?id=blog:2026:01:11:2026-01-11_-_redundant_internet_at_home</link>
            <description>
&lt;h1 class=&quot;sectionedit1&quot; id=&quot;redundant_internet_at_home&quot;&gt;2026-01-11 - redundant internet at home&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;p&gt;
for some years now i work 95% remotely, visiting office only a few times a year. this means i want to have network connection as stable as it can be. while i do have fiber optics and while it&amp;#039;s almost perfect wrt availability, 1-2 times a year there are moment when internet is down… and with my luck, this can strike in a very bad moment.
&lt;/p&gt;

&lt;p&gt;
to combat that i decided to get a redundant network connection. my 2nd ISP is a mobile provider. therefor i have 2 WANs – the main via my PC-router one and a &lt;a href=&quot;https://en.wikipedia.org/wiki/RasPi&quot; class=&quot;interwiki iw_wp&quot; title=&quot;https://en.wikipedia.org/wiki/RasPi&quot;&gt;RasPi&lt;/a&gt; with USB modem attached. on a home router i have a simple script that pings a set a predefined IPs to check if internet connection is there or not. if it fails, it moves to a secondary link. it goes like this:
&lt;/p&gt;
&lt;pre class=&quot;code bash&quot;&gt;&lt;span class=&quot;co0&quot;&gt;#!/bin/bash&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;set&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-eu&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-o&lt;/span&gt; pipefail
&lt;span class=&quot;re2&quot;&gt;app&lt;/span&gt;=$&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw2&quot;&gt;basename&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;$0&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw1&quot;&gt;function&lt;/span&gt; is_alive &lt;span class=&quot;co0&quot;&gt;# &amp;lt;0:iface&amp;gt;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
  &lt;span class=&quot;kw3&quot;&gt;local&lt;/span&gt; &lt;span class=&quot;re2&quot;&gt;i&lt;/span&gt;=&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
  &lt;span class=&quot;kw3&quot;&gt;local&lt;/span&gt; &lt;span class=&quot;re2&quot;&gt;n&lt;/span&gt;=&lt;span class=&quot;nu0&quot;&gt;5&lt;/span&gt;
  &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; addr &lt;span class=&quot;kw1&quot;&gt;in&lt;/span&gt; $&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw2&quot;&gt;sort&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-R&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;etc&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;startup&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;allowed_external_hosts.ips &lt;span class=&quot;sy0&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;head&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;-&lt;span class=&quot;es2&quot;&gt;$n&lt;/span&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
  &lt;span class=&quot;kw1&quot;&gt;do&lt;/span&gt;
    timeout &lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;ping&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-c&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-I&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;$1&amp;quot;&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es2&quot;&gt;$addr&lt;/span&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;dev&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;null &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;
    &lt;span class=&quot;kw3&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es2&quot;&gt;$app&lt;/span&gt;: ping &lt;span class=&quot;es2&quot;&gt;$addr&lt;/span&gt; via $1 failed (&lt;span class=&quot;es2&quot;&gt;$i&lt;/span&gt;/&lt;span class=&quot;es2&quot;&gt;$n&lt;/span&gt;)&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;++i&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
  &lt;span class=&quot;kw1&quot;&gt;done&lt;/span&gt;
  &lt;span class=&quot;kw3&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es2&quot;&gt;$app&lt;/span&gt;: looks like $1 is dead...&amp;quot;&lt;/span&gt;
  &lt;span class=&quot;kw3&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw1&quot;&gt;function&lt;/span&gt; set_default &lt;span class=&quot;co0&quot;&gt;# &amp;lt;0:metric_pri&amp;gt; &amp;lt;1:metric_sec&amp;gt;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
  &lt;span class=&quot;kw3&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es2&quot;&gt;$app&lt;/span&gt;: setting &lt;span class=&quot;es2&quot;&gt;$if_pri&lt;/span&gt;=$1 vs. &lt;span class=&quot;es2&quot;&gt;$if_sec&lt;/span&gt;=$2&amp;quot;&lt;/span&gt;
  &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;set&lt;/span&gt; +e
    &lt;span class=&quot;kw1&quot;&gt;set&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-x&lt;/span&gt;
    &lt;span class=&quot;kw2&quot;&gt;ip&lt;/span&gt; r del &lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es3&quot;&gt;${rule_pri[@]}&lt;/span&gt;&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;kw2&quot;&gt;ip&lt;/span&gt; r del &lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es3&quot;&gt;${rule_sec[@]}&lt;/span&gt;&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;kw2&quot;&gt;ip&lt;/span&gt; r add &lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es3&quot;&gt;${rule_pri[@]}&lt;/span&gt;&amp;quot;&lt;/span&gt; metric &lt;span class=&quot;st0&quot;&gt;&amp;quot;$1&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;kw2&quot;&gt;ip&lt;/span&gt; r add &lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es3&quot;&gt;${rule_sec[@]}&lt;/span&gt;&amp;quot;&lt;/span&gt; metric &lt;span class=&quot;st0&quot;&gt;&amp;quot;$2&amp;quot;&lt;/span&gt;
    systemctl stop  openvpn
    systemctl start openvpn
    &lt;span class=&quot;kw2&quot;&gt;sleep&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt; &lt;span class=&quot;co0&quot;&gt;# give VPN some time to reconnect, so that the routing table is shown properly&lt;/span&gt;
    &lt;span class=&quot;kw2&quot;&gt;ip&lt;/span&gt; r
  &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
  &lt;span class=&quot;kw3&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es2&quot;&gt;$app&lt;/span&gt;: switchover completed&amp;quot;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw1&quot;&gt;function&lt;/span&gt; set_pri
&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
  set_default &lt;span class=&quot;nu0&quot;&gt;2000&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;3000&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw1&quot;&gt;function&lt;/span&gt; set_sec
&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
  set_default &lt;span class=&quot;nu0&quot;&gt;3000&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;2000&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;re2&quot;&gt;if_pri&lt;/span&gt;=wan0
&lt;span class=&quot;re2&quot;&gt;if_sec&lt;/span&gt;=wan1
&amp;nbsp;
&lt;span class=&quot;re2&quot;&gt;rule_pri&lt;/span&gt;=&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; $&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw2&quot;&gt;ip&lt;/span&gt; r &lt;span class=&quot;sy0&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;^default .* &lt;span class=&quot;es2&quot;&gt;$if_pri&lt;/span&gt;\&amp;gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;sed&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-e&lt;/span&gt; &lt;span class=&quot;st_h&quot;&gt;&#039;s/ metric .*//&#039;&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-e&lt;/span&gt; &lt;span class=&quot;st_h&quot;&gt;&#039;s/ *$//&#039;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;re2&quot;&gt;rule_sec&lt;/span&gt;=&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; $&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw2&quot;&gt;ip&lt;/span&gt; r &lt;span class=&quot;sy0&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;^default .* &lt;span class=&quot;es2&quot;&gt;$if_sec&lt;/span&gt;\&amp;gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;sed&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-e&lt;/span&gt; &lt;span class=&quot;st_h&quot;&gt;&#039;s/ metric .*//&#039;&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-e&lt;/span&gt; &lt;span class=&quot;st_h&quot;&gt;&#039;s/ *$//&#039;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;re2&quot;&gt;current&lt;/span&gt;=unknown
&amp;nbsp;
&lt;span class=&quot;kw3&quot;&gt;trap&lt;/span&gt; set_pri EXIT
&amp;nbsp;
&lt;span class=&quot;kw1&quot;&gt;while&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;sleep&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;do&lt;/span&gt;
  &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; is_alive &lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es2&quot;&gt;$if_pri&lt;/span&gt;&amp;quot;&lt;/span&gt;
  &lt;span class=&quot;kw1&quot;&gt;then&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es2&quot;&gt;$current&lt;/span&gt;&amp;quot;&lt;/span&gt; = pri &lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;then&lt;/span&gt;
      &lt;span class=&quot;kw2&quot;&gt;sleep&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;else&lt;/span&gt;
      set_pri
      &lt;span class=&quot;re2&quot;&gt;current&lt;/span&gt;=pri
    &lt;span class=&quot;kw1&quot;&gt;fi&lt;/span&gt;
    &lt;span class=&quot;kw3&quot;&gt;continue&lt;/span&gt;
  &lt;span class=&quot;kw1&quot;&gt;fi&lt;/span&gt;
&amp;nbsp;
  &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; is_alive &lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es2&quot;&gt;$if_sec&lt;/span&gt;&amp;quot;&lt;/span&gt;
  &lt;span class=&quot;kw1&quot;&gt;then&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es2&quot;&gt;$current&lt;/span&gt;&amp;quot;&lt;/span&gt; = sec &lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;then&lt;/span&gt;
      &lt;span class=&quot;kw2&quot;&gt;sleep&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;11&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;else&lt;/span&gt;
      set_sec
      &lt;span class=&quot;re2&quot;&gt;current&lt;/span&gt;=sec
    &lt;span class=&quot;kw1&quot;&gt;fi&lt;/span&gt;
    &lt;span class=&quot;kw3&quot;&gt;continue&lt;/span&gt;
  &lt;span class=&quot;kw1&quot;&gt;fi&lt;/span&gt;
&amp;nbsp;
  &lt;span class=&quot;kw3&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es2&quot;&gt;$app&lt;/span&gt;: both interfaces seem to be dead - that&#039;s bad...&amp;quot;&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;done&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;
the script is meant to be ran as a &lt;code&gt;systemd&lt;/code&gt; service.
&lt;/p&gt;

&lt;p&gt;
since pinging is possible via an explicitly-specified interface, we can check if a given link is up or not, w/o changing any network settings. then, if link switch is required, it&amp;#039;s enough to swap metric of 2 interfaces (here: &lt;code&gt;wan0&lt;/code&gt; and &lt;code&gt;wan1&lt;/code&gt;) and restart VPN, so that it connects via a new interface… and that&amp;#039;s it. works like a charm for a long time now, with fairly fast switching in case of a problem. it&amp;#039;s also quite noise resistant, as many different IPs are used randomly and multiple IPs are checked before deciding to fail over.
&lt;/p&gt;

&lt;/div&gt;
</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Sun, 11 Jan 2026 12:25:29 +0000</pubDate>
        </item>
        <item>
            <title>2026-01-11_-_rsync_and_defaults</title>
            <link>https://baszerr.eu/doku.php?id=blog:2026:01:11:2026-01-11_-_rsync_and_defaults</link>
            <description>
&lt;h1 class=&quot;sectionedit1&quot; id=&quot;rsync_and_defaults&quot;&gt;2026-01-11 - rsync and defaults&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;p&gt;
i really like &lt;a href=&quot;https://en.wikipedia.org/wiki/rsync&quot; class=&quot;interwiki iw_wp&quot; title=&quot;https://en.wikipedia.org/wiki/rsync&quot;&gt;rsync&lt;/a&gt;. there&amp;#039;s sth brilliant in how it&amp;#039;s (conceptually) simple and yet so powerful. there are however gotchas. recently i&amp;#039;ve noticed, when i sync data between some of my machines, there are certain files that are ~always re-synced (despite not being changed) as well as there are files that sync once, and then cause errors to sync after that.
&lt;/p&gt;

&lt;p&gt;
to debug this it&amp;#039;s worth using &lt;code&gt;–itemize-changes&lt;/code&gt; that outputs a reason why a given file was synced. format is a bit cryptic, but after a moment with docs, it turned out that there&amp;#039;s a bit of time offset (we&amp;#039;re talking some tens of milliseconds, to be clear!) between source and target machines. this caused those “unfortunate” files to be always synced. the answer? use &lt;code&gt;–times&lt;/code&gt; flag to &lt;code&gt;rsync&lt;/code&gt;, so that it also copies creation / modification times from source. this way time offset between machines does not matter. that solved the 1st problem.
&lt;/p&gt;

&lt;p&gt;
the second one is… odd. turns out that &lt;code&gt;git&lt;/code&gt; does not give write permissions to object files in &lt;code&gt;.git&lt;/code&gt; dir, as these are not expected to ever change after writing. fine locally, but a bit problematic when &lt;code&gt;rsync&lt;/code&gt;ing repo, as there the file &lt;em&gt;can&lt;/em&gt; change (e.g. resuming previous partial send). to fix this one &lt;code&gt;–chmod=u+rw&lt;/code&gt; was added to &lt;code&gt;rsync&lt;/code&gt;, so that remote copy has always R/W access for user at least. this allows to error-less sync things.
&lt;/p&gt;

&lt;p&gt;
nice. these were quite some discoveries to be made. my only question – could we ask for a better defaults? the current ones just cause confusion…
&lt;/p&gt;

&lt;p&gt;
btw: more &lt;a href=&quot;https://github.com/el-bart/help_cmds/blob/master/rsync.txt&quot; class=&quot;urlextern&quot; title=&quot;https://github.com/el-bart/help_cmds/blob/master/rsync.txt&quot; rel=&quot;ugc nofollow&quot;&gt;rsync tips&lt;/a&gt; can be found on &lt;a href=&quot;https://github.com/el-bart/help_cmds&quot; class=&quot;urlextern&quot; title=&quot;https://github.com/el-bart/help_cmds&quot; rel=&quot;ugc nofollow&quot;&gt;help_cmds&lt;/a&gt; repo, as usual.
&lt;/p&gt;

&lt;/div&gt;
</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Sun, 11 Jan 2026 11:57:10 +0000</pubDate>
        </item>
        <item>
            <title>2026-01-12_-_easy_emoji_under_linux</title>
            <link>https://baszerr.eu/doku.php?id=blog:2026:01:11:2026-01-12_-_easy_emoji_under_linux</link>
            <description>
&lt;h1 class=&quot;sectionedit1&quot; id=&quot;easy_emoji_under_linux&quot;&gt;2026-01-12 - easy emoji under linux&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;p&gt;
recently i was wondering what&amp;#039;s the best way to type in emoji under linux. some key bindings would be nice, to the common ones… and it turned out that using Wayland and &lt;code&gt;sway&lt;/code&gt; DM it&amp;#039;s very easy! :)
&lt;/p&gt;

&lt;p&gt;
1st we need a script that&amp;#039;s using &lt;code&gt;wtype&lt;/code&gt; to simulate inserting characters from keyboard. e.g.:
&lt;/p&gt;
&lt;pre class=&quot;code bash&quot;&gt;&lt;span class=&quot;co0&quot;&gt;#!/bin/bash&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;set&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-euo&lt;/span&gt; pipefail
&lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; name &lt;span class=&quot;kw1&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;$@&amp;quot;&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;do&lt;/span&gt;
  &lt;span class=&quot;kw1&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es2&quot;&gt;$name&lt;/span&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;in&lt;/span&gt;
    &lt;span class=&quot;st0&quot;&gt;&amp;quot;cold_swet&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;     wtype &lt;span class=&quot;st0&quot;&gt;&amp;quot;😅&amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;;;&lt;/span&gt;
    &lt;span class=&quot;st0&quot;&gt;&amp;quot;grimacing&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;     wtype &lt;span class=&quot;st0&quot;&gt;&amp;quot;😬&amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;;;&lt;/span&gt;
    &lt;span class=&quot;st0&quot;&gt;&amp;quot;grin&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;          wtype &lt;span class=&quot;st0&quot;&gt;&amp;quot;😁&amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;;;&lt;/span&gt;
    &lt;span class=&quot;st0&quot;&gt;&amp;quot;hushed&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;        wtype &lt;span class=&quot;st0&quot;&gt;&amp;quot;😯&amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;;;&lt;/span&gt;
    &lt;span class=&quot;st0&quot;&gt;&amp;quot;innocent&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;      wtype &lt;span class=&quot;st0&quot;&gt;&amp;quot;😇&amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;;;&lt;/span&gt;
    &lt;span class=&quot;st0&quot;&gt;&amp;quot;rotfl&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;         wtype &lt;span class=&quot;st0&quot;&gt;&amp;quot;🤣&amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;;;&lt;/span&gt;
    &lt;span class=&quot;st0&quot;&gt;&amp;quot;scream&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;        wtype &lt;span class=&quot;st0&quot;&gt;&amp;quot;😱&amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;;;&lt;/span&gt;
    &lt;span class=&quot;st0&quot;&gt;&amp;quot;skull&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;         wtype &lt;span class=&quot;st0&quot;&gt;&amp;quot;💀&amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;;;&lt;/span&gt;
    &lt;span class=&quot;st0&quot;&gt;&amp;quot;sunglasses&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;    wtype &lt;span class=&quot;st0&quot;&gt;&amp;quot;😎&amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;;;&lt;/span&gt;
    &lt;span class=&quot;st0&quot;&gt;&amp;quot;thinking&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;      wtype &lt;span class=&quot;st0&quot;&gt;&amp;quot;🤔&amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;;;&lt;/span&gt;
    &lt;span class=&quot;st0&quot;&gt;&amp;quot;speak_no_evil&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; wtype &lt;span class=&quot;st0&quot;&gt;&amp;quot;🙊&amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;;;&lt;/span&gt;
    &lt;span class=&quot;st0&quot;&gt;&amp;quot;hear_no_evil&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;  wtype &lt;span class=&quot;st0&quot;&gt;&amp;quot;🙉&amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;;;&lt;/span&gt;
    &lt;span class=&quot;st0&quot;&gt;&amp;quot;see_no_evil&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;   wtype &lt;span class=&quot;st0&quot;&gt;&amp;quot;🙈&amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;;;&lt;/span&gt;
    &lt;span class=&quot;st0&quot;&gt;&amp;quot;spock&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;         wtype &lt;span class=&quot;st0&quot;&gt;&amp;quot;🖖&amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;;;&lt;/span&gt;
    &lt;span class=&quot;st0&quot;&gt;&amp;quot;thumbs_up&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;     wtype &lt;span class=&quot;st0&quot;&gt;&amp;quot;👍&amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;;;&lt;/span&gt;
    &lt;span class=&quot;st0&quot;&gt;&amp;quot;thumbs_down&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;   wtype &lt;span class=&quot;st0&quot;&gt;&amp;quot;👎&amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;;;&lt;/span&gt;
    &lt;span class=&quot;st0&quot;&gt;&amp;quot;rocket&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;        wtype &lt;span class=&quot;st0&quot;&gt;&amp;quot;🚀&amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;;;&lt;/span&gt;
    &lt;span class=&quot;st0&quot;&gt;&amp;quot;poo&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;           wtype &lt;span class=&quot;st0&quot;&gt;&amp;quot;💩&amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;;;&lt;/span&gt;
    &lt;span class=&quot;st0&quot;&gt;&amp;quot;rolling_eyes&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;  wtype &lt;span class=&quot;st0&quot;&gt;&amp;quot;🙄&amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;;;&lt;/span&gt;
    &lt;span class=&quot;st0&quot;&gt;&amp;quot;fire&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;          wtype &lt;span class=&quot;st0&quot;&gt;&amp;quot;🔥&amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;;;&lt;/span&gt;
    &lt;span class=&quot;st0&quot;&gt;&amp;quot;snowman&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;       wtype &lt;span class=&quot;st0&quot;&gt;&amp;quot;⛄&amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;;;&lt;/span&gt;
    &lt;span class=&quot;sy0&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;               wtype &lt;span class=&quot;st0&quot;&gt;&amp;quot;?&amp;quot;&lt;/span&gt;  &lt;span class=&quot;sy0&quot;&gt;;;&lt;/span&gt;
  &lt;span class=&quot;kw1&quot;&gt;esac&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;done&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;
then add key bindings to &lt;code&gt;Sway&lt;/code&gt;&amp;#039;s config (i use right alt, as this is default for inserting polish national characters, too) in &lt;code&gt;~/.config/sway/config&lt;/code&gt;:
&lt;/p&gt;
&lt;pre class=&quot;code&quot;&gt;[...]
# emoji
bindsym Mod5+g       exec emoji grin
bindsym Mod5+shift+g exec emoji grimacing
bindsym Mod5+r       exec emoji rotfl
bindsym Mod5+Shift+r exec emoji rocket
bindsym Mod5+p       exec emoji spock
bindsym Mod5+Shift+p exec emoji poo
bindsym Mod5+t       exec emoji thinking
bindsym Mod5+h       exec emoji scream
bindsym Mod5+Shift+h exec emoji hushed
bindsym Mod5+u       exec emoji thumbs_up
bindsym Mod5+d       exec emoji thumbs_down
bindsym Mod5+l       exec emoji cold_sweat
bindsym Mod5+k       exec emoji skull
bindsym Mod5+j       exec emoji sunglasses
bindsym Mod5+i       exec emoji innocent
bindsym Mod5+y       exec emoji rolling_eyes
bindsym Mod5+f       exec emoji fire
bindsym Mod5+w       exec emoji snowman
[...]&lt;/pre&gt;

&lt;p&gt;
…and off we go! :)
&lt;/p&gt;

&lt;p&gt;
you might have noticed that not all emoji have a binding. that&amp;#039;s ok, as you can still use the script from command line with e.g.: &lt;code&gt;emoji fire&lt;/code&gt; and you get your character inserted where needed! :)
&lt;/p&gt;

&lt;p&gt;
also a note – while in theory you could put &lt;code&gt;wtype&lt;/code&gt; directly to &lt;code&gt;Sway&lt;/code&gt;&amp;#039;s config, it&amp;#039;s make it harder to read, as there are no inline comments and in text mode, many emojis are hard to read or do not show at all (i.e. just a hex code).
&lt;/p&gt;

&lt;/div&gt;
</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Mon, 12 Jan 2026 19:55:04 +0000</pubDate>
        </item>
    </channel>
</rss>
