add /notes and move some blog posts there

This commit is contained in:
Rupus Reinefjord 2025-04-18 22:58:50 +02:00
parent 7778788120
commit c0d4a5b7f0
4 changed files with 8 additions and 4 deletions

View file

@ -0,0 +1,108 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Workaround for broken TrackPoint</title>
<style>
* {
box-sizing: border-box;
overflow-wrap: break-word;
word-wrap: break-word; /* legacy */
word-break: break-word; /* for WebKit/Chrome */
}
main {
max-width: 36rem;
margin: 0 auto;
}
code, .email {
font-family: monospace, monospace;
}
.asterism, footer {
margin: 2rem 0;
text-align: center;
}
pre {
overflow-x: auto;
background-color: #eee;
border-radius: 5px;
padding: 10px;
}
</style>
</head>
<body>
<main>
<p><a href="/">Index</a></p>
<h1>Workaround for broken TrackPoint</h1>
<small><time>2022-12-05</time></small>
<p>
Sometimes, seemingly at random after clicking the dedicated left click
or right click buttons, the buttons and trackpoint on my Lenovo
Thinkpad T14s stops working. Instead of clicking, the three mouse
buttons just makes the pointer move a bit and the trackpoint makes the
pointer move in a random direction and seems to issue clicks.
</p>
<p>
When this happens, the kernel buffer is spammed with "<code>psmouse
serio1: elantech: discarding packet</code>". Searching the interwebs,
I found that more people seem to be experiencing similar weirdness with
the elantech trackpoint driver.
</p>
<p>
Rebooting the computer works, but it's annoying. Removing and re-adding
the misbehaving kernel module resolves the issue too fortunately. I
put the following in <code>~/bin/fixmouse</code>:
<pre><code>#!/bin/sh
doas rmmod psmouse
doas modprobe psmouse
</pre></code>
So now I can run <code>fixmouse</code> whenever the driver stops
working.
</p>
<hr>
<p><i>Update 2023-09-24:</i> If the psmose module is builtin, it can't be
unloaded, giving "<code>rmmod: ERROR: Module psmouse is builtin.</code>"
Fortunately, there's a better way of reloading the trackpad using a
method described in an
<a href="https://lwn.net/Articles/143397/">article on LWN</a> from 2005.
</p>
<p>The error in the kernel buffer indicates that the trackpad is called
<code>serio1</code>, but for posterity we can find devices using the
<code>psmouse</code> driver with <code>find</code>:
<pre><code>$ find /sys/bus -name psmouse
/sys/bus/serio/drivers/psmouse
$ ls -l /sys/bus/serio/drivers/psmouse
total 0
--w-------. 1 root root 4096 Sep 23 22:19 bind
-rw-r--r--. 1 root root 4096 Sep 23 22:19 bind_mode
-r--r--r--. 1 root root 4096 Sep 23 22:19 description
lrwxrwxrwx. 1 root root 0 Sep 24 10:42 serio1 -> ../../../../devices/platform/i8042/serio1
--w-------. 1 root root 4096 Sep 23 14:20 uevent
--w-------. 1 root root 4096 Sep 24 10:36 unbind
</pre></code>
As described in the article, we can unbind the touchpad with (as root)
<pre><code>echo -n "serio1" > /sys/bus/serio/drivers/psmouse/unbind</pre></code>
My touchpad rebinds automatically after a few seconds, but you should be
able to bind it manually using
<code>[...]/psmouse/bind</code>.
</main>
<footer>&#10086;</footer>
</body>
</html>
<!-- vim: set tw=79 -->

View file

@ -0,0 +1,85 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
* {
box-sizing: border-box;
overflow-wrap: break-word;
}
main {
max-width: 36rem;
margin: 0 auto;
}
h1 {
margin-bottom: 10px;
}
code, kbd {
background-color: #ddd;
}
.asterism, footer {
margin: 2rem 0;
text-align: center;
}
pre {
overflow-x: auto;
background-color: #eee;
border-radius: 5px;
padding: 10px;
}
</style>
<title>Playing Widevine (DRM protected) videos on Chimera Linux</title>
</head>
<body>
<main>
<p><a href="/">Index</a></p>
<article>
<header>
<h1>Playing Widevine (DRM protected) videos on Chimera&nbsp;Linux</h1>
<small><time>2024-08-02</time></small>
</header>
<p>
Widevine CDMs (Content Decryption Modules) are distributed as
proprietary binaries compiled for glibc and won't run on musl systems,
like Chimera Linux or the musl version of Void Linux.
</p>
<p>
On Chimera Linux,
<a href="https://github.com/chimera-linux/cports/blob/3ee8bb258121e6eebc405b8f6d2143a641a6037d/contrib/firefox/files/vendor.js#L14">
Firefox is configured by default</a> to not prompt to download Widevine
when needed like it normally will. You can override this in
<code>about:config</code> but the plugin will just crash under musl.
</p>
<h2>Workaround</h2>
<p>
The easiest way to get around this seems to be to
<a href="https://chimera-linux.org/docs/configuration/flatpak">
install a browser with Flatpak</a>,
which are compiled with glibc and ships with the environment they need, even
on musl systems.
</p>
<p>
Annoyingly, while running an instance of musl Firefox, starting Firefox with
<code>flatpak run</code> will not start a second Firefox process
but instead open a new window of your musl Firefox. Firefox has a flag for
that though: <code>flatpak run org.mozilla.firefox --new-instance</code>
starts a new instance of Flatpak Firefox.
</p>
</article>
</main>
<footer>&#10086;</footer>
</body>
</html>

View file

@ -0,0 +1,113 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
* {
box-sizing: border-box;
overflow-wrap: break-word;
word-wrap: break-word; /* legacy */
word-break: break-word; /* for WebKit/Chrome */
}
main {
max-width: 36rem;
margin: 0 auto;
}
h1 {
margin-bottom: 10px;
}
code, kbd {
font-size: 0.9rem;
}
.asterism, footer {
margin: 2rem 0;
text-align: center;
}
pre {
overflow-x: auto;
background-color: #eee;
border-radius: 5px;
padding: 10px;
}
</style>
<title>Remap PrtSc to Meta/Super</title>
</head>
<body>
<main>
<p><a href="/">Index</a></p>
<article>
<header>
<h1>Remap PrtSc to Meta/Super</h1>
<small><time>2023-01-28</time></small>
</header>
<p>
On my Thinkpad T14s Gen 1, the right meta/super/windows key is replaced
by a "<kbd>PrtSc</kbd>" key. I use <a href="https://swaywm.org/">Sway</a> as my
Wayland compositor and use the meta keys a lot to navigate and manage
windows, and having only a left meta key makes some chords difficult to
use. I thus wanted to remap <kbd>PrtSc</kbd> to Meta.
</p>
<p>
I found <a href="https://github.com/rvaiya/keyd">keyd</a> which looked
promising. To use this, I need to know what key <kbd>PrtSc</kbd> maps to in the
OS. Using <code>evtest</code>:
</p>
<pre><code>Event: time 1674905628.580346, type 4 (EV_MSC), code 4 (MSC_SCAN), value b7
Event: time 1674905628.580346, type 1 (EV_KEY), code 99 (KEY_SYSRQ), value 1</code></pre>
<p>
It seems like it is interpreted as <kbd>SysRq</kbd>.
</p>
<p>
To only remap this keyboard and not any other keyboards connected to
the computer, we'll need the vendor and product id of the built-in
keyboard. That can be found in <code>/proc/bus/input/devices</code>:
</p>
<pre><code>$ cat /proc/bus/input/devices
I: Bus=0011 Vendor=0001 Product=0001 Version=ab83
N: Name="AT Translated Set 2 keyboard"
...
</code></pre>
<p>
<code>0001:0001</code>.
</p>
<p>
Next we'll configure keyd:
</p>
<pre><code>$ cat /etc/keyd/default.conf
[ids]
0001:0001
[main]
sysrq = rightmeta
</code></pre>
<p>
Restart keyd and we're done! The <kbd>PrtSc</kbd> key is interpreted as meta
instead.
</p>
</article>
</main>
<footer>&#10086;</footer>
</body>
</html>
<!-- vim: set tw=79 -->