<?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>Linux on Thanos Apollo</title>
    <link>https://thanosapollo.org/categories/linux/</link>
    <description>Recent content in Linux on Thanos Apollo</description>
    <generator>Hugo</generator>
    <language>en</language>
    <lastBuildDate>Thu, 18 Sep 2025 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://thanosapollo.org/categories/linux/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Emacs Everywhere, even in Wayland</title>
      <link>https://thanosapollo.org/posts/use-emacs-everywhere/</link>
      <pubDate>Sat, 19 Jul 2025 00:00:00 +0000</pubDate>
      <guid>https://thanosapollo.org/posts/use-emacs-everywhere/</guid>
      <description>How to use Emacs for input in any scenario in Wayland</description>
      <content:encoded><![CDATA[<p>If you are anything like me, you probably feel something is wrong
whenever you have to input text outside of Emacs. Fear not,
there&rsquo;s a solution.</p>
<p>Here&rsquo;s a simple code snippet to launch an emacs temp frame for input instead.</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-emacs-lisp" data-lang="emacs-lisp"><span style="display:flex;"><span>(defun thanos/wtype-text (text)
</span></span><span style="display:flex;"><span>  <span style="color:#e6db74">&#34;Process TEXT for wtype, handling newlines properly.&#34;</span>
</span></span><span style="display:flex;"><span>  (let* ((has-final-newline (string-match-p <span style="color:#e6db74">&#34;\n$&#34;</span> text))
</span></span><span style="display:flex;"><span>         (lines (split-string text <span style="color:#e6db74">&#34;\n&#34;</span>))
</span></span><span style="display:flex;"><span>         (last-idx (<span style="color:#a6e22e">1-</span> (<span style="color:#a6e22e">length</span> lines))))
</span></span><span style="display:flex;"><span>    (string-join
</span></span><span style="display:flex;"><span>     (cl-loop for line in lines
</span></span><span style="display:flex;"><span>              for i from <span style="color:#ae81ff">0</span>
</span></span><span style="display:flex;"><span>              collect (cond
</span></span><span style="display:flex;"><span>                       <span style="color:#75715e">;; Last line without final newline</span>
</span></span><span style="display:flex;"><span>                       ((and (<span style="color:#a6e22e">=</span> i last-idx) (not has-final-newline))
</span></span><span style="display:flex;"><span>                        (<span style="color:#a6e22e">format</span> <span style="color:#e6db74">&#34;wtype -s 350 \&#34;%s\&#34;&#34;</span>
</span></span><span style="display:flex;"><span>                                (replace-regexp-in-string <span style="color:#e6db74">&#34;\&#34;&#34;</span> <span style="color:#e6db74">&#34;\\\\\&#34;&#34;</span> line)))
</span></span><span style="display:flex;"><span>                       <span style="color:#75715e">;; Any other line</span>
</span></span><span style="display:flex;"><span>                       (<span style="color:#66d9ef">t</span>
</span></span><span style="display:flex;"><span>                        (<span style="color:#a6e22e">format</span> <span style="color:#e6db74">&#34;wtype -s 350 \&#34;%s\&#34; &amp;&amp; wtype -k Return&#34;</span>
</span></span><span style="display:flex;"><span>                                (replace-regexp-in-string <span style="color:#e6db74">&#34;\&#34;&#34;</span> <span style="color:#e6db74">&#34;\\\\\&#34;&#34;</span> line)))))
</span></span><span style="display:flex;"><span>     <span style="color:#e6db74">&#34; &amp;&amp; &#34;</span>)))
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>(defun thanos/type ()
</span></span><span style="display:flex;"><span>  <span style="color:#e6db74">&#34;Launch a temporary frame with a clean buffer for typing.&#34;</span>
</span></span><span style="display:flex;"><span>  (interactive)
</span></span><span style="display:flex;"><span>  (let ((frame (make-frame <span style="color:#f92672">&#39;</span>((name <span style="color:#f92672">.</span> <span style="color:#e6db74">&#34;emacs-float&#34;</span>)
</span></span><span style="display:flex;"><span>                             (fullscreen <span style="color:#f92672">.</span> <span style="color:#ae81ff">0</span>)
</span></span><span style="display:flex;"><span>                             (undecorated <span style="color:#f92672">.</span> <span style="color:#66d9ef">t</span>)
</span></span><span style="display:flex;"><span>                             (width <span style="color:#f92672">.</span> <span style="color:#ae81ff">70</span>)
</span></span><span style="display:flex;"><span>                             (height <span style="color:#f92672">.</span> <span style="color:#ae81ff">20</span>))))
</span></span><span style="display:flex;"><span>        (buf (<span style="color:#a6e22e">get-buffer-create</span> <span style="color:#e6db74">&#34;emacs-float&#34;</span>)))
</span></span><span style="display:flex;"><span>    (<span style="color:#a6e22e">select-frame</span> frame)
</span></span><span style="display:flex;"><span>    (switch-to-buffer buf)
</span></span><span style="display:flex;"><span>    (<span style="color:#a6e22e">erase-buffer</span>)
</span></span><span style="display:flex;"><span>    (org-mode)
</span></span><span style="display:flex;"><span>    (setq-local header-line-format
</span></span><span style="display:flex;"><span>                (<span style="color:#a6e22e">format</span> <span style="color:#e6db74">&#34; %s to insert text or %s to cancel.&#34;</span>
</span></span><span style="display:flex;"><span>                        (<span style="color:#a6e22e">propertize</span> <span style="color:#e6db74">&#34;C-c C-c&#34;</span> <span style="color:#e6db74">&#39;face</span> <span style="color:#e6db74">&#39;help-key-binding</span>)
</span></span><span style="display:flex;"><span>            (<span style="color:#a6e22e">propertize</span> <span style="color:#e6db74">&#34;C-c C-k&#34;</span> <span style="color:#e6db74">&#39;face</span> <span style="color:#e6db74">&#39;help-key-binding</span>)))
</span></span><span style="display:flex;"><span>    (local-set-key (kbd <span style="color:#e6db74">&#34;C-c C-k&#34;</span>)
</span></span><span style="display:flex;"><span>           (lambda () (interactive)
</span></span><span style="display:flex;"><span>             (kill-new (<span style="color:#a6e22e">buffer-string</span>))
</span></span><span style="display:flex;"><span>             (<span style="color:#a6e22e">delete-frame</span>)))
</span></span><span style="display:flex;"><span>    (local-set-key (kbd <span style="color:#e6db74">&#34;C-c C-c&#34;</span>)
</span></span><span style="display:flex;"><span>           (lambda () (interactive)
</span></span><span style="display:flex;"><span>             (start-process-shell-command
</span></span><span style="display:flex;"><span>              <span style="color:#e6db74">&#34;wtype&#34;</span> <span style="color:#66d9ef">nil</span>
</span></span><span style="display:flex;"><span>              (thanos/wtype-text (<span style="color:#a6e22e">buffer-string</span>)))
</span></span><span style="display:flex;"><span>             (<span style="color:#a6e22e">delete-frame</span>)))))
</span></span></code></pre></div><blockquote>
<p><em>Make sure <code>wtype</code> is installed in your system for the above snippet to work.</em></p>
</blockquote>
<p>All you have to do now is just bind <code>emacsclient --eval '(thanos/type)'</code>
to a shortcut of your liking.</p>
<p>On my Hyprland setup I&rsquo;m using the following settings</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-text" data-lang="text"><span style="display:flex;"><span>bind = $mainMod, j, exec, emacsclient --eval &#39;(thanos/type)&#39;
</span></span><span style="display:flex;"><span>windowrulev2 = float,class:^(emacs)$,title:^(emacs-float)$ # Launch as a floating window.
</span></span></code></pre></div><blockquote>
<p>For xorg users, you can simply rely on the <a href="https://github.com/tecosaur/emacs-everywhere">Emacs Everywhere</a>
package. <em>Unfortunately it does not support Wayland yet and I have
not tried it.</em></p>
</blockquote>
]]></content:encoded>
    </item>
    <item>
      <title>Switching To Gentoo Linux</title>
      <link>https://thanosapollo.org/posts/gentoo-beginning/</link>
      <pubDate>Sun, 12 Nov 2023 00:00:00 +0000</pubDate>
      <guid>https://thanosapollo.org/posts/gentoo-beginning/</guid>
      <description>The end-game of my Linux journey has begun | Switching to Gentoo, the beginning.</description>
      <content:encoded><![CDATA[<p>I&rsquo;ve leveled up to become a Gentoo user, the most elite nerd species
in GNU/Linux Land. All my devices have been transformed into Gentoo
machines, and needless to say, I&rsquo;m ecstatic about it.</p>
<p><em>Disclaimer: This post contains a healthy amount of sarcasm, just in
case you didn&rsquo;t catch on.</em></p>
<figure>
    <img loading="lazy" src="/images/setup-07-11-2023.jpg"
         alt="Gentoo Desktop and Thinkpad Setup" width="450"/> 
</figure>

<h2 id="about">About</h2>
<p>I&rsquo;ve been an <a href="https://archlinux.org">Arch Linux</a> user for a while now,
Arch Linux was the first distro I&rsquo;ve ever installed on hardware. It
treated me well over the past year, but after trying out gentoo on a virtual
machine I think I&rsquo;ve found my <code>$HOME</code>. Now I&rsquo;m running
<a href="https://gentoo.org">Gentoo</a> on all of my devices for the past 2+ weeks.</p>
<h2 id="what-did-you-enjoy-so-much-about-gentoo">What did you enjoy so much about Gentoo?</h2>
<h3 id="gentoo-handbook">Gentoo Handbook</h3>
<p><a href="https://wiki.gentoo.org/wiki/Handbook:Main_Page">The Gentoo Handbook</a>, I
can&rsquo;t really stress this enough, the Gentoo Handbook, is
<strong><em>extensively</em></strong> documented with every detail you might need,
<strong><em>specifically</em></strong> for using Gentoo. The Arch Wiki is awesome, it
includes documentation for a wide range of programs, but it&rsquo;s a
generic documentation that feels more like a general &ldquo;Linux wiki&rdquo;
rather than specific for Arch Linux. Even the parts that are specific
to Arch Linux, such as the installation instructions, are <em>severely</em> lacking,
which leads to most of the Arch Linux users to rely on third party
guides even on how to install their OS.</p>
<p>No other Linux Distribution has a centralized &ldquo;book&rdquo; that takes you
&ldquo;by the hand&rdquo; from the installation process all the way to working
with native software tools that you&rsquo;ll interact with on a daily basis, that
can compare to the Gentoo Handbook.</p>
<h3 id="community">Community</h3>
<p>One thing that I advocate about choosing which software to use is:</p>
<blockquote>
<p>Use software projects that you wouldn&rsquo;t mind / would like contributing to</p>
</blockquote>
<p>Gentoo community is the most helpful one that I&rsquo;ve found so far,
specifically I&rsquo;ve had people on the <a href="https://wiki.gentoo.org/wiki/Project:GURU">GURU
Project</a>, <em>analogous to the
AUR</em> package software that I needed as well as help me on
contributing, which has been a rather pleasant &amp; chill experience.</p>
<blockquote>
<p>If a project has a &ldquo;toxic&rdquo; community that you don&rsquo;t want to interact
with, its a huge red-flag for me.</p>
</blockquote>
<h2 id="but-why-would-you-compile-everything-from-source">But&hellip; Why would you compile everything from source?</h2>
<blockquote>
<p><em>Because someone has too&hellip;</em></p>
</blockquote>
<p>Jokes aside, there are many advantages to compiling your system from
source rather than installing an already made binary that someone
else compiled, hoping that it is compiled the way you want.</p>
<blockquote>
<p><a href="https://yewtu.be/watch?v=8QcI43IwkVc">Mental Outlaw (Invidious)</a>
has made a nice video explaining some important details/reasons for
running Gentoo, as well as <a href="https://yewtu.be/watch?v=6JUD-ZYuLPA">10leej
(Invidious)</a>, if you want to learn more.</p>
</blockquote>
<h2 id="it-takes-way-too-much-time-install-nobody-has-time-for-that">It takes way too much time install, nobody has time for that!</h2>
<p>It doesn&rsquo;t really take that much more time from installing Arch Linux,
I&rsquo;ve installed Gentoo on my desktop (Ryzen 7 5800X) the first time, in
~2 hours, most of which I&rsquo;ve spend reading the handbook. For reference,
my compile times are as follows:</p>
<p><em>output of <code>genlop -t &lt;package&gt;</code></em></p>
<blockquote>
<p>sys-kernel/gentoo-kernel-6.1.57 merge time: 15 minutes and 40 seconds.
www-client/firefox-115.4.0 merge time: 15 minutes and 26 seconds.
app-editors/emacs-29.1-r1 merge time: 52 seconds.
x11-wm/qtile-0.22.1-r2 merge time: 6 seconds.</p>
</blockquote>
<p>The only time consuming compile times I&rsquo;ve seen were for firefox &amp;
linux kernel, both of which are just 30 min combined, you also have
the option to use -bin packages instead. With the exception of those 2
packages mentioned above, I haven&rsquo;t spend more than 2 minutes
compiling a package.</p>
<p>I&rsquo;ve first considered setting up <a href="https://www.distcc.org/">distcc</a> for
my ThinkPad x220, but eventually I decided to let firefox &amp;
gentoo-kernel compile while I&rsquo;m on the gym for my workout.</p>
<blockquote>
<p>Note: I&rsquo;ve only installed ~700 packages on ThinkPad, and ~900 on my
desktop, most of that difference is due to installing
qemu/virt-manager on my desktop &amp; random fonts. I&rsquo;m not using a DE,
if you are planning to use GNOME or KDE etc. you might have a
different experience than me in that regard, since many DE&rsquo;s are
quite large and take a lot of time to compile.</p>
</blockquote>
<h2 id="summary">Summary</h2>
<p>I&rsquo;ve been enjoying running Gentoo on all my devices for the past
weeks. One of the main advantages of Gentoo is the control it provides
for tailoring your system to your liking. This is bundled with one of the
best documentation, if not the best, available to learn everything you
need to know about using your Linux system.</p>
<p>The community is rather chill &amp; friendly that welcomes new
contributions and will help you with any issue you might have.</p>
<blockquote>
<p>If you are able to read and follow instructions on how to install &amp; use your
system, you will find Gentoo to be a simple, reliable Linux
Distribution, with a helpful community. If you want a &ldquo;just works&rdquo;
experience, stay away from Gentoo, it&rsquo;s a &ldquo;Nerd&rsquo;s Only Allowed&rdquo;
place.</p>
</blockquote>]]></content:encoded>
    </item>
  </channel>
</rss>
