<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Framework Laptop on foosel.net</title><link>https://foosel.net/tags/framework-laptop/</link><description>Recent content in Framework Laptop on foosel.net</description><generator>Hugo</generator><language>en-us</language><copyright>Gina Häußge (foosel)</copyright><lastBuildDate>Mon, 09 Sep 2024 00:00:00 +0000</lastBuildDate><atom:link href="https://foosel.net/tags/framework-laptop/feed.xml" rel="self" type="application/rss+xml"/><item><title>How to reduce the titlebar size of Gnome 43</title><link>https://foosel.net/til/how-to-reduce-the-titlebar-size-of-gnome/</link><pubDate>Tue, 11 Apr 2023 00:00:00 +0000</pubDate><guid>https://foosel.net/til/how-to-reduce-the-titlebar-size-of-gnome/</guid><description>&lt;p&gt;A few weeks ago I switched back to Linux as my primary OS, on a newly acquired refurbished &lt;a href="https://frame.work"&gt;Framework Laptop 11&lt;/a&gt;, and one thing that&amp;rsquo;s since been bothering me on my chosen desktop environment Gnome&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; has been the HUGE titlebars:&lt;/p&gt;
&lt;p&gt;&lt;img alt="Before: A quite tall title bar with a lot of padding, wasting space" loading="lazy" src="https://foosel.net/til/how-to-reduce-the-titlebar-size-of-gnome/before.png"&gt;&lt;/p&gt;
&lt;p&gt;So I finally dug into solving this quickly, and came across &lt;a href="https://www.reddit.com/r/gnome/comments/y61xhm/comment/ivay6db/"&gt;this post on Reddit&lt;/a&gt; with a quite nice solution. I modified &lt;code&gt;~/.config/gtk-3.0/gtk.css&lt;/code&gt; and added the following contents:&lt;/p&gt;</description><content:encoded><![CDATA[<p>A few weeks ago I switched back to Linux as my primary OS, on a newly acquired refurbished <a href="https://frame.work">Framework Laptop 11</a>, and one thing that&rsquo;s since been bothering me on my chosen desktop environment Gnome<sup id="fnref:1"><a href="#fn:1" class="footnote-ref" role="doc-noteref">1</a></sup> has been the HUGE titlebars:</p>
<p><img alt="Before: A quite tall title bar with a lot of padding, wasting space" loading="lazy" src="/til/how-to-reduce-the-titlebar-size-of-gnome/before.png"></p>
<p>So I finally dug into solving this quickly, and came across <a href="https://www.reddit.com/r/gnome/comments/y61xhm/comment/ivay6db/">this post on Reddit</a> with a quite nice solution. I modified <code>~/.config/gtk-3.0/gtk.css</code> and added the following contents:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-css" data-lang="css"><span style="display:flex;"><span><span style="color:#f92672">window</span>.<span style="color:#a6e22e">ssd</span> <span style="color:#f92672">headerbar</span>.<span style="color:#a6e22e">titlebar</span> {
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">padding-top</span>: <span style="color:#ae81ff">2</span><span style="color:#66d9ef">px</span>;
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">padding-bottom</span>: <span style="color:#ae81ff">2</span><span style="color:#66d9ef">px</span>;
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">min-height</span>: <span style="color:#ae81ff">0</span>;
</span></span><span style="display:flex;"><span>}
</span></span><span style="display:flex;"><span><span style="color:#f92672">window</span>.<span style="color:#a6e22e">ssd</span> <span style="color:#f92672">headerbar</span>.<span style="color:#a6e22e">titlebar</span> <span style="color:#f92672">button</span>.<span style="color:#a6e22e">titlebutton</span> {
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">padding</span>: <span style="color:#ae81ff">1</span><span style="color:#66d9ef">px</span>;
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">min-height</span>: <span style="color:#ae81ff">0</span>;
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">min-width</span>: <span style="color:#ae81ff">0</span>;
</span></span><span style="display:flex;"><span>}
</span></span></code></pre></div><p>That resulted in this:</p>
<p><img alt="After: The title bar reduced to the bare minimum in height, with only a minimal amount of padding, no more wasting space" loading="lazy" src="/til/how-to-reduce-the-titlebar-size-of-gnome/after.png"></p>
<p>And now I&rsquo;m happy, at least with non-Gnome apps, my chosen development environment VSCode included.</p>
<p><em>Update 2023-04-30: Alas, that no longer works under Gnome 44, so for now I&rsquo;m stuck with oversized titlebars again.</em></p>
<div class="footnotes" role="doc-endnotes">
<hr>
<ol>
<li id="fn:1">
<p>Currently Gnome 43.3 running under Wayland on Fedora Workstation 37&#160;<a href="#fnref:1" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
</ol>
</div>
]]></content:encoded></item><item><title>How to remap keys under Linux and Wayland</title><link>https://foosel.net/til/how-to-remap-keys-under-linux-and-wayland/</link><pubDate>Fri, 03 Mar 2023 00:00:00 +0000</pubDate><guid>https://foosel.net/til/how-to-remap-keys-under-linux-and-wayland/</guid><description>&lt;p&gt;&lt;em&gt;Edit 2024-09-09: Please be advised that this post refers to an older version of &lt;code&gt;keyd&lt;/code&gt; that still used a different configuration format. An older version also stated the config file was stored at &lt;code&gt;~/.config/keyd&lt;/code&gt;, that was an error on my part. Thanks to a reader for the related heads-up!&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;As a German living in Germany with umlauts in my last name and a US ANSI keyboard layout on all my devices&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; I need to remap some stuff to be able to easily type ä, ö, ü and ß. On Windows I solved this with &lt;a href="https://www.autohotkey.com/"&gt;Autohotkey&lt;/a&gt;, mapping &lt;code&gt;AltGr&lt;/code&gt;+&lt;code&gt;a&lt;/code&gt; to &lt;code&gt;ä&lt;/code&gt;, &lt;code&gt;AltGr&lt;/code&gt;+&lt;code&gt;o&lt;/code&gt; to &lt;code&gt;ö&lt;/code&gt;, &lt;code&gt;AltGr&lt;/code&gt;+&lt;code&gt;u&lt;/code&gt; to &lt;code&gt;ü&lt;/code&gt; and &lt;code&gt;AltGr&lt;/code&gt;+&lt;code&gt;s&lt;/code&gt; to &lt;code&gt;ß&lt;/code&gt; (well, technically &lt;code&gt;RAlt&lt;/code&gt; - the right &lt;code&gt;Alt&lt;/code&gt; key). That has burned itself into my muscle memory now, and so while currently setting up my new Framework laptop under Linux, with Gnome running on Wayland, I was looking for a way to remap the keys to this layout as well.&lt;/p&gt;</description><content:encoded><![CDATA[<p><em>Edit 2024-09-09: Please be advised that this post refers to an older version of <code>keyd</code> that still used a different configuration format. An older version also stated the config file was stored at <code>~/.config/keyd</code>, that was an error on my part. Thanks to a reader for the related heads-up!</em></p>
<p>As a German living in Germany with umlauts in my last name and a US ANSI keyboard layout on all my devices<sup id="fnref:1"><a href="#fn:1" class="footnote-ref" role="doc-noteref">1</a></sup> I need to remap some stuff to be able to easily type ä, ö, ü and ß. On Windows I solved this with <a href="https://www.autohotkey.com/">Autohotkey</a>, mapping <code>AltGr</code>+<code>a</code> to <code>ä</code>, <code>AltGr</code>+<code>o</code> to <code>ö</code>, <code>AltGr</code>+<code>u</code> to <code>ü</code> and <code>AltGr</code>+<code>s</code> to <code>ß</code> (well, technically <code>RAlt</code> - the right <code>Alt</code> key). That has burned itself into my muscle memory now, and so while currently setting up my new Framework laptop under Linux, with Gnome running on Wayland, I was looking for a way to remap the keys to this layout as well.</p>
<p>In the old days, I would have written an <code>.Xmodmap</code> file and called it a day, but that no longer works under Wayland. Thankfully however there&rsquo;s a whole new generation of mapping tools that instead of depending on the X server allow remapping right at the kernel input level, and one of them is <a href="https://github.com/rvaiya/keyd">keyd</a> which I used to solve my umlaut problem, and while at it also added a fancy mod layer and even a mouse layer.</p>
<p>First of all, in Gnome I set the keyboard layout to &ldquo;English (intl., with AltGr dead keys)&rdquo;, making it look like this:</p>
<p><img alt="A screenshot of the US international keyboard layout in the Gnome Settings. It&rsquo;s visible that on the third level ä is on q, ö on p, ü on y and ß on s." loading="lazy" src="/til/how-to-remap-keys-under-linux-and-wayland/us-intl-layout.png"></p>
<p>Then I downloaded, compiled and installed <code>keyd</code> and created a config file at <code>/etc/keyd/default.cfg</code> with the following contents:</p>
<pre tabindex="0"><code>[ids]
*

[main]
capslock = layer(mod)
rightalt = layer(dia)
rightcontrol = overload(control, sysrq)

[dia]
a = G-q
o = G-p
u = G-y
s = G-s
e = G-5
` = G-S-;

[mod]
alt = layer(mouse)
j = left
k = down
l = right
i = up
u = home
o = end
y = pageup
h = pagedown
p = delete
; = insert

[mouse]
j = kp4
k = kp2
l = kp6
i = kp8
f = leftmouse
s = rightmouse
d = middlemouse
</code></pre><p>What this does is first of all attach  two layers <code>mod</code> and <code>dia</code> to <code>CapsLock</code> and right <code>Alt</code> respectively, and then it also gives the right <code>Ctrl</code> key a second purpose in life. Holding it still makes it act like your regular <code>Ctrl</code> key, but merely tapping it now will make it act like <code>PrintScreen</code> aka <code>SysRq</code>, allowing me to take screenshots more quickly than my laptop&rsquo;s keyboard layout would regularly allow<sup id="fnref:2"><a href="#fn:2" class="footnote-ref" role="doc-noteref">2</a></sup>.</p>
<p>But let&rsquo;s take a closer look at the layers.</p>
<h2 id="solving-my-umlaut-problem">Solving my umlaut problem</h2>
<p>Let&rsquo;s start with the <code>dia</code> layer, since that is what solves my umlaut problem. I couldn&rsquo;t get the compose key to work for me, so I went with mapping my desired shortcuts to the right shortcuts on the international layout for the key to pop up:</p>
<ul>
<li><code>a</code> -&gt; <code>AltGr</code>+<code>q</code> (<code>ä</code>)</li>
<li><code>o</code> -&gt; <code>AltGr</code>+<code>p</code> (<code>ö</code>)</li>
<li><code>u</code> -&gt; <code>AltGr</code>+<code>y</code> (<code>ü</code>)</li>
<li><code>s</code> -&gt; <code>AltGr</code>+<code>s</code> (<code>ß</code>)</li>
<li><code>e</code> -&gt; <code>AltGr</code>+<code>5</code> (<code>€</code>)</li>
<li><code>`</code> -&gt; <code>AltGr</code>+<code>Shift</code>+<code>;</code> (<code>°</code>)</li>
</ul>
<h2 id="adding-a-mod-layer">Adding a mod layer&hellip;</h2>
<p>While at it I decided to also add another feature I&rsquo;m used to from my UHK, and that is the Mod layer together with its arrow keys, home, end etc. So I replicated that as well, which is the <code>mod</code> layer here. And because I cannot remember a single time in my life where I ever needed <code>CapsLock</code>, that became my mod key. With Capslock held, we have the following mappings:</p>
<ul>
<li><code>j</code> -&gt; <code>left</code></li>
<li><code>k</code> -&gt; <code>down</code></li>
<li><code>l</code> -&gt; <code>right</code></li>
<li><code>i</code> -&gt; <code>up</code></li>
<li><code>u</code> -&gt; <code>home</code></li>
<li><code>o</code> -&gt; <code>end</code></li>
<li><code>y</code> -&gt; <code>pageup</code></li>
<li><code>h</code> -&gt; <code>pagedown</code></li>
<li><code>p</code> -&gt; <code>delete</code></li>
<li><code>;</code> -&gt; <code>insert</code></li>
</ul>
<p>I&rsquo;ve since also enabled <code>CapsLock</code> as <code>Mod</code> key on my UHK, in the hopes that this will accelerate my muscle memory learning process.</p>
<h2 id="-and-adding-a-mouse-layer-too">&hellip; and adding a mouse layer too!</h2>
<p>And then I thought, hm, can I maybe even add a mouse layer? And yes, I can. So I added a <code>mouse</code> layer, which is activated by holding <code>Alt</code> and <code>CapsLock</code> together. I enabled mouse keys in Gnome&rsquo;s accessibility settings, which allows me to move the mouse cursor with the numpad keys. My keyboard does not <em>have</em> numpad keys, but keyd doesn&rsquo;t care, and so we end up with this mapping:</p>
<ul>
<li><code>j</code> -&gt; move cursor left</li>
<li><code>k</code> -&gt; move cursor down</li>
<li><code>l</code> -&gt; move cursor right</li>
<li><code>i</code> -&gt; move cursor up</li>
<li><code>f</code> -&gt; left mouse button</li>
<li><code>s</code> -&gt; right mouse button</li>
<li><code>d</code> -&gt; middle mouse button</li>
</ul>
<p>I&rsquo;m not sure I&rsquo;ll actually use this a lot tbh, this was more a case of &ldquo;can it be done?&rdquo; and &ldquo;why not?&rdquo;. But it&rsquo;s nice to have the option. Something I still need to experiment on however are the acceleration settings, because out of the box this was way too slow for me, so after finding an answer <a href="https://askubuntu.com/a/1234995">here</a> I changed the mouse key parameters a bit via</p>
<pre tabindex="0"><code>gsettings set org.gnome.desktop.a11y.keyboard mousekeys-max-speed 2000;
gsettings set org.gnome.desktop.a11y.keyboard mousekeys-init-delay 20;
gsettings set org.gnome.desktop.a11y.keyboard mousekeys-accel-time 2000;
</code></pre><p>But I&rsquo;m not 100% happy with this yet and need to play around with things a bit more.</p>
<h2 id="fixing-the-disable-touchpad-while-typing-feature">Fixing the &ldquo;Disable Touchpad while Typing&rdquo; feature</h2>
<p>One problem arose from all of this reconfiguration, and that was that the &ldquo;Disable Touchpad while Typing&rdquo; (DWT) feature was no longer working, which turned out to be a rather big deal - I kept unintentionally moving the cursor or even clicking on things while typing. Thankfully a quick search made me stumble over <a href="https://linuxtouchpad.org/libinput/2022/05/07/disable-while-typing.htmls">this helpful post</a> that not only explained the issue but also showed me how to solve it.</p>
<p>To summarize, DWT works by pairing up touchpad and keyboard either by them having the same vendor and product id, or being marked as &ldquo;internal&rdquo;. In the case of keyd acting as my keyboard, neither was true anymore and thus DWT no longer worked. The solution was to modify the <code>libinput</code> properties of the virtual keyd keyboard such that it would be marked as &ldquo;internal&rdquo;. Putting this into <code>/etc/libinput/local-overrides.quirks</code> sufficed:</p>
<pre tabindex="0"><code>[Virtual Keyboard]
MatchUdevType=keyboard
MatchName=keyd virtual keyboard
AttrKeyboardIntegration=internal
</code></pre><h2 id="conclusion">Conclusion</h2>
<p>keyd seems like a powerful tool, and even though I haven&rsquo;t actually yet tested it, should at any point I want to switch to X11 or a blank terminal on this laptop now, all these mappings should continue to function (as long as I set the keyboard layout to English international). That&rsquo;s definitely a way cleaner solution than the <code>xmodmap</code> approach I was using in the past. And I can now finally type my name again!</p>
<div class="footnotes" role="doc-endnotes">
<hr>
<ol>
<li id="fn:1">
<p>US ANSI layout is <em>so</em> much nicer for programming than the German ISO DE layout. I switched around three years ago when I got my first <a href="https://ultimatehackingkeyboard.com/">UHK</a> and haven&rsquo;t looked back.&#160;<a href="#fnref:1" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
<li id="fn:2">
<p>I tend take a <em>lot</em> of screenshots (mostly OctoPrint related), so this is a big deal for me.&#160;<a href="#fnref:2" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
</ol>
</div>
]]></content:encoded></item><item><title>How to make dnf default to yes</title><link>https://foosel.net/til/how-to-make-dnf-default-to-yes/</link><pubDate>Thu, 02 Mar 2023 00:00:00 +0000</pubDate><guid>https://foosel.net/til/how-to-make-dnf-default-to-yes/</guid><description>&lt;p&gt;I&amp;rsquo;m currently in the process of setting up my new &lt;a href="https://frame.work"&gt;Frame.work laptop&lt;/a&gt;, and since I&amp;rsquo;ve been using Debian-derivatives for the past two decades now, I decided to use the opportunity, try something new for once and installed &lt;a href="https://fedoraproject.org"&gt;Fedora&lt;/a&gt;&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;
&lt;p&gt;Something that got annoying quickly is that the package manager command &lt;code&gt;dnf&lt;/code&gt; defaults to &amp;ldquo;no&amp;rdquo; when asking if you really want to install a package plus its dependencies. I&amp;rsquo;m very used to &lt;code&gt;apt&lt;/code&gt;&amp;rsquo;s behaviour here that allows me to type &lt;code&gt;sudo apt install &amp;lt;package&amp;gt;&lt;/code&gt; and then just hit &lt;code&gt;Enter&lt;/code&gt; on the sanity check. I wanted the same for &lt;code&gt;dnf&lt;/code&gt;, but without bypassing the sanity check altogether. I did some digging together with my buddy &lt;a href="https://ben.sycha.uk/"&gt;Ben&lt;/a&gt; and we found the answer.&lt;/p&gt;</description><content:encoded><![CDATA[<p>I&rsquo;m currently in the process of setting up my new <a href="https://frame.work">Frame.work laptop</a>, and since I&rsquo;ve been using Debian-derivatives for the past two decades now, I decided to use the opportunity, try something new for once and installed <a href="https://fedoraproject.org">Fedora</a><sup id="fnref:1"><a href="#fn:1" class="footnote-ref" role="doc-noteref">1</a></sup>.</p>
<p>Something that got annoying quickly is that the package manager command <code>dnf</code> defaults to &ldquo;no&rdquo; when asking if you really want to install a package plus its dependencies. I&rsquo;m very used to <code>apt</code>&rsquo;s behaviour here that allows me to type <code>sudo apt install &lt;package&gt;</code> and then just hit <code>Enter</code> on the sanity check. I wanted the same for <code>dnf</code>, but without bypassing the sanity check altogether. I did some digging together with my buddy <a href="https://ben.sycha.uk/">Ben</a> and we found the answer.</p>
<p>Edit the file <code>/etc/dnf/dnf.conf</code> and add the following line to the <code>[main]</code> section:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>defaultyes<span style="color:#f92672">=</span>True
</span></span></code></pre></div><p>And once that&rsquo;s done, the sanity check now is <code>Y/n</code> instead of <code>y/N</code> and you can just hit <code>Enter</code> to install the package.</p>
<p>(This is btw the first post written on the new laptop and I&rsquo;m really enjoying it so far!)</p>
<div class="footnotes" role="doc-endnotes">
<hr>
<ol>
<li id="fn:1">
<p>To all my Debian friends: It&rsquo;s really just curiousity and expanding my horizon, no need to try to convert me back or anything like that 😉&#160;<a href="#fnref:1" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
</ol>
</div>
]]></content:encoded></item></channel></rss>