<?xml version="1.0" encoding="utf-8"?> 
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US"><title type="html"><![CDATA[My land]]></title>
    
    
    
            <link href="https://blog.sgorava.xyz/" rel="alternate" type="text/html" title="html" />
            <link href="https://blog.sgorava.xyz/index.xml" rel="alternate" type="application/rss+xml" title="rss" />
    <updated>2026-04-22T02:05:05+02:00</updated>
    
    
    <author>
            <name>Juraj Oravec</name>
        </author>
    
        <id>https://blog.sgorava.xyz/</id>
    
        
        <entry>
            <title type="html"><![CDATA[CMake and GNU Gettext]]></title>
            <link href="https://blog.sgorava.xyz/memory/2026/03/cmake-and-gnu-gettext/" rel="alternate" type="text/html" />
            
                <id>https://blog.sgorava.xyz/memory/2026/03/cmake-and-gnu-gettext/</id>
            
            
            <published>2026-03-29T00:00:00+00:00</published>
            <updated>2026-03-29T00:00:00+00:00</updated>
            
            
            <content type="html"><![CDATA[<p>I wanted to add translation support to my personal project using CMake
and Gettext. CMake itself contains a <a href="https://cmake.org/cmake/help/v4.3/module/FindGettext.html">module</a> to
find and work with Gettext translation files. It looked simple, but
not everything goes according to plans.</p>
<p>It is always easy to blame someone else. I got confused by different
examples. First <a href="https://cmake.org/cmake/help/v4.3/module/FindGettext.html#id3">example</a> showed a file structure
as <code>locale/${language}/MyApp.po</code>, which failed me when I was trying to
integrate it into my program. This in combination with me playing with
it cause the CMake generation fail in error basicaly saying <code>The target with the name &quot;MyApp&quot; already exists.</code>. That is because the
basename is the same between multiple languages.</p>
<p>Second <a href="https://cmake.org/cmake/help/v4.3/module/FindGettext.html#id4">example</a> is showing a different file
folder structure <code>locale/${language}.po</code>. This one worked like a
charm, but it looks ugly, I wanted the first variant and was keeping
at it for hours to give up in the end.</p>
<p>A short note on my failure to realize that I should debug the CMake
itself instead of blindly searching online for hours without a proper
solution since there is not that much information online, which means
it either others are much smarter than me or that this is underused
module / feature in CMake.</p>
<h2 id="example-configuration">Example Configuration</h2>
<p>Example of the CMake configuration I used:</p>
<p>Messages.sh</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#000;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sh" data-lang="sh"><span style="display:flex;"><span><span style="color:#e5e5e5">#!/bin/sh
</span></span></span><span style="display:flex;"><span><span style="color:#e5e5e5"></span>
</span></span><span style="display:flex;"><span>xgettext --keyword=gttr --from-code=utf-8 -p locale -o MyApp.pot <span style="color:#87ceeb">`</span>find . -name <span style="color:#87ceeb">&#39;*.cpp&#39;</span> -o -name <span style="color:#87ceeb">&#39;*.hpp&#39;</span><span style="color:#87ceeb">`</span>
</span></span></code></pre></div><p>CmakeLists.txt</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#000;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-cmake" data-lang="cmake"><span style="display:flex;"><span>find_package(<span style="color:#87ceeb">Gettext</span>)
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>if (<span style="color:#87ceeb">Gettext_FOUND</span>)
</span></span><span style="display:flex;"><span>	add_custom_target(
</span></span><span style="display:flex;"><span>		<span style="color:#87ceeb">ExtractTranslations</span>
</span></span><span style="display:flex;"><span>		<span style="color:#87ceeb">ALL</span>
</span></span><span style="display:flex;"><span>		<span style="color:#87ceeb">WORKING_DIRECTORY</span> ${<span style="color:#eedd82">CMAKE_SOURCE_DIR</span>}
</span></span><span style="display:flex;"><span>		<span style="color:#87ceeb">COMMENT</span> <span style="color:#87ceeb">&#34;Extract translations from the source code.&#34;</span>
</span></span><span style="display:flex;"><span>		<span style="color:#87ceeb">COMMAND</span> <span style="color:#87ceeb">Messages.sh</span>
</span></span><span style="display:flex;"><span>	)
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>	gettext_create_translations(
</span></span><span style="display:flex;"><span>		<span style="color:#87ceeb">locale/MyApp.pot</span>
</span></span><span style="display:flex;"><span>		<span style="color:#87ceeb">ALL</span>
</span></span><span style="display:flex;"><span>		<span style="color:#87ceeb">locale/sk_SK.po</span>
</span></span><span style="display:flex;"><span>	)
</span></span><span style="display:flex;"><span>endif()
</span></span></code></pre></div>]]></content>
            
                 
                    
                 
                    
                         
                        
                            
                             
                                <category scheme="https://blog.sgorava.xyz/tags/thoughts" term="thoughts" label="Thoughts" />
                             
                                <category scheme="https://blog.sgorava.xyz/tags/programming" term="programming" label="Programming" />
                             
                                <category scheme="https://blog.sgorava.xyz/tags/cmake" term="cmake" label="CMake" />
                            
                        
                    
                
            
        </entry>
    
        
        <entry>
            <title type="html"><![CDATA[Yearly cleanup and KDevelop]]></title>
            <link href="https://blog.sgorava.xyz/memory/2026/01/yearly-cleanup-and-kdevelop/" rel="alternate" type="text/html" />
            
                <id>https://blog.sgorava.xyz/memory/2026/01/yearly-cleanup-and-kdevelop/</id>
            
            
            <published>2026-01-07T00:00:00+00:00</published>
            <updated>2026-01-07T00:00:00+00:00</updated>
            
            
            <content type="html"><![CDATA[<p>Every year in the winter I do a cleanup of the packages I have
installed in my system. These things accumulate over the year, be it
unused packages, orphaned / renamed packages in the repositories or
things from AUR. The aim is to remote things which are not needed
anymore.</p>
<p>This year, the biggest sacrifice was most of the Qt5, becuase most of
the programs I use switched to Qt6, so I decided to remove Qt5
packages which are not needed, this includes KDE Framworks 5 packages.</p>
<p>All went well and I removed around 200 packages, great outcome from
this cleanup session.</p>
<h2 id="kdevelop-trouble">KDevelop trouble</h2>
<p>As I went to play with code in KDevelop I noteced that the shell
integration provided by <code>kdevelop!</code> is not working and throws an error
that qdbus binary is missing.</p>
<pre tabindex="0"><code>Error: The qdbus (or qdbus-qt5) utility is missing.
</code></pre><p>KDevelop is native Qt6 program, it should not depends on Qt5 binaries.
This error was caused by removal of <code>qt5-tools</code> package, which
provides this binary. It is not a compile time dependency and it looks
like the Qt version this utility depends on does not realy matter, so
everything worked, as long as the Qt5 package was installed.</p>
<p>I decided to look into the issue and checked the bug reports, issues,
merge requests and the current / latest code. There was no mention of
this problem, so I decided to fix it on my own.</p>
<h3 id="qdbus">QDbus</h3>
<p>the binary for qdbus is named differently in different Linux
distributions, that is why the original code is checking for multiple
variants. I assume I need to do the same, so I tried to check few
distributions on how this binary is named.</p>
<ul>
<li><code>qdbus-qt6</code> - Fedora</li>
<li><code>qdbus6</code> - Artix, Arch, Manjaro, Ubuntu</li>
<li><code>qdbus</code> - General fallback</li>
</ul>
<p>There were differences in Qt5 and as expected, there are differences
in Qt6 as well. In my quick search I did not find any usage of
<code>qdbus</code>, but I am including it in case it appears somewhere.</p>
<p>And here I thought that <code>qdbus6</code> was generaly accepted name for Qt6
version of this tool, luckily I decided to check Fedora packages and
found that situation is more varried that I originaly thought.</p>
<h3 id="kde-cli-tools">KDE Cli Tools</h3>
<p>Package or repository &ldquo;kde-cli-tools&rdquo; provides tools on which the
<code>kdevelop!</code> script depends, namely I found <code>kioclinet5</code> and
<code>kde-open5</code>. The situation here is simpler, the KF6 version provides a
symlinks to KF5 versions while also providing the basic binaries
without numbers. I decided to remove the numbers to not rely on
fallbacks which tend to disappear.</p>
<h3 id="code">Code</h3>
<p>My changes can be found on <a href="https://invent.kde.org/kdevelop/kdevelop/-/merge_requests/860">KDevelop Invent</a> page.
I included a similar but shorted reasoning in the commit message
explaining why I did ehat I did.</p>
<h2 id="conclusion">Conclusion</h2>
<p>I like winter.</p>
]]></content>
            
                 
                    
                 
                    
                         
                        
                            
                             
                                <category scheme="https://blog.sgorava.xyz/tags/thoughts" term="thoughts" label="Thoughts" />
                             
                                <category scheme="https://blog.sgorava.xyz/tags/kdevelop" term="kdevelop" label="KDevelop" />
                            
                        
                    
                
            
        </entry>
    
        
        <entry>
            <title type="html"><![CDATA[When a bug is a feature]]></title>
            <link href="https://blog.sgorava.xyz/memory/2025/09/when-a-bug-is-a-feature/" rel="alternate" type="text/html" />
            
                <id>https://blog.sgorava.xyz/memory/2025/09/when-a-bug-is-a-feature/</id>
            
            
            <published>2025-09-05T00:00:00+00:00</published>
            <updated>2025-09-05T00:00:00+00:00</updated>
            
            
            <content type="html"><![CDATA[<p>After porting Falkon to Qt6 the WebIspector started working when
JavaScript was disable. I and few people who help with Falkon
development were of an opinion that this is a new feature of Qt6 and
did not look too deep into it. What a nice feature to have.</p>
<p>It has a dark side as well, after porting to Qt6 the WebInspector
settings were not saved into the profile. It was a bummer. I tried to
investigate it but came with nothing, I looked at it from a wrong
angle and wasted a lot of time. The solution was simple, initialize
the QWebEngineView with an active QWebEngineProfile and the settings
will be remembered.</p>
<p>And here we come a full circle. After fixing saving and loading of
WebInspector preferences by making sure the View (well, the Page which
the View is using) is using the correct profile, the feature that it
runs even with disabled javascript was broken. So with this knowledge
I could construct a workaround and always enable JavaScript for the
WebInspector. Other option to consider is to create a new profile
specificaly for WebInspector with specific configuration for it. Both
solutions are good enough, each with its own pros and cons.</p>
<p>Using the current profile results in:</p>
<ul>
<li>There is only one profile on disk.</li>
<li>Most of the user settings are still respected (local storage,
history, cookiesm etc.).</li>
<li>The required settings (JavaScript) has to be force enabled, and
maybe more, thiws has to be found over time.</li>
</ul>
<p>Using a new profile results in:</p>
<ul>
<li>Guard against using this profile in browser itself.</li>
<li>Different configuration of web profile settings ( data location,
images, etc.).</li>
</ul>
<p>I went with same profile solution, I think it is simpler to bake few
exceptions compared to doubling the configuration. The time will tell
how good this solution is.</p>
]]></content>
            
                 
                    
                 
                    
                         
                        
                            
                             
                                <category scheme="https://blog.sgorava.xyz/tags/thoughts" term="thoughts" label="Thoughts" />
                             
                                <category scheme="https://blog.sgorava.xyz/tags/falkon" term="falkon" label="Falkon" />
                            
                        
                    
                
            
        </entry>
    
        
        <entry>
            <title type="html"><![CDATA[Specialized device for a task]]></title>
            <link href="https://blog.sgorava.xyz/memory/2025/06/specialized-device-for-a-task/" rel="alternate" type="text/html" />
            
                <id>https://blog.sgorava.xyz/memory/2025/06/specialized-device-for-a-task/</id>
            
            
            <published>2025-06-03T00:00:00+00:00</published>
            <updated>2025-06-03T00:00:00+00:00</updated>
            
            
            <content type="html"><![CDATA[<h1 id="introduction">Introduction</h1>
<p>While modern people can use smart phones for almost anything, I came
to conclusion that while it is jack of all trades it rarely gets
things right. I do not know if it is because I am old fashioned or
just too slow to adapt. I am unable to accept using touchscreen
devices for longer than few minutes (moments).</p>
<p>The main advantage in using specialized device is for me to have
specialized functions such as special screen, better battery life,
keyboard with special keys/buttons, and overall environment which
allows me to focus on the given task (or just relaxing) without being
disturbed by some annoying notifications (like most smart phones do
when you use them a bit more). In other words I am able to separate
tasks and focus only on them.</p>
<p>As a disadvantage I can only think of having to carry multiple devices
when travelling. But with smart phones it is not that different
either. In order to get these phones as thin as possible the batteries
are relatively small and when you use the device it will quickly use
all (or most) of its energy and I am forced to carry some bulky
battery (power bank they call it, multiple of them at that). So even
with smartphone I still need to take care of multiple devices, they
just have a different purpose, which is to keep the main device
running.</p>
<h1 id="reading-books">Reading &ldquo;books&rdquo;</h1>
<p>I like reading, be it books, blog posts, web novels, documentation and
more. To do this I have two e-book readers. One is a small <code>PocketBook Basic 3 Lux</code> (6-inch screen) and the second one is <code>PockedBook InkPad X</code> (10-inch screen).</p>
<p>My first ebook reader was <code>PocketBook Basic</code>. It was &ldquo;cheap&rdquo; compared
to others, so it won me at the time. It still works, but it is slow
compared to newer models. The reason why I changed it to newer model
is because the button to switch to the next page is integrated in the
plastic body (there is no separate button, the plastic is bended/moves
to press the button) and the plastic cracked and cracked more until I
decided it is time to get a new one.</p>
<figure><img src="/images/2025-06-03_old_pocketbook.jpg"
    alt="My old PocketBook with broken &rsquo;next page&rsquo; button. Taken on Nokia phone with bad light."><figcaption>
      <p>My old PocketBook with broken &rsquo;next page&rsquo; button. Taken on Nokia phone with bad light.</p>
    </figcaption>
</figure>

<h2 id="pocketbook-basic">PocketBook Basic</h2>
<p>Both PocketBook Basic models use button only navigation/control. This
is exactly what I desire, because with this setup I can touch the
screen to track my thoughts as much as I want. If I make a mess, I can
always clean the screen later. I consider touchscreen as a disability
(or a disadvantage) for a device.</p>
<p>Due to the display size, the Basic version is only suitable for a text
which can be rearranged to the screen size with current font settings.
It is not suitable as a PDF reader. It provides me a great undisturbed
experience while reading whatever crazy &ldquo;book&rdquo; I want.</p>
<p>The official cases are fine, probably not available for older model
anymore and the one for the newer model seems to have fragile corners
(if they did not fix it). I had issues with official case for <code>Basic 3 Lux</code> but the last one seems to be stronger than the other ones.
Could be piece by piece?</p>
<h2 id="pocketbook-inkpad-x">PocketBook InkPad X</h2>
<p>I bought this device because I desired something to read PDFs (be
it specifications or stuff available only in PDF form). Most of the
PDF documents are made to be printed on a standard A4 size paper
(European guy here).</p>
<p>It has a touchscreen, which I only use for navigating the menu. Yes,
the touchscreen is wasted on me. Luckily, there is still someone
sensible in PocketBook and there are 4 buttons which can be used to
kind of control the device (show menu, next page, previous page, other
menu), so I mostly open the book and only press the navigation buttons
and I have to be careful to not touch the screen or it will do some
wild stuff.</p>
<p>It is a very useful device for reading documentation, just read and
forget the world around. It is great to read the whole (or most of)
specification when trying to implement something based on it.</p>
<p>The provided case for it is only for a protection while carying the
device, which is sad. I resorted to buying a foldable case from
AliExpress and it is great, a bit bulky but still awesome.</p>
<h2 id="overall">Overall</h2>
<p>Overall, I like PocketBook devices. They provide a great platform to
read whatever I throw at them, they work perfectly fine in offline
mode, the battery life is great (depends on how much I read, can range
from weeks to months).</p>
<h2 id="future">Future</h2>
<p>To make these e-readers even more usable I should at least try to
KOReader, which is an alternative reading program for ebook readers.
Based on reviews and what other people say about it, I would most
probably love to use it.</p>
<h1 id="listening-to-music">Listening to music</h1>
<p>I like music and I like to listen to music when travelling, specially
when travelling by public transport (it is a necessity there), so I
got myself a portable music player. After trying multiple low-end
ones I went with something a bit better.</p>
<p>My requirements were (still are) as follows:</p>
<ul>
<li>3.5mm Jack headphone connector</li>
<li>Physical control buttons</li>
<li>Good sound quality</li>
<li>RockBox support</li>
</ul>
<p>I went with HifiWalker H2, which is an awesome music player and I
dual-boot the official firmware with RockBox. The main advantage in
RockBox for me is a much better volume control (smaller steps) at a
low volume. This is especially useful when using earphones where a
change in volume could be like &ldquo;hard to hear&rdquo; vs &ldquo;way too much&rdquo;, with
RockBox there are many more steps (Original 0-100 vs RockBox 0-255).</p>
<h1 id="mobile-phone">Mobile phone</h1>
<p>I use a flip-flop style Nokia phone. It is the newer Nokia, so the
design and many other things are subpar, but it is a great phone to
sit in a dark cabinet and wait till it is needed (which is rare).</p>
<p>I rarely use mobile phone, so the best ability a mobile phone can have
is to stay charged for a long time, so I do not need to care for it.</p>
<h1 id="ending-thoughts">Ending thoughts</h1>
<p>For anything complex I use personal computer, be it desktop of laptop.
I love the versatility of it and how I can do all crazy stuff which I
would never be able to do with any smartphone today.</p>
<p>This is asking for a part 2, which may come in few years since I had
this article on hold for 4 years who knows when that will be.</p>
]]></content>
            
                 
                    
                 
                    
                         
                        
                            
                             
                                <category scheme="https://blog.sgorava.xyz/tags/thoughts" term="thoughts" label="Thoughts" />
                            
                        
                    
                
            
        </entry>
    
        
        <entry>
            <title type="html"><![CDATA[Elf symbols 0.3.0]]></title>
            <link href="https://blog.sgorava.xyz/memory/2025/05/elf-symbols-0.3.0/" rel="alternate" type="text/html" />
            
                <id>https://blog.sgorava.xyz/memory/2025/05/elf-symbols-0.3.0/</id>
            
            
            <published>2025-05-25T00:00:00+00:00</published>
            <updated>2025-05-25T00:00:00+00:00</updated>
            
            
            <content type="html"><![CDATA[<p>A new release of elf-symbols script. The new version brings the stuff
mentioned in the <a href="/memory/2025/03/elf-symbols-little-update/">previous article</a> and few more fixes
and changes.</p>
<h2 id="changelog">CHANGELOG</h2>
<ul>
<li>Reworked the bit offset from the left
<ul>
<li>I had a huge misunderstanding on how this works, so when I was
converting it to the offset from right I did not account for the
actual bit size which created a huge headache when trying to
print the correct bit masks.</li>
</ul>
</li>
<li>Parse and print static function variables
<ul>
<li>Also print variables defined in lexical blocks (between &ldquo;{}&rdquo;)</li>
<li>The linkage_name of these variable is often manged, so print it.</li>
</ul>
</li>
<li>Add option to print the mangled name of the variable
<ul>
<li>This is useful in combination with parting static variables
inside functions where apart from a nice name there is also
linage_name available which specifies where the variable belongs
in the code.</li>
<li>So far, I do not plan to write any demangler in the near future.</li>
</ul>
</li>
<li>Update licensing information
<ul>
<li>The original dwex code is under <a href="https://git.sgorava.xyz/Miscellaneous/elf_symbols/src/branch/master/dwex/LICENSE"><strong>BSD</strong></a></li>
<li>My code is from now on under <a href="https://git.sgorava.xyz/Miscellaneous/elf_symbols/src/branch/master/LICENSE"><strong>GPLv3</strong></a></li>
</ul>
</li>
<li>Play a little with README
<ul>
<li>I tried to rewrite it to look more like a real project.</li>
</ul>
</li>
</ul>
<p>All of the changes can be seen in the <a href="https://git.sgorava.xyz/Miscellaneous/elf_symbols/commits/branch/master">git logs</a>.</p>
<h2 id="thoughts">Thoughts</h2>
<p>The script is improving, gaining new features with each usage as I
find new bugs or edge case with embedded toolchains.</p>
<p>Short imaginary TODO list is:</p>
<ul>
<li>Fix bugs which will popup.</li>
<li>Refactor the code.</li>
<li>Add some control for the output</li>
<li>Print more stuff (I forgot about the reference type, again)</li>
</ul>]]></content>
            
                 
                    
                 
                    
                         
                        
                            
                             
                                <category scheme="https://blog.sgorava.xyz/tags/thoughts" term="thoughts" label="Thoughts" />
                             
                                <category scheme="https://blog.sgorava.xyz/tags/dwarf" term="dwarf" label="Dwarf" />
                             
                                <category scheme="https://blog.sgorava.xyz/tags/elf" term="elf" label="Elf" />
                            
                        
                    
                
            
        </entry>
    
        
        <entry>
            <title type="html"><![CDATA[I screwed up the release]]></title>
            <link href="https://blog.sgorava.xyz/memory/2025/05/i-screwed-up-the-release/" rel="alternate" type="text/html" />
            
                <id>https://blog.sgorava.xyz/memory/2025/05/i-screwed-up-the-release/</id>
            
            
            <published>2025-05-09T00:00:00+00:00</published>
            <updated>2025-05-09T00:00:00+00:00</updated>
            
            
            <content type="html"><![CDATA[<h2 id="falkon-2504">Falkon 25.04</h2>
<p>In the release of Falkon 25.04.0 is a
<a href="https://bugs.kde.org/show_bug.cgi?id=448238">feature</a> to show the bookmark or history
item address in the statusbar when the mouse hovers over the item (in
menu, toolbar, sidebar). I thought I tested everything, but I did not.
I did not test the folders in the bookmark toolbar. Before the
release, there was a bug report was this exact issue, which I thought
I resolved, but I only resolved a part of it.</p>
<p>So after the release was done, the bug was reopened and I managed to
fix it fully this time (I hope), but the release was already made. I
am not sure how should I approach this, so I pushed the fix and made
an announcement on the mailing lists (distributions - for the
distribution packagers to apply the patch, falkon - for users to know
there is a potential issue. Even with this, there were instances where
people and distribution packagers were not aware of the issue. I got a
mail that this should also be on the main page as an article about the
issue. I thought the mails are enough, since all people who can do
something about this should be following one of the mailing lists.</p>
<h2 id="falkon-2412">Falkon 24.12</h2>
<p>This release went mostly smoothly, but with the comming of Qt6.9 there
was a change in the graphic backend which could be used. The
implementation of Falkon &ldquo;Use hardware acceleration&rdquo; option sets the
backend option for QtWebEngine/Chromium backend. This causes Falkon
to crash with rendering ŕelated errors.</p>
<p>The <a href="https://invent.kde.org/network/falkon/-/merge_requests/106">fix</a> for this was implemented during the Falkon 24.12
lifecycle but was never cherry picked for this release, because I
thought it is not relevant, it will just work (right??). While I had
other things to worry about, I totally  missed this crucial detail and
with a final release of Qt6.9 Falkon 24.12 started crashing when
hardware acceleration was enabled.I did not report on this issue
anywhere, I only mentioned a possible fix in the bug reports and that
is how I found what the issue with Qt6.9 is as well.</p>
<p>This is one of the reasons why I do not like setting chromium options
(flags) and rather opt to wait for official Qt API to bring some
feature. I do not have will to play with all these flags. Users can
set them on their own and thus the responsibility is on them.</p>
<h2 id="conclusion">Conclusion</h2>
<p>So I kind of screwed up two major releases of Falkon and introduced
multiple bugs and under reported them. Is this the price to pay for a
progress?</p>
]]></content>
            
                 
                    
                 
                    
                         
                        
                            
                             
                                <category scheme="https://blog.sgorava.xyz/tags/thoughts" term="thoughts" label="Thoughts" />
                             
                                <category scheme="https://blog.sgorava.xyz/tags/falkon" term="falkon" label="Falkon" />
                             
                                <category scheme="https://blog.sgorava.xyz/tags/kde" term="kde" label="KDE" />
                            
                        
                    
                
            
        </entry>
    
        
        <entry>
            <title type="html"><![CDATA[Elf symbols, little update]]></title>
            <link href="https://blog.sgorava.xyz/memory/2025/03/elf-symbols-little-update/" rel="alternate" type="text/html" />
            
                <id>https://blog.sgorava.xyz/memory/2025/03/elf-symbols-little-update/</id>
            
            
            <published>2025-03-25T00:00:00+00:00</published>
            <updated>2025-03-25T00:00:00+00:00</updated>
            
            
            <content type="html"><![CDATA[<p>A little while ago I worked more on my little script to extract and
expand the global symbols from an ELF file with debug (DWARF)
informations. I keep it in my head all the time, so&hellip;</p>
<p>Here are the changes and some explanation for them.</p>
<ul>
<li>Small optimization in address handling. The script was constantly
converting the address from integer to hexadecimal string and back
on every operation where address was needed. That is now gone and
the conversion is done only at printing.</li>
<li>Resolve constant addresses. This one is kind of simple and it
bothers me how I did not consider such a simple thing.</li>
<li>Experimental support for bit offsets in structs. I am not sure if I
am doing it right here, it seems to work with my examples, but I am
still not super convinced especially because I totally ignore the
program data structure and endian-ness. Maybe I am here for a world
of hurt.</li>
<li>Maximum array size handling. This one is a nice one. When the array
is empty the maximum (all bits are &lsquo;1&rsquo;) value is set for the array
size. The script was than trying to expand this infinite amount of
elements and it would either crash all eat all the memory. So, I for
not investigated and set a configurable guard to limit the number of
array elements.</li>
<li>Apply data from specification to the DIE. The DIE may not contain
all the required information like size or the address, this
information is instead stored in a separate DIE made specificaly to
specify and add some information to the original DIE. To add support
for this, I went with a barbaric way and go over all DIEs in the elf
file before running the type resolution on variables. There is a
noticable slow down together with the next point.</li>
<li>Variable &ldquo;normalization&rdquo; by address. I call it &ldquo;normalization&rdquo; but
the real thing is that I filter the DIEs with &ldquo;0&rdquo; as an address.
The problem which I encountered is that in many CUs (Compile Units)
the same variable is defined but the address is either not present
and the data from specifications should be used to get it, or the
address is zero on purpose, or the address is directly only on one
DIE and all other ones are without it. And I did not found a good
way to get rid of them all apart from filtering variables with zero
address. This adds some time to process once again and slows the
thing down. Well, it can also speed it up since the printing is the
slowest part of the program.</li>
</ul>
<p>All of the changes can be seen in the <a href="https://git.sgorava.xyz/Miscellaneous/elf_symbols/commits/branch/master">git logs</a>.</p>
<p>Maybe one day I will write a nice proper introduction and description
of this little script. There is still a lot of work and feature to do.</p>]]></content>
            
                 
                    
                 
                    
                         
                        
                            
                             
                                <category scheme="https://blog.sgorava.xyz/tags/thoughts" term="thoughts" label="Thoughts" />
                             
                                <category scheme="https://blog.sgorava.xyz/tags/dwarf" term="dwarf" label="Dwarf" />
                             
                                <category scheme="https://blog.sgorava.xyz/tags/elf" term="elf" label="Elf" />
                            
                        
                    
                
            
        </entry>
    
        
        <entry>
            <title type="html"><![CDATA[Thoughts about Qt WebEngine survey]]></title>
            <link href="https://blog.sgorava.xyz/memory/2025/02/thoughts-about-qt-webengine-survey/" rel="alternate" type="text/html" />
            
                <id>https://blog.sgorava.xyz/memory/2025/02/thoughts-about-qt-webengine-survey/</id>
            
            
            <published>2025-02-14T00:00:00+00:00</published>
            <updated>2025-02-14T00:00:00+00:00</updated>
            
            
            <content type="html"><![CDATA[<p>I took the Qt WebEngine survey since I work with Qt WebEngine when I
work on Falkon. The questions were at times well made and at times
made from a corporate perspective when Free Open Source Software
development model together with software distribution through the
repositories of all the different Linux distributions was totally
forgotten.</p>
<p>I write this little note here because I took the survey from the
<a href="https://lists.qt-project.org/pipermail/development/2025-February/046131.html">development mailing list</a> and found these options
missing. How am I suppose to answer when the answer is not there and
only supported answer is what is probably directly supported by Qt
Company itself?</p>
<p>The major point was that the <code>comment</code> field at the
last question had to be <strong>EMPTY</strong> to be able to send the whole survey,
if I wrote whatever into the <code>comment</code> field, it would not send the
survey since I did <strong>NOT</strong> fill the <code>comment</code> field.</p>
<p>And the last point on my mind is that I tried to send the mail to 2
different Qt mailing lists &ldquo;interest&rdquo; and &ldquo;development&rdquo; and got
rejecting mail back &ldquo;only subscribers can send messages here&rdquo;. I gave
up and made this post, enjoy.</p>
]]></content>
            
                 
                    
                 
                    
                         
                        
                            
                             
                                <category scheme="https://blog.sgorava.xyz/tags/thoughts" term="thoughts" label="Thoughts" />
                             
                                <category scheme="https://blog.sgorava.xyz/tags/qt" term="qt" label="Qt" />
                            
                        
                    
                
            
        </entry>
    
        
        <entry>
            <title type="html"><![CDATA[Preparing Akko keyboard for myself]]></title>
            <link href="https://blog.sgorava.xyz/memory/2025/01/preparing-akko-keyboard-for-myself/" rel="alternate" type="text/html" />
            
                <id>https://blog.sgorava.xyz/memory/2025/01/preparing-akko-keyboard-for-myself/</id>
            
            
            <published>2025-01-26T00:00:00+00:00</published>
            <updated>2025-01-26T00:00:00+00:00</updated>
            
            
            <content type="html"><![CDATA[<p>At the end of the year I ordered an Akko keyboard &ldquo;<a href="https://akkogear.de/en/collections/iso-keyboards/products/black-gold-5108b-plus-iso-mechanical-keyboard">5108
B</a>&rdquo; 100% keyboard. It arrived with 3 weeks despite it being
end of the year (top season for delivery guys). The keyboard was in
50% diascount and with free shipping, so I only paid around 70€ for
it. I consider this a steam since keyboards with similar features cost
easily around 200€ (check the Ducky keyboards of which I think Akko is
a clone).</p>
<h2 id="switches">Switches</h2>
<p>I got the &ldquo;Akko V3 Cream Blue Pro&rdquo; tactile switches, they feel nice (for now after
few minutes of using them). The switches are hot-swapable which is
great for repairing or testing new and different switches.</p>
<h2 id="construction">Construction</h2>
<p>The keyboard supports bluetooth, usb and 2.4 GHz radio connection
(with a usb dongle). I only care about the usb connection, so anything
else is a waste for me. To facilitate the wireless modes the keyboard
contains 3000mAh lithium battery. I decided to see how hard it is to
remove the battery. There is a guide to change the battery on other
Akko keyboard on <a href="https://www.ifixit.com/Guide/Akko+3068B+Battery+Replacement/170040">iFixIt website</a>, I followed it
and it was very similar (different keyboards, but same steps and
things to worry about).</p>
<p>Akko gets full points from me when it comes to the construction and
repairability in the future. While it takes some fighting to open the
keyboard and the battery is glued in place, both usb connector and
battery are internally connected via cables and connectors (this is
awesome). So I disconnected the battery and taken it out, everything
works fine and the only difference which I can see right now is that
the battery status LED (oh, those LEDs are shiny) blinks each few
seconds, before it was shining all the time. I placed a black tape
over this misbehaving LED.</p>
<h2 id="backlight">Backlight</h2>
<p>The supplied key-caps do not have transparent letters, so the
backlight is only around the keys. This is a missed opportunity in my
eyes. Since I had my old keyboard which had transparent key-caps I
swapped them, now it looks great.</p>
<h2 id="backlight-control">Backlight Control</h2>
<p><strong>EDIT</strong> It turns out there is a keyboard shortcut <code>Fn+\</code> (between
Enter and Shift) which cycles through different colors, but this is
not mentioned in the manual for this exact keyboard, but it is
mentioned for some of the other keyboards Akko makes. This is very
confusing and this keyboard shortcut should be in the manual (or is it
a mercy of a programmer who added it and I should be happy it even
exist?).</p>



<details>
<summary>Original thoughts</summary>
<blockquote>
<p>It is a total mess from Linux perspective. The keyboard has
different preprogrammed effects which can be changed with key
shortcurts but none of them is some default stable color (red in my
case). It would be awesome to have this preconfigured. On that light
I had to get Lose (Windows) 10 in the qemu and install the &ldquo;driver&rdquo;
there to set the backlight to a fixed color. The settings appear to
be saved, so I can live with using the devil once.</p>
<p>Fun fact, if their software could detect the keyboard in Wine it
would be awesome. I tried to run it but it could not find the card
and was a bit slow to react, but it ran seemingly fine. On  the
Lose10 on the other hand after installing the software it could not
run bacuse some dll was missing and I had to hunt down what it needs
on the internet.</p>
<p>It would be much better if Akko provided support for their products
in OpenRGB project. That would be awesome and I would not need to
fight the software so much.</p>
</blockquote>

</details>

<h2 id="key-map">Key map</h2>
<p>This mechanical keyboard with hot-swapable switches has ISO layout. It
is hard to find a good keyboard with this layout, almost all of them
have the ANSI layout.</p>
<p>There is a small drawback to the key layout which cannot be changed in
their software, there is not context menu key and the right Super key
cannot be remapped in the keyboard to act like a menu key. A sad thing
this is.</p>
<h2 id="conclusion">Conclusion</h2>
<p>It is a nice keyboard which is satisfyingly heavy and nice to use, at
least after initial configuration and my little modifications.</p>
<p>NNow this keyboard is truly my own.</p>
]]></content>
            
                 
                    
                 
                    
                         
                        
                            
                             
                                <category scheme="https://blog.sgorava.xyz/tags/thoughts" term="thoughts" label="Thoughts" />
                            
                        
                    
                
            
        </entry>
    
        
        <entry>
            <title type="html"><![CDATA[Falkon Adblock popup blocking]]></title>
            <link href="https://blog.sgorava.xyz/memory/2025/01/falkon-adblock-popup-blocking/" rel="alternate" type="text/html" />
            
                <id>https://blog.sgorava.xyz/memory/2025/01/falkon-adblock-popup-blocking/</id>
            
            
            <published>2025-01-18T00:00:00+00:00</published>
            <updated>2025-01-18T00:00:00+00:00</updated>
            
            
            <content type="html"><![CDATA[<p>In the Qt5 it was not easily possible to block the new (popup) window
request because the function &ldquo;<a href="https://doc.qt.io/qt-6/qwebenginepage.html#createWindow">createWindow</a>&rdquo;
which handles the window creation did not provide the required
information (destination URL). It was not imposibble but not
straightforward either, so it was not implemented. It Qt6.2 there is a
new signel &ldquo;<a href="https://doc.qt.io/qt-6/qwebenginepage.html#newWindowRequested">newWindowRequested</a>&rdquo; which
provides the destination url and also if the request was initiated by
human or not. This is ideal for selective blocking of the window
creation, eg. popup blocking in AdBlock.</p>
<h2 id="falkon-part">Falkon part</h2>
<p>To implement this in AdBlock (which is an extension), I first modified
the main Falkon code to move from the &ldquo;createWindow&rdquo; implementation to
&ldquo;newWindowRequested&rdquo;. I used this chance to add an option to
preferences to &ldquo;Block automatic popups&rdquo; which are all popups not
originating from human interaction (or so I hope).</p>
<p>Next I went and implemented similar (more like same) plugin interface
which is used for &ldquo;acceptNavigationalRequest&rdquo; function and which is
also available for plugins. Having an example is awesome. Also Falkon
has multiple APIs for extensions. The C++ is straghtforward normal
code, Python I hope will catch it all as well (I truly just hope) and
Qml needs special attention since it is manualy made API contrary to
Python support which is mostly automatically generated (even when it
produces a lot of warnings).</p>
<p>The results can be seen in the <a href="https://invent.kde.org/network/falkon/-/merge_requests/120">merge request
120</a>.</p>
<h2 id="adblock-part">AdBlock part</h2>
<p>The AdBlock part of the implementation is relatively simple. I tried
to reuse the original code for network interceptor, since it looks and
behave the same way and done. Well, it was simple after the needed API
was introduced. The implementation passes both <a href="https://abptestpages.org/en/filters/popup">Popup</a> and
<a href="https://abptestpages.org/en/exceptions/popup">Popup Exception</a> testpages.</p>
<p>The results can be seen in the <a href="https://invent.kde.org/network/falkon/-/merge_requests/121">merge request
121</a>.</p>
<h2 id="conclusion">Conclusion</h2>
<p>As the popups are the most annoying part of advertisements and very
important part of adblockers it is great that it is now possible to
block them in Falkon as well.</p>
<p>This continues my lurking around Falkon AdBlock code. The number of
supported features is slowly increasing (but it gets me a good
headache while working on it).</p>
<p>I also updated the <a href="/memory/2025/01/falkon-adblock-testpage-results/">Falkon ABP Test Page results</a>.</p>
]]></content>
            
                 
                    
                 
                    
                         
                        
                            
                             
                                <category scheme="https://blog.sgorava.xyz/tags/falkon" term="falkon" label="Falkon" />
                             
                                <category scheme="https://blog.sgorava.xyz/tags/programming" term="programming" label="Programming" />
                            
                        
                    
                
            
        </entry>
    
        
        <entry>
            <title type="html"><![CDATA[Falkon Adblock dialog and remove rule]]></title>
            <link href="https://blog.sgorava.xyz/memory/2025/01/falkon-adblock-dialog-and-remove-rule/" rel="alternate" type="text/html" />
            
                <id>https://blog.sgorava.xyz/memory/2025/01/falkon-adblock-dialog-and-remove-rule/</id>
            
            
            <published>2025-01-13T00:00:00+00:00</published>
            <updated>2025-01-13T00:00:00+00:00</updated>
            
            
            <content type="html"><![CDATA[<h2 id="adblock-dialog">AdBlock Dialog</h2>
<p>During the development of the AdBlock stuff I need to frequently
interact with AdBlock Dialog window to modify the &ldquo;Custom Rules&rdquo;
filter list. Since due to historical reasons and probably for the ease
of use the dialog uses <code>QTreeWidget</code> and each item added to this list
is mapped to the source <code>QVector</code> list (<code>QList</code> now) by an index
number stored in the data section of the widget item.</p>
<p>I hope you already see where the source of my frustration and
potential issues is (<a href="https://bugs.kde.org/show_bug.cgi?id=407402">maybe relevant
bug?</a>). After the item was removed from
the list, the underlying indexes in data section in other items where
not updated which let to not deleting rules, deleting incorrect rules,
crashing and maybe some other weird stuff.</p>
<p>SO I went to fix it with heavy guns, I wrote a simple model based on
<code>QAbstractListModel</code> to handle the mapping between the items and
underlying storage container. I chose list model because it is simpler
to work with (yes, I lack experience with Qt models) and because I
thought <code>QListView</code> would do a better job than the <code>QTreeView</code>. I was
wrong, it turned out that <code>QTreeView</code> is much faster to display the
data on the screen than the <code>QListView</code>, so I switched to it and I
kept the simpler list idea (my head already hurts). to replace the
original top level item, I enabled the header and use it for the same
purpose. It does not look as nice as the previous version, but I hope
it will be more stable and also faster to show.</p>
<p>The code can be found on <a href="https://invent.kde.org/network/falkon/-/merge_requests/117">KDE Invent</a>.</p>
<figure><img src="/images/2025-01-12_falkon_adblock-dialog-comparison.png"
    alt="Adblock Dialog: on left before the change, on right after the change."><figcaption>
      <p>Adblock Dialog: on left before the change, on right after the change.</p>
    </figcaption>
</figure>

<h2 id="remove-rule">Remove rule</h2>
<p>Somehow I was exploring the <a href="https://abptestpages.org/">ABP Test Pages</a> again and
when I saw the <code>Remove</code> rule I thought &ldquo;this can be done&rdquo; and went to
play with it. It is the same as CSS hiding rules with an additional
<code>{remove:true}</code> at the end.  But it needs another JavaScript to work,
so I am happy that the technology progressed and there is
<code>querySelectorAll(css)</code> to select elements based on the CSS selectors.
With a simple for look to remove all selected elements the deed was
done.</p>
<p>This way, Falkon might have support for another rarely used AdBlock
rule.</p>
<p>The code can be found on <a href="https://invent.kde.org/network/falkon/-/merge_requests/119">KDE Invent</a>.</p>
<h2 id="ending-thoughts">Ending thoughts</h2>
<p>I like working on things which are rarely used.</p>
<p>I also updated the <a href="/memory/2025/01/falkon-adblock-testpage-results/">Falkon ABP Test Page results</a>.</p>
]]></content>
            
                 
                    
                 
                    
                         
                        
                            
                             
                                <category scheme="https://blog.sgorava.xyz/tags/falkon" term="falkon" label="Falkon" />
                            
                        
                    
                
            
        </entry>
    
        
        <entry>
            <title type="html"><![CDATA[Falkon Adblock testpage results]]></title>
            <link href="https://blog.sgorava.xyz/memory/2025/01/falkon-adblock-testpage-results/" rel="alternate" type="text/html" />
            
                <id>https://blog.sgorava.xyz/memory/2025/01/falkon-adblock-testpage-results/</id>
            
            
            <published>2025-01-06T00:00:00+00:00</published>
            <updated>2025-01-06T00:00:00+00:00</updated>
            
            
            <content type="html"><![CDATA[<p>I went to <a href="https://abptestpages.org/">ABP Test Pages</a> and checked how Falkon Adblock
handles all the different rules. Many things are implemented but even more is
not and some rules are misinterpreted (e.g. remove).</p>
<p>I always thought it works well enough (works for me) and with enough filters it
even passes the <a href="https://adblock-tester.com/">Adblock Tester</a> test page on 96 from 100
points.</p>
<p>I can talk about &ldquo;what ifs&rdquo; and complaining the whole day, but lets jump into
the results.</p>



<details open>
<summary>Document History</summary>
<ul>
<li>2025-01-18 - Mark &ldquo;Generic Hide&rdquo; as working. I tested it
incorrectly when I had many other filters enabled which messed up
my testing.</li>
<li>2025-01-18 - Mark &ldquo;Popup&rdquo; filters as done with a ling to the merge
request</li>
<li>2025-01-12 - Mark &ldquo;Remove&rdquo; filters as done with link to Merge Request</li>
<li>2025-01-11 - Add comment to Third-party option</li>
</ul>

</details>

<hr>
<details open>
  <summary>Table Of Content</summary>
  <div class="toc">
    <nav id="TableOfContents">
  <ul>
    <li><a href="#blocking-and-hiding">Blocking and Hiding</a></li>
    <li><a href="#remove">Remove</a></li>
    <li><a href="#inline-css">Inline CSS</a></li>
    <li><a href="#filter-options---resource-types">Filter Options - Resource Types</a></li>
    <li><a href="#filter-options---resource-type-exceptions">Filter Options - Resource Type Exceptions</a></li>
    <li><a href="#filter-options---constraints">Filter Options - Constraints</a></li>
    <li><a href="#filter-options---exceptions">Filter Options - Exceptions</a></li>
    <li><a href="#filter-options---content-security-policy">Filter Options - Content Security Policy</a></li>
    <li><a href="#filter-options---rewrite">Filter Options - Rewrite</a></li>
    <li><a href="#snippets">Snippets</a></li>
    <li><a href="#circumvention">Circumvention</a></li>
    <li><a href="#service-worker">Service Worker</a></li>
  </ul>
</nav>
  </div>
</details>

<h2 id="blocking-and-hiding">Blocking and Hiding</h2>



<details open>
<summary>Blocking</summary>
<ul>
<li><input checked="" disabled="" type="checkbox"> Full Path</li>
<li><input checked="" disabled="" type="checkbox"> Partial Path</li>
<li><input checked="" disabled="" type="checkbox"> Wildcard</li>
<li><input checked="" disabled="" type="checkbox"> Dynamic</li>
<li><input checked="" disabled="" type="checkbox"> Deep subdomains</li>
</ul>

</details>




<details open>
<summary>Element Hiding</summary>
<ul>
<li><input checked="" disabled="" type="checkbox"> ID Selector</li>
<li><input checked="" disabled="" type="checkbox"> ID Selector with double curly braces</li>
<li><input checked="" disabled="" type="checkbox"> Class Selector</li>
<li><input checked="" disabled="" type="checkbox"> Descendant Selector</li>
<li><input checked="" disabled="" type="checkbox"> Sibling Selector</li>
<li><input checked="" disabled="" type="checkbox"> Attribute Selector 1</li>
<li><input checked="" disabled="" type="checkbox"> Attribute Selector 2</li>
<li><input checked="" disabled="" type="checkbox"> Attribute Selector 3</li>
<li><input checked="" disabled="" type="checkbox"> Starts with Selector 1</li>
<li><input checked="" disabled="" type="checkbox"> Starts with Selector 2</li>
<li><input checked="" disabled="" type="checkbox"> Ends with Selector 1</li>
<li><input checked="" disabled="" type="checkbox"> Contains</li>
</ul>

</details>




<details open>
<summary>Element Hiding Emulation / Extended Selectors</summary>
<ul>
<li><input disabled="" type="checkbox"> Basic :-abp-properties() usage</li>
<li><input disabled="" type="checkbox"> Basic :-abp-has() usage</li>
<li><input disabled="" type="checkbox"> Basic :has() usage</li>
<li><input disabled="" type="checkbox"> Basic :-abp-contains() usage</li>
<li><input disabled="" type="checkbox"> Basic :xpath() usage</li>
<li><input disabled="" type="checkbox"> Basic :has-text() usage</li>
<li><input disabled="" type="checkbox"> Chained extended selectors</li>
<li><input disabled="" type="checkbox"> Case insensitive extended selectors</li>
<li><input disabled="" type="checkbox"> Wildcard in extended selector</li>
<li><input disabled="" type="checkbox"> Regular expression in :-abp-properties()</li>
<li><input disabled="" type="checkbox"> Regular expression in :-abp-contains()</li>
</ul>

</details>




<details open>
<summary>Block on DOM Mutation</summary>
<ul>
<li><input disabled="" type="checkbox"> input</li>
<li><input disabled="" type="checkbox"> aside</li>
</ul>

</details>




<details open>
<summary>Element Hiding Emulation Inversion</summary>
<ul>
<li><input disabled="" type="checkbox"> Basic :not(:-abp-properties()) usage</li>
<li><input disabled="" type="checkbox"> Basic :not(:-abp-has()) usage</li>
<li><input disabled="" type="checkbox"> Basic :not(:-abp-contains()) usage</li>
<li><input disabled="" type="checkbox"> Chained extended selectors with not() selector</li>
<li><input disabled="" type="checkbox"> Case insensitive extended selectors with not() selector</li>
<li><input disabled="" type="checkbox"> Wildcard in extended selector combined with :not() selector</li>
<li><input disabled="" type="checkbox"> Regular expression in :not(:-abp-properties())</li>
<li><input disabled="" type="checkbox"> Regular expression in :not(:-abp-contains())</li>
</ul>

</details>

<h2 id="remove">Remove</h2>
<p>Implemented in the <a href="https://invent.kde.org/network/falkon/-/merge_requests/119">Merge Request 119</a>.</p>



<details open>
<summary>Remove</summary>
<ul>
<li><input checked="" disabled="" type="checkbox"> Remove with ID selector</li>
<li><input checked="" disabled="" type="checkbox"> Remove with ID selector with double curly braces</li>
<li><input checked="" disabled="" type="checkbox"> Remove with class selector</li>
<li><input checked="" disabled="" type="checkbox"> Remove with descendant selector</li>
<li><input checked="" disabled="" type="checkbox"> Remove with sibling selector</li>
<li><input checked="" disabled="" type="checkbox"> Remove with attribute selector 1</li>
<li><input checked="" disabled="" type="checkbox"> Remove with attribute selector 2</li>
<li><input checked="" disabled="" type="checkbox"> Remove with attribute selector 3</li>
<li><input checked="" disabled="" type="checkbox"> Remove starts with selector 1</li>
<li><input checked="" disabled="" type="checkbox"> Remove starts with selector 2</li>
<li><input checked="" disabled="" type="checkbox"> Remove ends with selector 1</li>
<li><input checked="" disabled="" type="checkbox"> Remove contains</li>
</ul>

</details>




<details open>
<summary>Remove with Extended Selectors</summary>
<ul>
<li><input disabled="" type="checkbox"> Basic :-abp-properties() usage with remove</li>
<li><input disabled="" type="checkbox"> Basic :-abp-has() usage with remove</li>
<li><input disabled="" type="checkbox"> Basic :has() usage with remove</li>
<li><input disabled="" type="checkbox"> Basic :-abp-contains() usage with remove</li>
<li><input disabled="" type="checkbox"> Basic :xpath() usage with remove</li>
<li><input disabled="" type="checkbox"> Basic :has-text() usage with remove</li>
<li><input disabled="" type="checkbox"> Chained extended selectors with remove</li>
<li><input disabled="" type="checkbox"> Case insensitive extended selectors with remove</li>
<li><input disabled="" type="checkbox"> Wildcard in extended selector with remove</li>
<li><input disabled="" type="checkbox"> Regular expression in :-abp-properties() with remove</li>
<li><input disabled="" type="checkbox"> Regular expression in :-abp-contains() with remove</li>
</ul>

</details>




<details open>
<summary>Remove on DOM Mutation</summary>
<ul>
<li><input disabled="" type="checkbox"> input</li>
</ul>

</details>




<details open>
<summary>Remove Inversion</summary>
<ul>
<li><input disabled="" type="checkbox"> Basic :not(:-abp-properties()) usage with remove</li>
<li><input disabled="" type="checkbox"> Basic :not(:-abp-has()) usage with remove</li>
<li><input disabled="" type="checkbox"> Basic :not(:-abp-contains()) usage with remove</li>
<li><input disabled="" type="checkbox"> Chained extended selectors with not() selector with remove</li>
<li><input disabled="" type="checkbox"> Case insensitive extended selectors with not() selector with remove</li>
<li><input disabled="" type="checkbox"> Wildcard in extended selector combined with :not() selector with remove</li>
<li><input disabled="" type="checkbox"> Regular expression in :not(:-abp-properties()) with remove</li>
<li><input disabled="" type="checkbox"> Regular expression in :not(:-abp-contains()) with remove</li>
</ul>

</details>

<h2 id="inline-css">Inline CSS</h2>



<details open>
<summary>Inline CSS</summary>
<ul>
<li><input checked="" disabled="" type="checkbox"> Inline CSS with ID selector</li>
<li><input checked="" disabled="" type="checkbox"> Inline CSS with ID selector with double curly braces</li>
<li><input checked="" disabled="" type="checkbox"> Inline CSS with class selector</li>
<li><input checked="" disabled="" type="checkbox"> Inline CSS with descendant selector</li>
<li><input checked="" disabled="" type="checkbox"> Inline CSS with sibling selector</li>
<li><input checked="" disabled="" type="checkbox"> Inline CSS with attribute selector 1</li>
<li><input checked="" disabled="" type="checkbox"> Inline CSS with attribute selector 2</li>
<li><input checked="" disabled="" type="checkbox"> Inline CSS with attribute selector 3</li>
<li><input checked="" disabled="" type="checkbox"> Inline CSS starts with selector 1</li>
<li><input checked="" disabled="" type="checkbox"> Inline CSS starts with selector 2</li>
<li><input checked="" disabled="" type="checkbox"> Inline CSS ends with selector 1</li>
<li><input checked="" disabled="" type="checkbox"> Inline CSS contains</li>
</ul>

</details>




<details open>
<summary>Inline CSS with Extended Selectors</summary>
<ul>
<li><input disabled="" type="checkbox"> Basic :-abp-properties() usage with inline CSS</li>
<li><input disabled="" type="checkbox"> Basic :-abp-has() usage with inline CSS</li>
<li><input disabled="" type="checkbox"> Basic :has() usage with inline CSS</li>
<li><input disabled="" type="checkbox"> Basic :-abp-contains() usage with inline CSS</li>
<li><input disabled="" type="checkbox"> Basic :xpath() usage with inline CSS</li>
<li><input disabled="" type="checkbox"> Basic :has-text() usage with inline CSS</li>
<li><input disabled="" type="checkbox"> Chained extended selectors with inline CSS</li>
<li><input disabled="" type="checkbox"> Case insensitive extended selectors with inline CSS</li>
<li><input disabled="" type="checkbox"> Wildcard in extended selector with inline CSS</li>
<li><input disabled="" type="checkbox"> Regular expression in :-abp-properties() with inline CSS</li>
<li><input disabled="" type="checkbox"> Regular expression in :-abp-contains() with inline CSS</li>
</ul>

</details>




<details open>
<summary>Inline CSS on DOM Mutation</summary>
<ul>
<li><input disabled="" type="checkbox"> span</li>
</ul>

</details>




<details open>
<summary>Inline CSS Inversion</summary>
<ul>
<li><input disabled="" type="checkbox"> Basic :not(:-abp-properties()) usage with inline CSS</li>
<li><input disabled="" type="checkbox"> Basic :not(:-abp-has()) usage with inline CSS</li>
<li><input disabled="" type="checkbox"> Basic :not(:-abp-contains()) usage with inline CSS</li>
<li><input disabled="" type="checkbox"> Chained extended selectors with not() selector with inline CSS</li>
<li><input disabled="" type="checkbox"> Case insensitive extended selectors with not() selector with inline CSS</li>
<li><input disabled="" type="checkbox"> Wildcard in extended selector combined with :not() selector with inline CSS</li>
<li><input disabled="" type="checkbox"> Regular expression in :not(:-abp-properties()) with inline CSS</li>
<li><input disabled="" type="checkbox"> Regular expression in :not(:-abp-contains()) with inline CSS</li>
</ul>

</details>

<h2 id="filter-options---resource-types">Filter Options - Resource Types</h2>



<details open>
<summary>Header</summary>
<p>No support in QtWebEngine to check and modify reply header.</p>
<ul>
<li><input disabled="" type="checkbox"> Script</li>
<li><input disabled="" type="checkbox"> Image</li>
<li><input disabled="" type="checkbox"> Comma</li>
<li><input disabled="" type="checkbox"> Stylesheet</li>
</ul>
</details>




<details open>
<summary>Image</summary>
<ul>
<li><input checked="" disabled="" type="checkbox"> Static</li>
<li><input checked="" disabled="" type="checkbox"> Dynamic</li>
</ul>

</details>




<details open>
<summary>Ping</summary>
<ul>
<li><input disabled="" type="checkbox"> Link based ping
<ul>
<li>No ping request was generated</li>
</ul>
</li>
<li><input checked="" disabled="" type="checkbox"> Script based ping</li>
</ul>

</details>

<p>Popup blocking implemented in the <a href="https://invent.kde.org/network/falkon/-/merge_requests/121">Merge Request
121</a>.</p>



<details open>
<summary>Popup</summary>
<ul>
<li><input checked="" disabled="" type="checkbox"> Link based popup</li>
<li><input checked="" disabled="" type="checkbox"> Script based popup (tab)</li>
<li><input checked="" disabled="" type="checkbox"> Script based popup (window)</li>
</ul>

</details>




<details open>
<summary>Script</summary>
<ul>
<li><input checked="" disabled="" type="checkbox"> Script</li>
</ul>

</details>




<details open>
<summary>Stylesheet</summary>
<ul>
<li><input checked="" disabled="" type="checkbox"> Stylesheet</li>
</ul>

</details>




<details open>
<summary>Subdocument</summary>
<ul>
<li><input checked="" disabled="" type="checkbox"> Subdocument</li>
</ul>

</details>




<details open>
<summary>WebSocket</summary>
<ul>
<li><input checked="" disabled="" type="checkbox"> WebSocket</li>
</ul>

</details>




<details open>
<summary>XMLHTTPRequest</summary>
<ul>
<li><input checked="" disabled="" type="checkbox"> XMLHTTPRequest</li>
</ul>

</details>

<h2 id="filter-options---resource-type-exceptions">Filter Options - Resource Type Exceptions</h2>



<details open>
<summary>Header Exception</summary>
<p>No support in QtWebEngine to check and modify the reaply header.</p>
<ul>
<li><input disabled="" type="checkbox"> Image header exception</li>
</ul>
</details>




<details open>
<summary>Image Exception</summary>
<ul>
<li><input checked="" disabled="" type="checkbox"> Basic usage</li>
<li><input checked="" disabled="" type="checkbox"> Deep subdomain exception</li>
</ul>

</details>




<details open>
<summary>Ping Exception</summary>
<ul>
<li><input disabled="" type="checkbox"> Basic usage
<ul>
<li>This example uses &ldquo;link ping&rdquo; which does not seem to work. By using the &ldquo;script ping&rdquo; example from &ldquo;Filters - Ping&rdquo; section, the Exception does not work.</li>
<li>My testing could be wrong.</li>
</ul>
</li>
</ul>

</details>




<details open>
<summary>Popup Exception</summary>
<ul>
<li><input checked="" disabled="" type="checkbox"> Link based popup exception</li>
<li><input checked="" disabled="" type="checkbox"> Script based popup exception (tab)</li>
<li><input checked="" disabled="" type="checkbox"> Script based popup exception (window)</li>
</ul>

</details>




<details open>
<summary>Script Exception</summary>
<ul>
<li><input checked="" disabled="" type="checkbox"> Exception usage</li>
</ul>

</details>




<details open>
<summary>Stylesheet Exception</summary>
<ul>
<li><input checked="" disabled="" type="checkbox"> Exception usage</li>
</ul>

</details>




<details open>
<summary>Subdocument Exception</summary>
<ul>
<li><input checked="" disabled="" type="checkbox"> Exception usage</li>
</ul>

</details>




<details open>
<summary>WebSocket Exception</summary>
<ul>
<li><input checked="" disabled="" type="checkbox"> Exception usage</li>
</ul>

</details>




<details open>
<summary>XMLHTTPRequest Exception</summary>
<ul>
<li><input checked="" disabled="" type="checkbox"> Exception usage</li>
</ul>

</details>

<h2 id="filter-options---constraints">Filter Options - Constraints</h2>



<details open>
<summary>Domain</summary>
<ul>
<li><input checked="" disabled="" type="checkbox"> Static</li>
<li><input checked="" disabled="" type="checkbox"> Dynamic</li>
</ul>

</details>




<details open>
<summary>Wildcard Domain</summary>
<ul>
<li><input disabled="" type="checkbox"> Element Hiding: Contains with Wildcards</li>
<li><input disabled="" type="checkbox"> Element Hiding with ID</li>
<li><input disabled="" type="checkbox"> Element Hiding: Attribute Selector</li>
<li><input disabled="" type="checkbox"> Element Hiding Emulation: Basic :-abp-properties() usage</li>
<li><input disabled="" type="checkbox"> Element Hiding Emulation: Basic :-abp-has() usage</li>
<li><input disabled="" type="checkbox"> Element Hiding Emulation Chained extended selectors</li>
<li><input disabled="" type="checkbox"> Element Hide Emulation: wildcard in extended selector and wildcard in domain</li>
<li><input disabled="" type="checkbox"> Element Hiding Emulation: Regular expression in :-abp-contains()</li>
</ul>

</details>




<details open>
<summary>Match Case</summary>
<ul>
<li><input checked="" disabled="" type="checkbox"> Static</li>
<li><input checked="" disabled="" type="checkbox"> Dynamic</li>
</ul>

</details>




<details open>
<summary>Other</summary>
<ul>
<li><input checked="" disabled="" type="checkbox"> Script</li>
</ul>

</details>




<details open>
<summary>Third Party</summary>
<ul>
<li><input disabled="" type="checkbox"> Block Third Party
<ul>
<li>Nothing is blocked.</li>
<li>Falkon treats the example rule as a domain instead of ending
filename, the rule should probably contain <code>|</code> at the end or
Falkon implementation assumes different behaviour in this case.</li>
</ul>
</li>
<li><input disabled="" type="checkbox"> Block First Party
<ul>
<li>Both images are blocked.</li>
</ul>
</li>
</ul>

</details>

<h2 id="filter-options---exceptions">Filter Options - Exceptions</h2>



<details open>
<summary>Document</summary>
<ul>
<li><input checked="" disabled="" type="checkbox"> Document</li>
</ul>

</details>




<details open>
<summary>Elem Hide</summary>
<ul>
<li><input checked="" disabled="" type="checkbox"> Basic usage</li>
<li><input disabled="" type="checkbox"> iFrame
<ul>
<li>Does not seem to block the element properly.</li>
</ul>
</li>
</ul>

</details>




<details open>
<summary>Element Hiding Exception</summary>
<ul>
<li><input checked="" disabled="" type="checkbox"> Exception usage</li>
</ul>

</details>




<details open>
<summary>Inline CSS Exception</summary>
<ul>
<li><input disabled="" type="checkbox"> Inline CSS with exception usage</li>
</ul>

</details>




<details open>
<summary>Generic Block</summary>
<ul>
<li><input disabled="" type="checkbox"> Basic usage</li>
</ul>

</details>




<details open>
<summary>Generic Hide</summary>
<ul>
<li><input checked="" disabled="" type="checkbox"> Basic usage</li>
</ul>

</details>




<details open>
<summary>iFrame Exception</summary>
<ul>
<li><input disabled="" type="checkbox"> iFrame content rewritten by script</li>
</ul>

</details>




<details open>
<summary>iFrame Subdomains Exception</summary>
<ul>
<li><input disabled="" type="checkbox"> iFrame subdomains exception</li>
<li><input disabled="" type="checkbox"> combined $subdocument and $document options in exception</li>
</ul>

</details>




<details open>
<summary>Sitekey on MV2</summary>
<ul>
<li><input disabled="" type="checkbox"> Sitekey</li>
</ul>

</details>




<details open>
<summary>Sitekey on MV3</summary>
<ul>
<li><input disabled="" type="checkbox"> Sitekey</li>
</ul>

</details>

<h2 id="filter-options---content-security-policy">Filter Options - Content Security Policy</h2>



<details open>
<summary>CSP All scripts</summary>
<ul>
<li><input disabled="" type="checkbox"> All scripts</li>
</ul>

</details>




<details open>
<summary>CSP Specific site</summary>
<ul>
<li><input disabled="" type="checkbox"> Specific site</li>
<li><input disabled="" type="checkbox"> frame-src</li>
</ul>

</details>




<details open>
<summary>CSP Exception</summary>
<ul>
<li><input disabled="" type="checkbox"> Exception usage</li>
</ul>

</details>




<details open>
<summary>CSP Generic Block Exception</summary>
<ul>
<li><input disabled="" type="checkbox"> Genericblock Exception usage</li>
</ul>

</details>

<h2 id="filter-options---rewrite">Filter Options - Rewrite</h2>
<p>Implemented in the <a href="https://invent.kde.org/network/falkon/-/merge_requests/116">Merge Request 116</a>.</p>



<details open>
<summary>Rewrite</summary>
<ul>
<li><input checked="" disabled="" type="checkbox"> Script</li>
<li><input checked="" disabled="" type="checkbox"> Stylesheet</li>
<li><input checked="" disabled="" type="checkbox"> Subdocument</li>
<li><input checked="" disabled="" type="checkbox"> Text</li>
<li><input checked="" disabled="" type="checkbox"> 1x1 GIF</li>
<li><input checked="" disabled="" type="checkbox"> 2x2 PNG</li>
<li><input checked="" disabled="" type="checkbox"> 3x2 PNG</li>
<li><input checked="" disabled="" type="checkbox"> 32x32 PNG</li>
<li><input checked="" disabled="" type="checkbox"> Audio</li>
<li><input checked="" disabled="" type="checkbox"> Video</li>
</ul>

</details>

<h2 id="snippets">Snippets</h2>
<p>An initial implementation of snippets can be found in <a href="https://invent.kde.org/network/falkon/-/merge_requests/29">Merge Request 29</a> and it needs a full review to be merged. I do not want to include complicated code which I do not understand because I will have to maintain it.</p>



<details open>
<summary>abort-current-inline-script</summary>
<ul>
<li><input disabled="" type="checkbox"> Basic usage</li>
<li><input disabled="" type="checkbox"> Search usage</li>
<li><input disabled="" type="checkbox"> Regex usage</li>
</ul>

</details>




<details open>
<summary>abort-on-property-read</summary>
<ul>
<li><input disabled="" type="checkbox"> Basic usage</li>
<li><input disabled="" type="checkbox"> Sub property</li>
<li><input disabled="" type="checkbox"> Function property</li>
</ul>

</details>




<details open>
<summary>abort-on-property-write</summary>
<ul>
<li><input disabled="" type="checkbox"> Basic usage</li>
<li><input disabled="" type="checkbox"> Sub property</li>
<li><input disabled="" type="checkbox"> Function property</li>
</ul>

</details>




<details open>
<summary>abort-on-iframe-property-read</summary>
<ul>
<li><input disabled="" type="checkbox"> Basic usage</li>
<li><input disabled="" type="checkbox"> Sub property</li>
<li><input disabled="" type="checkbox"> Multiple properties</li>
</ul>

</details>




<details open>
<summary>abort-on-iframe-property-write</summary>
<ul>
<li><input disabled="" type="checkbox"> Basic usage</li>
<li><input disabled="" type="checkbox"> Sub property</li>
<li><input disabled="" type="checkbox"> Multiple properties</li>
</ul>

</details>




<details open>
<summary>hide-if-contains</summary>
<ul>
<li><input disabled="" type="checkbox"> Static usage</li>
<li><input disabled="" type="checkbox"> Dynamic usage</li>
<li><input disabled="" type="checkbox"> Search usage</li>
<li><input disabled="" type="checkbox"> Regex usage</li>
<li><input disabled="" type="checkbox"> Frame usage</li>
</ul>

</details>




<details open>
<summary>hide-if-contains-and-matches-style</summary>
<ul>
<li><input disabled="" type="checkbox"> Static usage</li>
<li><input disabled="" type="checkbox"> Dynamic usage</li>
</ul>

</details>




<details open>
<summary>hide-if-contains-image</summary>
<ul>
<li><input disabled="" type="checkbox"> Basic usage</li>
</ul>

</details>




<details open>
<summary>hide-if-contains-similar-text</summary>
<ul>
<li><input disabled="" type="checkbox"> Basic usage</li>
</ul>

</details>




<details open>
<summary>hide-if-contains-visible-text</summary>
<ul>
<li><input disabled="" type="checkbox"> Basic usage</li>
<li><input disabled="" type="checkbox"> ::content usage</li>
</ul>

</details>




<details open>
<summary>hide-if-has-and-matches-style</summary>
<ul>
<li><input disabled="" type="checkbox"> Basic usage</li>
<li><input disabled="" type="checkbox"> Legit elements</li>
</ul>

</details>




<details open>
<summary>hide-if-labelled-by</summary>
<ul>
<li><input disabled="" type="checkbox"> Basic usage</li>
</ul>

</details>




<details open>
<summary>hide-if-matches-computed-xpath</summary>
<ul>
<li><input disabled="" type="checkbox"> Hide when class changes dynamically based on a string found in another element</li>
<li><input disabled="" type="checkbox"> Hide when class matches regex group</li>
</ul>

</details>




<details open>
<summary>hide-if-matches-xpath</summary>
<ul>
<li><input disabled="" type="checkbox"> Basic static usage</li>
<li><input disabled="" type="checkbox"> Class Usage</li>
<li><input disabled="" type="checkbox"> Hide if Id starts with</li>
</ul>

</details>




<details open>
<summary>hide-if-matches-xpath3</summary>
<ul>
<li><input disabled="" type="checkbox"> Hide if class matches regex</li>
<li><input disabled="" type="checkbox"> Normalize and join strings</li>
<li><input disabled="" type="checkbox"> Cast to number</li>
</ul>

</details>




<details open>
<summary>hide-if-shadow-contains</summary>
<ul>
<li><input disabled="" type="checkbox"> Basic usage</li>
<li><input disabled="" type="checkbox"> Regex usage</li>
</ul>

</details>




<details open>
<summary>JSON override</summary>
<ul>
<li><input disabled="" type="checkbox"> json-override</li>
</ul>

</details>




<details open>
<summary>JSON prune</summary>
<ul>
<li><input disabled="" type="checkbox"> json-prune</li>
</ul>

</details>




<details open>
<summary>Override Property Read</summary>
<ul>
<li><input disabled="" type="checkbox"> override-property-read</li>
</ul>

</details>




<details open>
<summary>simulate-mouse-event</summary>
<ul>
<li><input disabled="" type="checkbox"> simulate-mouse-event</li>
</ul>

</details>




<details open>
<summary>skip-video</summary>
<ul>
<li><input disabled="" type="checkbox"> skip-video</li>
</ul>

</details>




<details open>
<summary>strip-fetch-query-parameter</summary>
<ul>
<li><input disabled="" type="checkbox"> Basic usage</li>
<li><input disabled="" type="checkbox"> Other usage</li>
</ul>

</details>

<h2 id="circumvention">Circumvention</h2>



<details open>
<summary>Anonymous frame document.write()</summary>
<ul>
<li><input disabled="" type="checkbox"> Anonymous frame document.write()
<ul>
<li>Partial, works on Top frame but not on Sub frames.</li>
</ul>
</li>
</ul>

</details>




<details open>
<summary>Inline Style !important</summary>
<ul>
<li><input checked="" disabled="" type="checkbox"> Inline style !important</li>
</ul>

</details>

<h2 id="service-worker">Service Worker</h2>



<details open>
<summary>Blocking a service worker script</summary>
<ul>
<li><input checked="" disabled="" type="checkbox"> Blocking a service worker script</li>
<li><input checked="" disabled="" type="checkbox"> Allowing a service worker script by an exception filter</li>
</ul>

</details>




<details open>
<summary>Blocking a request from a service worker scrip</summary>
<ul>
<li><input checked="" disabled="" type="checkbox"> Blocking a request from a service worker script</li>
<li><input checked="" disabled="" type="checkbox"> Allowing a request from a service worker script by an exception filter</li>
</ul>

</details>

]]></content>
            
                 
                    
                 
                    
                         
                        
                            
                             
                                <category scheme="https://blog.sgorava.xyz/tags/falkon" term="falkon" label="Falkon" />
                            
                        
                    
                
            
        </entry>
    
        
        <entry>
            <title type="html"><![CDATA[Starting year with Falkon Adblock]]></title>
            <link href="https://blog.sgorava.xyz/memory/2025/01/starting-year-with-falkon-adblock/" rel="alternate" type="text/html" />
            
                <id>https://blog.sgorava.xyz/memory/2025/01/starting-year-with-falkon-adblock/</id>
            
            
            <published>2025-01-05T00:00:00+00:00</published>
            <updated>2025-01-05T00:00:00+00:00</updated>
            
            
            <content type="html"><![CDATA[<p>Falkon is using its own Adblock implementation and can parse
AdblockPlus block lists. The compatibility is not the best especially
when it comes to newer or more complicated features. In the next
Falkon version there will be a small improvement by adding <code>websocket</code>
and <code>rewrite</code> support.</p>
<h2 id="websocket">WebSocket</h2>
<p>While trying to help a user in the IRC channel with an idea on how to
make a NoScript-like plugin for Falkon I went over Adblock code to
block network traffic and discovered that from Qt 6.4 there is a way
to detect and WebSocket connections. Since I already saw it I though
&ldquo;it should not be that hard to add support for it&rdquo; and it turned out
to be a simple task. The already merged Merge Request can by found at
<a href="https://invent.kde.org/network/falkon/-/merge_requests/114">invent.kde.org</a>. The implementation also passes the
tests at Adblock test pages <a href="https://www.abptestpages.org/en/filters/websocket">WebSocket</a> and
<a href="https://www.abptestpages.org/en/exceptions/websocket">WebSocket Exception</a> sections.</p>
<h2 id="rewrite">Rewrite</h2>
<p>Rewrite is a feature to redirect to other place. This implementation
follows AdblockPlus in that it only redirects to few specific
addresses and ignores the rest.</p>
<p>List of supported rewrites:</p>
<ul>
<li><code>blank-js</code> empty JavaScript</li>
<li><code>blank-css</code> empty Cascading Style Sheet</li>
<li><code>blank-html</code> empty HTML document</li>
<li><code>blank-text</code> empty text document</li>
<li><code>1x1-transparent-gif</code> 1x1 transparent GIF image</li>
<li><code>2x2-transparent-png</code> 2x2 transparent PNG image</li>
<li><code>3x2-transparent-png</code> 3x2 transparent PNG image</li>
<li><code>32x32-transparent-png</code> 32x32 transparent PNG image</li>
<li><code>blank-mp3</code> 0.1s silent MP3 file</li>
<li><code>blank-mp4</code> 0.1s silent blank (black) 240p MP4 file</li>
</ul>
<p>As a guide I used AdblockPlus <a href="https://www.abptestpages.org/en/filters/rewrite">Test Pages</a> as well as the
AdblockPlus <a href="https://help.adblockplus.org/hc/en-us/articles/360062733293-How-to-write-filters#rewrite">documentation</a>.</p>
<h3 id="redirects-in-adblockers">Redirects in adblockers</h3>
<blockquote>
<p><strong>NOTE</strong> This section is my own understanding on the topic.</p>
</blockquote>
<h4 id="adblockplus">AdblockPlus</h4>
<p>The original implementation of <code>rewrite</code> in AdblockPlus was too
powerful and allowed to redirect anything to anything, which could
been used to inject malicious code into the seemingly protected web
browser and steal users data or worse. The implementation was later
changed to only allow redirect to specific internal resources listed
above. See rewrite at <a href="https://blog.adblockplus.org/development-builds/rewriting-url-instead-of-blocking">blog.adblockplus.org</a>.</p>
<h4 id="brave-adblock">Brave Adblock</h4>
<p>Brave Adblock allows more powerful redirect in essence it can redirect
anything to anything but this feature is only active in the official
Brave block lists. It is used to shrink the browser size and move a
lot of their ads blocking scripts to the server to be downloaded only
when needed. This all sounds nice and implementing this feature would
mean locking it to only their official block lists. See the
<code>redirect-url</code> <a href="https://github.com/brave/adblock-rust/pull/184">merge request</a>.</p>
<p>The Brave Adblock, at least its network blocking part is also used in
other projects such as <a href="https://github.com/qutebrowser/qutebrowser">Qutebrowser</a>,
<a href="https://invent.kde.org/network/angelfish">Angelfish</a> and probably more KDE software. Is it
worth it to switch to this instead of own Adblock implementation?</p>
<h2 id="ending-thoughts">Ending thoughts</h2>
<p>WebSockets is a great example of a feature which could have been
implemented sooner if I was keeping a better eye on the changes and
news in Qt library like the main developer of Qutebrowser does. I
selfishly use his work for this. He puts the changes for each version
in a separate issue, so it is easy to search and browse.</p>
<p>I will continue my random fixes for Falkon.</p>
]]></content>
            
                 
                    
                 
                    
                         
                        
                            
                             
                                <category scheme="https://blog.sgorava.xyz/tags/falkon" term="falkon" label="Falkon" />
                             
                                <category scheme="https://blog.sgorava.xyz/tags/thoughts" term="thoughts" label="Thoughts" />
                            
                        
                    
                
            
        </entry>
    
        
        <entry>
            <title type="html"><![CDATA[Offline documentation]]></title>
            <link href="https://blog.sgorava.xyz/memory/2024/12/offline-documentation/" rel="alternate" type="text/html" />
            
                <id>https://blog.sgorava.xyz/memory/2024/12/offline-documentation/</id>
            
            
            <published>2024-12-31T00:00:00+00:00</published>
            <updated>2024-12-31T00:00:00+00:00</updated>
            
            
            <content type="html"><![CDATA[<p>I like to have documentation, manuals, wiki, examples and tutorials
stored locally on my machine. It is great to use and can serve as a
backup for future use.</p>
<h2 id="my-reasons">My reasons</h2>
<p>There are multiple reasons why I consider it a great thing:</p>
<ol>
<li>It forces me to think about what I am actually searching for and to
try multiple keywords with similar meaning or with something
related.</li>
<li>While searching I learn much more than I originally intended since
I often read more than just a single search result.</li>
<li>It reduces my reliance on the internet services which can become
inaccessible at any moment for many reasons. These reasons are alo
many, is short: dead project, dead domain, changed address,
paywalled, firewalled (CloudFlare), censorship, etc.</li>
<li>Since I do not have to go on internet and interact with the mess
out there it also protects me from nonsense written by modern
people (I hope these creatures will not understand how to cripple
my docs) or big corporations (AI buzzword nonsense).</li>
</ol>
<p>In short I am more independent and disconnected from weird world.</p>
<h2 id="tools-and-approach">Tools and approach</h2>
<p>The short list of tools I use to search docs:</p>
<ul>
<li><code>man</code> - Probably the most known program to display manuals</li>
<li><code>info</code> - I have no idea what is the point of this program, some
stuff is here as well</li>
<li><code>wikiman</code> - With downloaded snapshot of ArchWiki, an awesome TUI
program</li>
<li>Various <code>-h</code>, <code>--help</code> program arguments</li>
<li>Various docs installed from repositories which live in their own
docs folders and are in most case html pages. I use Qt-docs like
this, connected to my IDE KDevelop.</li>
<li>Since I often write programs I also like to have examples for the
use of some libraries which sometimes can be installed from the
repositories and at other times I download the source code or the
docs from their website. I try to get some offline version.</li>
</ul>
<p>I am probably missing some program which would integrate all this
together (maybe <code>wikiman</code> when configured properly?). I remember there
was at least one, but the one I remember was some crazy GUI in which I
got lost and I forgot it. So far I mostly search manually for what I
need.</p>
<h2 id="closing-thoughts">Closing thoughts</h2>
<p>Utilizing local manuals is a bit harder than asking modern advertising
engine to provide the link to most paying site with enough keywords.
Yes, I worded it awkwardly since the search results often bring me to
some variant of StackOverflow, distro-wiki page or some weird AI
generated garbage.</p>
<p>It requires effort to be independent of modern way of doing things.</p>
]]></content>
            
                 
                    
                 
                    
                         
                        
                            
                             
                                <category scheme="https://blog.sgorava.xyz/tags/linux" term="linux" label="Linux" />
                             
                                <category scheme="https://blog.sgorava.xyz/tags/thoughts" term="thoughts" label="Thoughts" />
                            
                        
                    
                
            
        </entry>
    
        
        <entry>
            <title type="html"><![CDATA[Dreaming while programming]]></title>
            <link href="https://blog.sgorava.xyz/memory/2024/12/dreaming-while-programming/" rel="alternate" type="text/html" />
            
                <id>https://blog.sgorava.xyz/memory/2024/12/dreaming-while-programming/</id>
            
            
            <published>2024-12-25T00:00:00+00:00</published>
            <updated>2024-12-25T00:00:00+00:00</updated>
            
            
            <content type="html"><![CDATA[<p>At work I encountered a situation when having a small standalone tool
to display the variables with expanded types and when available also
display the address. For a basic look at symbols and their addresses,
the tool <code>readelf</code> can be used, the issue is that it does not expand
the types and only shows the addresses of the main variable, not of
its sub stuff in structs or arrays of stuff. Other tools which can be
used and I am aware of are: <code>dwarfdump</code>, <code>objdump</code> and <code>pahole</code>. Each
has its strong and weak points but I did not manage to find the
feature I wanted.</p>
<h2 id="fantasy-and-dreams">Fantasy and dreams</h2>
<p>Lets get to my dreamy part. The file format for the executables is
called <code>elf</code> and the debug format mostly used with it is called
<code>dwarf</code>, my fantasy comes from this little naming joke. I spent a lot
of hour reading and rereading parts of the DWARF documentation to come
up with a solution and good enough implementation and having dreams is
a good motivation to do exactly that.</p>
<h2 id="implementation">Implementation</h2>
<p>As a language of choice I went with Python and the library
<code>pyelftools</code> due to its qualities and portability. A very good
starting point, inspiration and a great helping tool I used <a href="https://github.com/sevaa/dwex">Dwarf
Explorer (DWEX)</a> by Seva Alekseyev. DWEX is an awesome
tool to discover and roam around DWARF data, I can recommend it with
confidence to anyone who wants to work with DWARF.</p>
<p>I used DWEX as a starting point to get pyelftools to read ELF file and
its DWARF data, it provided a great jump at the beginning and I could
focus on messing around with following the types and references. The
whole thing is a bit of a mess and does multiple passes on the same
data (I deem it inefficient) in an attempt to transfer DWARF
references into a Python dictionary and than traverse it to make a
flat version which I so desire.</p>
<p>Long story short, it was a headache but it works, there are some
issues though. The main issue being that it uses a Godlt technique
called <strong>recursion</strong> and will get into an infinite loop while forcing
its way through references if the type contains a reference to either
itself or different type which contain a reference to it. I intend to
solve this issue in the future, but it is present at the moment.</p>
<p>There is one more thing to be aware of when trying to develop a tool
like this, and that is that embedded world is a chaotic place and each
vendor / company interprets and uses DWARF a tiny bit differently but
since they also provide the whole toolchain you will not be aware of
this mess until you try to write your own tool like this one. Stable
DWARF version is a luxury, each vendor uses different and it is
impossible to force their tools to generate a specific version. So the
code of this little tool might need to be adjusted to work with
multiple DWARF versions which in best case mean supporting multiple
field names and in worst reworking whole routines, my headache.</p>
<h2 id="result">Result</h2>
<p>The result can be seen below. The only thing this script does is to
print the whole list to stdout and let user handle the rest. It works
best when paired with <code>fzf</code> but grep works fine as well. The whole
idea was to get the whole name when searching for a member of some
inner structure and I believe I managed to achieve this, somehow.</p>
<pre tabindex="0"><code>&gt; python main.py ../Playground_C/build/playground_c
0x4030  my_stuff
0x4030  my_stuff.first
0x4030  my_stuff.first.number_1
0x4038  my_stuff.first.number_2
0x4040  my_stuff.second
0x4040  my_small_stuff
0x4040  my_small_stuff.one
0x4040  my_small_stuff.one[0]
...
0x4057  my_small_stuff.one[23]
0x4040  my_small_stuff.structure
0x4040  my_small_stuff.structure.first
</code></pre><h2 id="conclusion">Conclusion</h2>
<p>The script can be found in my Gitea instance as
<a href="https://git.sgorava.xyz/Miscellaneous/elf_symbols">Miscellaneous/elf_symbols</a> where I also rumble in
README about how I am tired of big proprietary tools.</p>
<blockquote>
<p><strong>PS:</strong> I believe this post is a mess, but well so be it. It is a good
introduction to my fantasy world.</p>
</blockquote>
<blockquote>
<p><strong>PS2:</strong> I wanted to write this half a year ago but I could not find
a right words to do so but it was still stuck in my head&hellip;</p>
</blockquote>
]]></content>
            
                 
                    
                 
                    
                         
                        
                            
                             
                                <category scheme="https://blog.sgorava.xyz/tags/dwarf" term="dwarf" label="Dwarf" />
                             
                                <category scheme="https://blog.sgorava.xyz/tags/elf" term="elf" label="Elf" />
                            
                        
                    
                
            
        </entry>
    
        
        <entry>
            <title type="html"><![CDATA[An attempt to update my Falkon addons to Qt6]]></title>
            <link href="https://blog.sgorava.xyz/memory/2024/12/an-attempt-to-update-my-falkon-addons-to-qt6/" rel="alternate" type="text/html" />
            
                <id>https://blog.sgorava.xyz/memory/2024/12/an-attempt-to-update-my-falkon-addons-to-qt6/</id>
            
            
            <published>2024-12-09T00:00:00+00:00</published>
            <updated>2024-12-09T00:00:00+00:00</updated>
            
            
            <content type="html"><![CDATA[<p>This weekend I had no access to my trusty home workstation and worked
on my portable Thinkpad T440p and thus I decided to work on my Falkon
plugins. I postponed this for a long time.</p>
<h2 id="objective">Objective</h2>
<p>The main objective is to port the add-ons to Qt6 / PySide6 and update
version and author signature.</p>
<h2 id="progress">Progress</h2>
<p>I managed to port the <a href="https://git.sgorava.xyz/Falkon/ToolbarTools">ToolbarTools</a> and
<a href="https://git.sgorava.xyz/Falkon/Unloader">Unloader</a>. Unloader probably can be rewritten in QML for
better compatibility. I will leave that for later when I will have
will to do that.</p>
<p>And than it had done me properly. I started porting
<a href="https://git.sgorava.xyz/Falkon/tabCounter">TabCounter</a> and it had kicked me properly (like it
should, it is never simple). While porting it to Qt6 was as simple as
the two previous add-ons, just changing &ldquo;pyside2&rdquo; to &ldquo;pyside6&rdquo; in an
import statements and done. The problems which stuck with me started
when I noticed that Falkon actually crashes at exit when TabCounter is
enabled.</p>
<h2 id="debugging">Debugging</h2>
<p>So I started debugging TabCounter add-on like a pro. I added a lot of
print statements all over the exit related code. All seemed to be
executing correctly, so I fired QtCreator to get easy to use interface
for debugger and after recompiling Falkon for debug symbols I found
that it crashes in the general python library. So the problem needs to
be in my add-on code, somewhere.</p>
<p>I continued to comment the code and attempted to isolate the code
which causes the crash. It turned out the issue is caused by Qt
connects to the Falkon code (navigation panel). It looks like the
connects are not cleared when add-on is unloaded (is it truly fully
unloaded, I wonder now) and I should disconnect the connections
manually. Also, due to some reasons I do not know about I put in one
connect a python lambda function which had to be removed to fully
resolve the crash at exit.</p>
<h2 id="side-effect">Side effect</h2>
<p>During the debugging and trying to blame other code rather than my own
for the crashing issue I found a warning in the PyFalkon Shiboken
compilation log.</p>
<pre tabindex="0"><code>qt.shiboken: (pyfalkon) template baseclass &#39;QCborStreamReader::StringResult&lt;QByteArray&gt;&#39; of &#39;QCborStringResultByteArray&#39; is not known

qt.shiboken: (pyfalkon) template baseclass &#39;QCborStreamReader::StringResult&lt;QString&gt;&#39; of &#39;QCborStringResultString&#39; is not known
</code></pre><p>Fix turned out to be a simple new include, so I prepared a <a href="https://invent.kde.org/network/falkon/-/merge_requests/99">Merge
Request</a> with potential fix and left it for later.</p>
<h2 id="conclusion">Conclusion</h2>
<p>My energy was spent after finding the cause and I left it for later.
The other add-on will be ported soon as well. After porting I will go
over the <a href="https://store.falkon.org">store.falkon.org</a> items and update them
accordingly.</p>
<h2 id="notes">Notes</h2>
<p>I will probably be adding these kinds of nonsense posts more often, it
is fun to write them and share the headache.</p>
]]></content>
            
                 
                    
                 
                    
                         
                        
                            
                             
                                <category scheme="https://blog.sgorava.xyz/tags/falkon" term="falkon" label="Falkon" />
                             
                                <category scheme="https://blog.sgorava.xyz/tags/kde" term="kde" label="KDE" />
                            
                        
                    
                
            
        </entry>
    
        
        <entry>
            <title type="html"><![CDATA[Some server updates]]></title>
            <link href="https://blog.sgorava.xyz/memory/2024/11/some-server-updates/" rel="alternate" type="text/html" />
            
                <id>https://blog.sgorava.xyz/memory/2024/11/some-server-updates/</id>
            
            
            <published>2024-11-27T00:00:00+00:00</published>
            <updated>2024-11-27T00:00:00+00:00</updated>
            
            
            <content type="html"><![CDATA[<p>Over the period of this last year I somehow did multiple changes on my
little server which runs this site.</p>
<h2 id="gitea">Gitea</h2>
<p>For a long time I had issues with Gitea being unresponsive in quicker
requests. Now in retrospective I think it could be because the Mariadb
was not configured properly to accept many connections at once but
only the default number. Well, I solved it by changing the database
type to SQLite and it runs nicely now.</p>
<h2 id="jenkins">Jenkins</h2>
<p>I removed Jenkins as my back-end builder solution. For my purpose of
running website build after I push new commits into the repository
once in few weeks or months, it is a huge overkill. On top of that, it
required frequent care after each update to work properly with Gitea
(plugin updates) which I do not want to manage anymore.</p>
<p>I replaced stuff previously running under Jenkins by simple shell
scripts which I start by cron during night. Works nicely.</p>
<h2 id="virtual-private-server-vps">Virtual Private Server (VPS)</h2>
<p>Due to pricing changes it is a bit cheaper for me to get new more
powerful VPS for cheaper than I have now. So I was manually moving and
setting up stuff on this new VPS for last few days. It is nice to be
free from all the dependencies required by Jenkins. I still want to
configure some stuff on the server to have more fun, but it can wait
for a while.</p>
<p>I also got scraped by Amazon bot and due to that I consider blocking
all those bots by IP when it is known from where they operate.</p>
<h2 id="ssh">SSH</h2>
<p>In the past I used <code>fail2ban</code> to block weird IPs from accessing the
server and trying to brute force into it, but due to some updates
either in SSH or somewhere in the chain it stopped working properly.
So I disabled it and I now use just SSH with some delay after failed
attempt to login. Well, it is mostly to block the weird traffic since
the SSH daemon is configured to login only with shh keys, no password
access is allowed, so brute forcing this is truly a matter of luck.</p>
<h2 id="blog">Blog</h2>
<p>The lack of posts is caused by my incompetence. I wanted to write an
article about my little script which I made by I did not manage to
come up with a good enough draft to turn into a blog post. And other
ideas and stuff are also a bit limited and I was low on energy this
whole year.</p>
<h2 id="falkon-reports">Falkon reports</h2>
<p>I did not write the progress reports since I tried to work on stuff
instead. Other thing is that Falkon website which is now also based on
Hugo with KDE theme is very bad when it comes to long term support. It
requires care and with my frequency of posts I am afraid that after
each post I will need to update the KDE theme to match Hugo stuff and
work properly. On other note, there is a nice collection of commits
for Falkon which was merged in this year.</p>
<h2 id="conclusion">Conclusion</h2>
<p>This year is crazy from many aspects and all I can say while not
getting violent is a quote from Kirito from Sword Art Online Abridged:</p>
<blockquote>
<p>&ldquo;You know something? I really hate people! They&rsquo;re selfish,
ignorant, loud obnoxious pricks, with basically no redeeming
qualities whatsoever. I mean really, look at all they&rsquo;ve achieved!
Genocide, global warming, reality TV, and just a never ending parade
of failures and fuck ups! They are, without question, a complete
write-off of a species, and how dare you make me care about them!&rdquo;</p>
</blockquote>
]]></content>
            
                 
                    
                 
                    
                         
                        
                            
                             
                                <category scheme="https://blog.sgorava.xyz/tags/blog" term="blog" label="Blog" />
                             
                                <category scheme="https://blog.sgorava.xyz/tags/thoughts" term="thoughts" label="Thoughts" />
                            
                        
                    
                
            
        </entry>
    
        
        <entry>
            <title type="html"><![CDATA[Falkon: Development Update, Dec 2023]]></title>
            <link href="https://blog.sgorava.xyz/memory/2023/12/falkon-development-update-dec-2023/" rel="alternate" type="text/html" />
            
                <id>https://blog.sgorava.xyz/memory/2023/12/falkon-development-update-dec-2023/</id>
            
            
            <published>2023-12-26T00:00:00+00:00</published>
            <updated>2023-12-26T00:00:00+00:00</updated>
            
            
            <content type="html"><![CDATA[<p>A lot of happened since I last wrote something about Falkon development.</p>
<h1 id="release-of-falkon-2308">Release of Falkon 23.08</h1>
<p>Relatively a lot of stuff was changed/added/fixed for this release series.</p>
<p>The biggest thing I struggled with was session restore optimizations which is very slow and I manahed to get it faster by a bit and also introduce new bugs. Well nothing is for free. There is still a second part waiting and that is to delay putting icons into the tabs on the tabbar until they are realy needed. This operation actualy takes most of the time.</p>
<p>The rest are smaller parts and also stuff contributed by people who care about Falkon.</p>
<p>There should also be another release in this series 23.08.5 with more bugfixes.
(It is already getting to the point I am fixing my own mistakes.)</p>
<h1 id="preparations-for-falkon-2402">Preparations for Falkon 24.02</h1>
<p>The biggest change is a port to Qt6 which is possible thanks to people contributing to Falkon (and me having a headache).
The Qt6 port is a minimal port, which means that no new features and some features are disabled.</p>
<p>Even the bare port like this takes a lot of energy since the version of KDE ExtraCmakeModules (ECM) was not increased since forever and after bumping it into a proper number it made the code unable to compile due to a lot of string issues. This was a headache since Clazy integration in KDevelop did not work properly so I could not use automatic fix. (yes, I could use the time to learn how to do it manually&hellip;)</p>
<p>Another point is that Qt6 is constantly releasing new version which break stuff, so there are some bugreports from not yet released Qt6 which I have no will to test.</p>
<h1 id="next-plans">Next plans</h1>
<p>Version 24.02 is a special one and thus the feature freeze happened much sooner so no new features can be added there, which means the new features will land in some 24.04++++ release.</p>
<p>These are some of the requested stuff made possible thanks to Qt6 implementing it.</p>
<ul>
<li>Detection of captive portals</li>
<li>New way to detect network availability status</li>
<li>DNS Over Https (or so I think, since it pops in the terminal logs &ndash; doh - using system settings)</li>
</ul>
<p>And probably many more since I did not take a complete look at what is new, the features will come over time.</p>
<h2 id="site-settings">Site Settings</h2>
<p>This is a feature I am working on for a while with some breaks here and there. I plan to finish it within the new year of 2024.
I am struggling with some system design and functionality, so after I sort these out I will go beg the KDE GUI team for help to help me design and improve the UI for this feature. Better later than never that I realized this.</p>
<p>PS: This thing touches a lot of essential parts of browser so I think it is important to take more time to properly make it.</p>
<h2 id="speeddial">SpeedDial</h2>
<p>This page sucks a lot of power from the CPU. I have no idea whhy this little webpage is so demanding.</p>
<p>I tried to take a look at it and I slowly started reqriting it and it resulted in me fixinf a single typo. Yes, this is what you get after working most of the weekend on JavaScript code.</p>
<p>This thing is using JQuery and the JQuert Sortable thing to make the speeddial page interactive. I tried to search for a good replacement but I found nothing worth my attention. It is all either part of the BIG framework or abandoned code (mo update for a while).</p>
<h2 id="support-for-different-devices">Support for different devices</h2>
<p>I am trying to use Falkon on PinePhone and PineTab2 to find the performance issues and the UI issues on these touch devices. And there is a lot of them since Falkon was never designed with Touch supoort in mind, the touch stuff is not even enabled in the code and I do not want to mess stuff by enabling it before properly testing it.</p>
<h1 id="fixing-tests">Fixing tests</h1>
<p>All autotests should pass locally and also on GitLab CI, well they do not.
It is not a surprise sicne I did not change the tests after changing the code, I totally forgot them.
There are some interesting tests which hope that the browser is not fully initialized yet (QmlTabsApiTest) to do their stuff, that is simply not how it is supposed to be done. The problem with this approach is that it creates a seemingly random bug in the middle of the test.</p>
<p>I want to learn more about Falkon autotests and how they are done in order to write some tests for the Site Settings future feature.</p>
<p>PS: PyFalkon tests are broken for many years (they depend on a removed functionality) and I will leave this one for later. It is not shown on the Qt6 GitLab CI since it is missing PySide6 on the server, so it is fine, right?</p>
<h1 id="conclusion">Conclusion</h1>
<p>While I am a bit more familiar with Falkon code-base there are still places I have no idea about, that is why I need to take more time to learn more about it. Also the same goes for Qt of whatever version, I work with Qt mostly only on Falkon and some smaller projects. That is another excuse why the changes take so much time. But is is a good exercise.</p>
<p>Overall, it looks good and I will continue looking over Falkon until someone better appears.</p>
<p>Yes, I am sure I forgot something.</p>
<p>Yes, I did not put any links to this post.</p>
]]></content>
            
                 
                    
                 
                    
                         
                        
                            
                             
                                <category scheme="https://blog.sgorava.xyz/tags/kde" term="kde" label="KDE" />
                             
                                <category scheme="https://blog.sgorava.xyz/tags/falkon" term="falkon" label="Falkon" />
                             
                                <category scheme="https://blog.sgorava.xyz/tags/report" term="report" label="Report" />
                            
                        
                    
                
            
        </entry>
    
        
        <entry>
            <title type="html"><![CDATA[I am a game developer]]></title>
            <link href="https://blog.sgorava.xyz/memory/2023/12/i-am-a-game-developer/" rel="alternate" type="text/html" />
            
                <id>https://blog.sgorava.xyz/memory/2023/12/i-am-a-game-developer/</id>
            
            
            <published>2023-12-04T00:00:00+00:00</published>
            <updated>2023-12-04T00:00:00+00:00</updated>
            
            
            <content type="html"><![CDATA[
<p>
Just kidding.</p>
<p>
In recent times I played multiple minigames from KDE collection. These games are nice, small and can be played on almost anything these days. But no software can run away from bugs.</p>
<p>
A short list of my adventure,</p>
<div id="outline-container-headline-1" class="outline-2">
<h2 id="headline-1">
Kolf
</h2>
<div id="outline-text-headline-1" class="outline-text-2">
<p>
A nice minigolf game with simple and more complicated way to make the ball move (called &#34;putting&#34;).
When I was playing with it, it simply stayed on the screen even after it was disabled.
So a Merge Request was born: <a href="https://invent.kde.org/games/kolf/-/merge_requests/13">Hide StrokeCircle when AdvancedPutting is disabled</a></p>
<p>
This is very small issue, and in retrospective I think I used different codestyle than the rest of the code.</p>
</div>
</div>
<div id="outline-container-headline-2" class="outline-2">
<h2 id="headline-2">
KBounce
</h2>
<div id="outline-text-headline-2" class="outline-text-2">
<p>
Imprison the bouncing balls, or lets build a wall around the balls. A game which can be played for a very long time on an EASY difficulty and becomes a real challenge as the difficulty raises. During my playthrough I was bothered a lot by 2 bug:</p>
<ul>
<li><a href="https://invent.kde.org/games/kbounce/-/merge_requests/10">Correct Ball and Wall Velocity at the init, and make the code more readable</a></li>
<li><a href="https://invent.kde.org/games/kbounce/-/merge_requests/9">Set filter for picture path selector to Directory</a></li>
</ul>
<p>In other words, the difficulty after the game started was not as I configured which forced me to play at Easy with Medium settings. It took me a while to figure out there is even a problem.</p>
<p>
The other one was found when I was looking through the settings and found the option to have a custom random background for the game. The directory selector did not work properly and I had to select some file and update the path to a parent directory manualy, this is not very comfortable to do, so I went and fixed it. I used Gammeray to track the proper widget (very nice tool).</p>
</div>
</div>
<div id="outline-container-headline-3" class="outline-2">
<h2 id="headline-3">
KSquares
</h2>
<div id="outline-text-headline-3" class="outline-text-2">
<p>
With lines form a square and take control over the game board. I play from time to time against the bot. What I was bothered with is the default white background and broken color configuration. The Merge Request can be found at: <a href="https://invent.kde.org/games/ksquares/-/merge_requests/11">Add color customization</a></p>
<p>
The game itself does not have a live update of the settings, so the new game or a restart is needed to apply them. Now it is much better, with the black, green and and red theme.</p>
</div>
</div>
<div id="outline-container-headline-4" class="outline-2">
<h2 id="headline-4">
Conclusion
</h2>
<div id="outline-text-headline-4" class="outline-text-2">
<p>
These games are small which means the code is often easily understood, so anyone can dive in and fix something.</p>
<p>
My changes to these games are small and most people will never notice. </p>
<p>
PS: I like increasing software quality by fixing bugs which noone will notice, so call edge cases in a dark corner.</p>
</div>
</div>
]]></content>
            
                 
                    
                 
                    
                         
                        
                            
                             
                                <category scheme="https://blog.sgorava.xyz/tags/kde" term="kde" label="KDE" />
                             
                                <category scheme="https://blog.sgorava.xyz/tags/games" term="games" label="Games" />
                            
                        
                    
                
            
        </entry>
    
        
        <entry>
            <title type="html"><![CDATA[Falkon: Development Update, Spring 2023]]></title>
            <link href="https://blog.sgorava.xyz/memory/2023/07/falkon-development-update-spring-2023/" rel="alternate" type="text/html" />
            
                <id>https://blog.sgorava.xyz/memory/2023/07/falkon-development-update-spring-2023/</id>
            
            
            <published>2023-07-18T00:00:00+00:00</published>
            <updated>2023-07-18T00:00:00+00:00</updated>
            
            
            <content type="html"><![CDATA[
<p>
This spring I did not have much time on Falkon since I was learning how to drive a car.
There were still some moments left for Falkon.</p>
<div id="outline-container-headline-1" class="outline-2">
<h2 id="headline-1">
Release of Falkon 23.04.0
</h2>
<div id="outline-text-headline-1" class="outline-text-2">
<p>
Thanks to KDE Gear team there is another major Falkon release. This time (with some trial and error) I also put the changelog and some picture on the main Falkon site to show Falkon is alive and well.</p>
<p>
&gt; Some stuff were able to make it into the 23.04.0 release but majority of the development will be available in the 23.08.0 release.</p>
</div>
</div>
<div id="outline-container-headline-2" class="outline-2">
<h2 id="headline-2">
Preparation for Falkon  23.08.0
</h2>
<div id="outline-text-headline-2" class="outline-text-2">
<p>
The good thing is there is still enough time to finish the bugs and add sopme smaller features. The downside is that the weather is way too hot for prolonged work.</p>
<div id="outline-container-headline-3" class="outline-3">
<h3 id="headline-3">
Performance of Restore session / window
</h3>
<div id="outline-text-headline-3" class="outline-text-3">
<p>
At the moment restoring session / window is a costly operation in Falkon. this bug can be experienced with few hundred tabs and due to it Falkon can be starting for a long time.
The biggest problem is that during restore operation the GUI is called and updated the (almost) same way as if user did it, just way too fast. This results in wasted operations like adding and removing the tab close button, changing the window title, changing url in location bar, recalculating the size of tabs and so on for each restored tab.
While I know this now, the trick is to bypass it without breaking anything.</p>
</div>
</div>
</div>
</div>
<div id="outline-container-headline-4" class="outline-2">
<h2 id="headline-4">
Merge Requests
</h2>
<div id="outline-text-headline-4" class="outline-text-2">
<p>
Only things I can remember.</p>
<div id="outline-container-headline-5" class="outline-3">
<h3 id="headline-5">
AddressBar suggestion popup - fit window width
</h3>
<div id="outline-text-headline-5" class="outline-text-3">
<p>
Disabled by default, mostly suited for smaller displays like PinePhone where it can provide few more pixels.</p>
</div>
</div>
<div id="outline-container-headline-6" class="outline-3">
<h3 id="headline-6">
ZoomLabel in address bar
</h3>
<div id="outline-text-headline-6" class="outline-text-3">
<p>
Long awaited feature, a while ago I tried to make it and experiment with custom painting in Qt. It looks fine on my machine! This one benefited from the future me who managed to find multiple bugs in the initial implementation, but I still failed to catch the missing translation for percentage text (Caught thanks to &#34;Emir SARI&#34;).</p>
</div>
</div>
<div id="outline-container-headline-7" class="outline-3">
<h3 id="headline-7">
Browser defaults
</h3>
<div id="outline-text-headline-7" class="outline-text-3">
<p>
Default KDE bookmarks and speeddial entries. A kind of KDE branding and making people aware of more KDE sites and projects. (By Javier Llorente),</p>
</div>
</div>
<div id="outline-container-headline-8" class="outline-3">
<h3 id="headline-8">
Plasma download integration
</h3>
<div id="outline-text-headline-8" class="outline-text-3">
<p>
As name says, a try to integrate Falkon downloads into Plasma things. (By Javier Llorente).</p>
<p>
I only tested if Falkon works properly after this patch and it does, there is no crash. Sadly I am unable to test Plasma things since I do not use it, maybe in the future.</p>
</div>
</div>
<div id="outline-container-headline-9" class="outline-3">
<h3 id="headline-9">
Port to Qt6
</h3>
<div id="outline-text-headline-9" class="outline-text-3">
<p>
Long awaited port to Qt6 will be merged to master (after rebasing and checking) in preparation for 23.12.0 release. (By Tiernan Hubble)</p>
<p>
Since I did not have much time in spring for this one, and this feature needs time to mature it was put on hold for a while.</p>
</div>
</div>
<div id="outline-container-headline-10" class="outline-3">
<h3 id="headline-10">
Others
</h3>
<div id="outline-text-headline-10" class="outline-text-3">
<p>
Some other things are still waiting and my big feature are waiting as well, but it all takes a will and time to finish it.</p>
</div>
</div>
</div>
</div>
<div id="outline-container-headline-11" class="outline-2">
<h2 id="headline-11">
Conclusion
</h2>
<div id="outline-text-headline-11" class="outline-text-2">
<p>
While I took a step back there are still people working on Falkon, which is nice.</p>
</div>
</div>
]]></content>
            
                 
                    
                 
                    
                         
                        
                            
                             
                                <category scheme="https://blog.sgorava.xyz/tags/kde" term="kde" label="KDE" />
                             
                                <category scheme="https://blog.sgorava.xyz/tags/falkon" term="falkon" label="Falkon" />
                             
                                <category scheme="https://blog.sgorava.xyz/tags/report" term="report" label="Report" />
                            
                        
                    
                
            
        </entry>
    
        
        <entry>
            <title type="html"><![CDATA[Falkon: Development Update, Mar 2023]]></title>
            <link href="https://blog.sgorava.xyz/memory/2023/04/falkon-development-update-mar-2023/" rel="alternate" type="text/html" />
            
                <id>https://blog.sgorava.xyz/memory/2023/04/falkon-development-update-mar-2023/</id>
            
            
            <published>2023-04-01T00:00:00+00:00</published>
            <updated>2023-04-01T00:00:00+00:00</updated>
            
            
            <content type="html"><![CDATA[<p>Weird news from development of Falkon web browser.</p>
<h2 id="development">Development</h2>
<h3 id="history-browser">History browser</h3>
<p>When filter is not empty, do not delete the whole history under a date
if the date entry is selected. This is especially cruel when trying to
remove multiple entries and using keyboard shortcut <code>Ctrl+A</code>, Good Bey
History. Now the entries unrelated to the filtering phrase should not
be deleted. While I also deleted my whole history, this was reported
at <a href="https://bugs.kde.org/show_bug.cgi?id=466936">bugzilla</a>.</p>
<h2 id="extensions">Extensions</h2>
<h3 id="pyfalkon">PyFalkon</h3>
<p>Fix crash when working with bookmarks. This was reported on <a href="https://invent.kde.org/network/falkon/-/issues/19">KDE
Invent</a> a while ago and I promised to integrate it
into next release. Well, I missed few releases and here it is.</p>
<h3 id="adblock">AdBlock</h3>
<p>Cosmetic updates only.</p>
<h4 id="add-support-for-the-dark-theme">Add support for the dark theme</h4>
<p>Last time I missed AdBlock blocking page. I have few excuses why that
is, I did not see this page in a long time and I did not look well
enough into the code. There are few more random html files in the code
base which I still did not look at.</p>
<h4 id="properly-show-the-blocked-page">Properly show the BLOCKED page</h4>
<p>This feature was broken due to some Chromium or QtWebEngine security
thing which does not allow to redirect a request to a data URL. The
user was greeted only with <code>ERR_UNSAFE_REDIRECT</code> chromium page without
any knowledge why. This <code>temporary</code> workaround works around this issue
(I am already thinking of a bit nicer execution of it).</p>
<h4 id="clean-up-default-subscription-lists">Clean up default subscription lists</h4>
<p>The default subscription list is old and when I went over the links
they did not work, so I deleted them. One was working fine, while
still seemed outdated at least it could load with different domain
(had problem with SSL and domain name).</p>
<h3 id="kwallet">KWallet</h3>
<p>Change to use MAP format was merged. SO far nobody complained to me. I
also have a small program which I put together from pieces of Falkon
code to export the passwords from old binary based KWallet format. I
think of putting it into either separate repository or into &ldquo;contrib&rdquo;
folder.</p>
<h2 id="conclusion">Conclusion</h2>
<p>Just few small changes which noone will notice or will think as
&ldquo;should be there&rdquo; feature.</p>
]]></content>
            
                 
                    
                 
                    
                         
                        
                            
                             
                                <category scheme="https://blog.sgorava.xyz/tags/kde" term="kde" label="KDE" />
                             
                                <category scheme="https://blog.sgorava.xyz/tags/falkon" term="falkon" label="Falkon" />
                             
                                <category scheme="https://blog.sgorava.xyz/tags/report" term="report" label="Report" />
                            
                        
                    
                
            
        </entry>
    
        
        <entry>
            <title type="html"><![CDATA[Falkon: Development Update, Feb 2023]]></title>
            <link href="https://blog.sgorava.xyz/memory/2023/03/falkon-development-update-feb-2023/" rel="alternate" type="text/html" />
            
                <id>https://blog.sgorava.xyz/memory/2023/03/falkon-development-update-feb-2023/</id>
            
            
            <published>2023-03-01T00:00:00+00:00</published>
            <updated>2023-03-01T00:00:00+00:00</updated>
            
            
            <content type="html"><![CDATA[<p>Weird news from development of Falkon web browser.</p>
<h2 id="development">Development</h2>
<h3 id="gitlab-freebsd-pipeline">GitLab FreeBSD pipeline</h3>
<p>FreeBSD pipeline was failing for a while. It always failed on PyFalkon
plugin and in qztools file. It looks like the &ldquo;latest&rdquo; FreeBSD
something does not like &ldquo;{}&rdquo; as default option for QFlags type. To
some extend I can understand it, since it runs some code generator and
than builds the generated code. And if the code generator fails to
resolve everything the compilation might fail.</p>
<p>On second look, it seems that Python support is disabled on FreeBSD
package. It is a bit sad but the pipeline is still nice to have.</p>
<h3 id="custom-path-of-qtwebengine-dictionaries">Custom path of QtWebEngine dictionaries</h3>
<p>Falkon will now provide (in preferences) a list of dictionaries
located in a folder specified by &ldquo;QTWEBENGINE_DICTIONARIES_PATH&rdquo;
environmental variable. This functionality is built into QtWebEngine
and it only needs to be instructed which language should be used for
spellchecking. Now Falkon can do exactly that.</p>
<h3 id="zoom-label-in-location-bar">Zoom label in location bar</h3>
<p>I thought this one is a good way to explore another part of Falkon
code and that is the location bar. The zoom label was a tricky thing
to make since I needed to learn how to manually draw it, so that it
look kinda nice at least to me.</p>
<p>The functionality:</p>
<ul>
<li>Can be enabled in settings</li>
<li>Is is hidden when the zoom level matches the configured default zoom
level</li>
<li>The zoom level is reset by clicking on the label (described in
tooltip)</li>
</ul>
<p>A bit of inspiration was the one in Firefox, but my skills and
artistic spirit are lacking, it is what it is.</p>
<p>State: Waiting for a second look.</p>
<h2 id="merge-requests">Merge requests</h2>
<h3 id="add-an-option-for-gpu-acceleration">Add an option for GPU acceleration</h3>
<p>This one got merged, had to do it manually because GitLab was
protesting. This a great addition made by <code>Hao Chi Kiang</code>.</p>
<h3 id="add-flatpak-cicd-integration">Add Flatpak CI/CD Integration</h3>
<p><code>Neelaksh Singh</code> worked hard on adding a Flatpak CI integration. A nice
thing for people using this form of a software distribution.</p>
<h2 id="extensions">Extensions</h2>
<p>I found a bit of time to fix additional extensions <code>Cookies.txt</code> and
<code>Readability</code>. It was my mistake, I put a LICENSE file in the top level
in the archive which resulted in install error from Falkon, I moved it
into the &ldquo;addon&rdquo; directory and problem solved. And also as it was
suggested to me, I added an entry point entry to the metadata.desktop
file so that the older Falkon version can work with it.</p>
<h3 id="rssfinder">RSSFinder</h3>
<p>There is a slight change in the design to show a dedicated button for
copying the URL and after clicking on the text part the feed will be
opened in the new tab.</p>
<figure><img src="/images/2023-03-01_rssfinder_new_design.png"
    alt="RSSFinder: A new design"><figcaption>
      <p>RSSFinder: A new design</p>
    </figcaption>
</figure>

<h2 id="conclusion">Conclusion</h2>
<p>Thank to all the contributors Falkon is moving forward.</p>
<p>PS: As it goes, I can nicely describe what I work on and I am losing
words when describing what others did since I see only the result of
their efforts.</p>
]]></content>
            
                 
                    
                 
                    
                         
                        
                            
                             
                                <category scheme="https://blog.sgorava.xyz/tags/kde" term="kde" label="KDE" />
                             
                                <category scheme="https://blog.sgorava.xyz/tags/falkon" term="falkon" label="Falkon" />
                             
                                <category scheme="https://blog.sgorava.xyz/tags/report" term="report" label="Report" />
                            
                        
                    
                
            
        </entry>
    
        
        <entry>
            <title type="html"><![CDATA[Falkon: Development Update, Jan 2023]]></title>
            <link href="https://blog.sgorava.xyz/memory/2023/02/falkon-development-update-jan-2023/" rel="alternate" type="text/html" />
            
                <id>https://blog.sgorava.xyz/memory/2023/02/falkon-development-update-jan-2023/</id>
            
            
            <published>2023-02-01T00:00:00+00:00</published>
            <updated>2023-02-01T00:00:00+00:00</updated>
            
            
            <content type="html"><![CDATA[<p>Weird news from development of Falkon web browser.</p>
<h2 id="my-little-break">My little break</h2>
<p>I took a break for a few weeks (turned out to be a bit longer) to get a
different look at the features I am working at. (Good excuse, right?)</p>
<h2 id="development">Development</h2>
<h3 id="site-settings">Site Settings</h3>
<p>I am struggling with the UI design and the UI programming itself. I am
not that skilled with Qt and its way of doing these things so it will
take a bit before I gain the required skills and experience to
continue working on it in earnest.</p>
<p>On other hand, while working (for fun) on a other parts of the code I
noticed that the PasswordManager is also using host name as an id but
for some reason also introduces alternative methods of setting up an
id when the general QUrl::host() fails. I should implement this here
as well.</p>
<h3 id="dark-design">Dark design</h3>
<p>I was a bit interested and worked a bit to put together a dark variant
of Falkon internal pages such as:</p>
<ul>
<li>falkon:start</li>
<li>falkon:restore</li>
<li>falkon:config</li>
<li>falkon:about</li>
<li>tab crash page</li>
</ul>
<p>The actual color design is just something I put together from colors
on my screen and other stuff I thought would &ldquo;look nice&rdquo; on my monitor
with inaccurate color representation and with RedShift program enabled
during the night (Enjoy, lol).</p>
<p>I still do not want to play with chromium flags to add checkbox to
prefer dark mode.</p>
<figure><img src="/images/2023-02-01_falkon_light_and_dark_page.png"
    alt="Falkon: Light and Dark styled page"><figcaption>
      <p>Falkon: Light and Dark styled page</p>
    </figcaption>
</figure>

<h3 id="waiting-patches">Waiting patches</h3>
<p>There are few patches waiting for a check and inclusion for which I
did not have time or will or mood to do so. Sorry for now, I will take
a look soon</p>
<h2 id="extensions">Extensions</h2>
<h3 id="kwallet">KWallet</h3>
<p>I was interested on how much work would it be to change the way how
passwords are stored from the binary form to the map variant to allow
users to browse or export Falkon passwords from KWallet without
special tools. It turned out as a working solution (since it is based
on the original one) and I learnt a thing or two while working on it.</p>
<p>I also almost forget to include the &ldquo;updated&rdquo; timestamp feature. I only
found after looking at Clazy warnings on the GnomeKeyring
implementation. This would be a really weird mistake.</p>
<h2 id="maintenance">Maintenance</h2>
<p>Naturally, after the code was left as it is for a while it needs a top
of care to be in top shape again. There are a lot of warnings and
potential errors in the code which can be found with automated tools
such as Clazy or CppCheck.</p>
<p>On top of that, there is a huge debt in Chromium flags and features
support together with actual Falkon UI and usability improvements.</p>
<p>There is a work for a whole lifespan.</p>
<h2 id="conclusion">Conclusion</h2>
<p>It goes well enough.</p>
]]></content>
            
                 
                    
                 
                    
                         
                        
                            
                             
                                <category scheme="https://blog.sgorava.xyz/tags/kde" term="kde" label="KDE" />
                             
                                <category scheme="https://blog.sgorava.xyz/tags/falkon" term="falkon" label="Falkon" />
                             
                                <category scheme="https://blog.sgorava.xyz/tags/report" term="report" label="Report" />
                            
                        
                    
                
            
        </entry>
    
        
        <entry>
            <title type="html"><![CDATA[Falkon: Development Update, Oct 2022]]></title>
            <link href="https://blog.sgorava.xyz/memory/2022/11/falkon-development-update-oct-2022/" rel="alternate" type="text/html" />
            
                <id>https://blog.sgorava.xyz/memory/2022/11/falkon-development-update-oct-2022/</id>
            
            
            <published>2022-11-02T00:01:00+00:00</published>
            <updated>2022-11-02T00:01:00+00:00</updated>
            
            
            <content type="html"><![CDATA[<p>Weird news from development of Falkon web browser.</p>
<h2 id="development-site-settings">Development: Site Settings</h2>
<p>At the start of the month I did something and I already forgot what it
was (very sad) and than I took a &ldquo;short&rdquo; break for a week which turned
out ot be for a whole month due to other reasons.</p>
<h2 id="extensions">Extensions</h2>
<p>During this break I worked on two QML extensions
<a href="https://store.falkon.org/p/1917615">Cookies.txt</a> and
<a href="https://store.falkon.org/p/1309264">Readability</a>. The Cookies.txt is in a way
me trying to understand how to work with cookies from within QML extension in
order to write a proper tutorial for it. The Readability was done on a request
and because I thought it can be somehow hacked with QML. This took a bit longer
than I expected, but it is nice to have.</p>
<h2 id="conclusion">Conclusion</h2>
<p>I learnt quite a lot this month, just from this point it was a good
month.</p>
]]></content>
            
                 
                    
                 
                    
                         
                        
                            
                             
                                <category scheme="https://blog.sgorava.xyz/tags/kde" term="kde" label="KDE" />
                             
                                <category scheme="https://blog.sgorava.xyz/tags/falkon" term="falkon" label="Falkon" />
                             
                                <category scheme="https://blog.sgorava.xyz/tags/report" term="report" label="Report" />
                            
                        
                    
                
            
        </entry>
    
        
        <entry>
            <title type="html"><![CDATA[Disabling sound on KDE/Qt notifications / alerts with ALSA]]></title>
            <link href="https://blog.sgorava.xyz/memory/2022/11/disabling-sound-on-kde/qt-notifications-/-alerts-with-alsa/" rel="alternate" type="text/html" />
            
                <id>https://blog.sgorava.xyz/memory/2022/11/disabling-sound-on-kde/qt-notifications-/-alerts-with-alsa/</id>
            
            
            <published>2022-11-02T00:00:00+00:00</published>
            <updated>2022-11-02T00:00:00+00:00</updated>
            
            
            <content type="html"><![CDATA[<p>I am using ALSA for my system sound and I am trying to keep away from
PulseAudio and PipeWire things. I do not like them that. I know they
provide a way to disable the system sound, just open PavuControl and
mute the &ldquo;System Sounds&rdquo; channel and done.</p>
<p>For ALSA I did not manage to find such a simple way to do it. I also
did not find a way to disable it in KDE or Qt configuration files
(or I did not search hard enough).</p>
<p>In the end, I resulted in a brute force approach and deleted files and
made sure they will not be installed again. So how to do that? I use
Artix linux and it is simple.</p>
<p>Open <code>/etc/pacman.conf</code> and add/edit it like this:</p>
<pre tabindex="0"><code>NoExtract   = usr/share/sounds/Oxygen*
</code></pre><p>The sounds are provided by package <code>oxygen-sounds</code> and it updates
frequently and is a dependency with a VERSION for other KDE packages.
This means I cannot ignore it or mark it as installed since other
packages will request it at the specified version (greets KDE Gear).</p>
<p>By deleting the files provided by this package from
<code>/usr/share/sounds</code> the sound will be gone and I will have my silence.
Now I have to ensure that the package is being installed and updated
properly by pacman and the sound files are not provided/extracted by
it. This can be achieved by the <code>NoExtract</code> option in <code>pacman.conf</code> as
said before.</p>
<p>PS: This is note for myself if I need it again (needed it twice
already and always had to do a full research).</p>
]]></content>
            
                 
                    
                 
                    
                         
                        
                            
                             
                                <category scheme="https://blog.sgorava.xyz/tags/kde" term="kde" label="KDE" />
                             
                                <category scheme="https://blog.sgorava.xyz/tags/thoughts" term="thoughts" label="Thoughts" />
                             
                                <category scheme="https://blog.sgorava.xyz/tags/alsa" term="alsa" label="ALSA" />
                            
                        
                    
                
            
        </entry>
    
        
        <entry>
            <title type="html"><![CDATA[Rewrite of Falkon plugin Readability to QML]]></title>
            <link href="https://blog.sgorava.xyz/memory/2022/10/rewrite-of-falkon-plugin-readability-to-qml/" rel="alternate" type="text/html" />
            
                <id>https://blog.sgorava.xyz/memory/2022/10/rewrite-of-falkon-plugin-readability-to-qml/</id>
            
            
            <published>2022-10-22T00:00:00+00:00</published>
            <updated>2022-10-22T00:00:00+00:00</updated>
            
            
            <content type="html"><![CDATA[<p>This rewrite was a challenge as well as a good test subject for Falkon
QMl API. I had to work around few pitfalls to make it work.</p>
<h2 id="click-on-button-always-opens-popup">Click on button always opens popup</h2>
<p>Desired or not the popup will always open. I used it to write there sone
informative message, but it is unsued so far. In the future it an be
used a bit more to dislay the debug message or a feedback from the
script if the conversion fails.</p>
<p>The popup has to be there since without it the button would be without
an icon, which is sad.</p>
<h2 id="communication-between-webpage-javascript-and-the-qml">Communication between webpage JavaScript and the QML</h2>
<p>This one is also a fannu one since there are multiple ways how I think
this can be done. The communication is needed depending oo how and when
the settings are modified and saved.</p>
<h3 id="1-the-global-settings-can-only-be-edited-in-preferences">1. The Global settings can only be edited in preferences</h3>
<p>This approach is interesting since it allows to set some defaults in
plugin preferences which will be used all the time and any changes in
configuration done on the webpage after activating Readability plugin is
only for that single use and will be thrown away after the tab is
closed or the Readability mode is exited.</p>
<h3 id="2-provide-a-save-button-after-clicking-on-the-toolbal-icon">2. Provide a &ldquo;SAVE&rdquo; button after clicking on the toolbal icon</h3>
<p>After clicking on the toolbar button I could run a script to determine
if Readability is running on the page and if it is I could try to fetch
the current configuration and store it. If not detected the Readability
will be executed as normal. Now at the time of writing I am not sure if
the settings should be stored after clicking on the toolbar button or on
the &ldquo;Save configuration&rdquo; button which would popup.</p>
<h3 id="3-change-global-configuration-after-each-change-on-the-page">3. Change global configuration after each change on the page</h3>
<p>This is the method I chose. It seems very intuitive and simple to use
for the user (only from my limited understanding) since the change is
interactive and user sees how Readability is configured at the moment.
The downside is that QML API does not allow me to simply send these data
the way how it was done before on C++ or Python version. In these older
versions of this plugin the Readability script is executed in
&ldquo;Application world&rdquo; which allows it access to the externalJjObject and
this way can send data to the plugin code. The QML does not allow this
at the moment, and the javascript executed is always in different js
world (forgot the name, sorry). This is why I thought of using some
obscure methods like I described before. The only way to make the
communication running (allowing the JS on webpage to access the
Falkon.external object created by QML) is to run the whole thing as
UserScript which is executed probably on every single webpage. This is a
huge waste, but it is a first working version in QML and sure, it can be
improved.</p>
<p>As it can be seen, none of these options are great, but I decided to
&ldquo;ship&rdquo; something instead of wasting years until it is &ldquo;perfect&rdquo;</p>
<h2 id="javascript-code-is-weird">Javascript code is weird</h2>
<p>If yuu are JavaScript developer (a good one) you will notice that my
skills in this language are very limited and I have no idea sometimes
what I am doing since browsers these days are way too complex monsters.</p>
<h2 id="ensure-that-only-current-page-is-converted">Ensure that only current page is converted</h2>
<p>Welcome to the train of action and reaction. Since I decided to use the
userscript way to inject the script to the page I have to ensure that
only the currently visible page will be converted and not all of them.
The older versions simply ran the JS code on a current window and
current tab which QML cannot do with desired JsWorld. So, I went with
userscript and some Qt signals. This approach causes it to send a signal
to every sinle instance of the userscrip in the browser and I am unable
(or I do not know) how to limit it in the QML code. Thus in the
JavaScript I added a simple condition which I found on the web (from web
documentation, this w3c thing, should be legit) called
<code>document.hidden</code>. This should be FALSE if the tab is active. I only
tested it with one browser window and it did the job, I have no idea how
it works with multiple windows.</p>
<h2 id="loading-assets-in-qml">Loading assets in QML</h2>
<p>According to my knowledge QML does not have a file read interface or any
file manipulation things, this should all be handled in some additional
C++ code. QML should be just a nice face and all heavy lifting is done
in C++. And here we go, the old versions loaded the required assets
(scripts, style and images) on the fly and put the final JS together
after by itself. This solution is a crude one and wastes a lot of CU
power in a long run, but is nice for a development.</p>
<p>The sad part is that Falkon QML API only supports loading text files and
not images. This is a bit sad but also not a thing to worry about since
the images can be converted to base64 format and added to style while
the plugin is being packages. That is exactly what I have done this
time. I still left the final gue operation for JS in QML code (it joins
the scripts and styles together into one). This should also be done in
the packagin process together with minifying the scripts to save a bit
extra on user side.</p>
<h2 id="conclusion">Conclusion</h2>
<p>Now that I think about it, I used Readabilty QML rewrite as a good
excuse to learn a bit more about the current state of Falkon QMl API and
how to work around it in my own way. Playing with mysteiour QML thing
together with monster browser and little Makefile for packaging was fun.
Later I might write another chapters of my Falkon QML tutorials since I
learnt a lot these past few months.</p>
<p>PS: Yeah, it all sounds chaotic.</p>
<p>Enjoy, or scold me.</p>
<p>The extension can be found at Falkon
<a href="https://store.falkon.org/p/1309264">store</a> and code at my
<a href="https://git.sgorava.xyz/Falkon/Readability">Gitea</a>.</p>
]]></content>
            
                 
                    
                 
                    
                         
                        
                            
                             
                                <category scheme="https://blog.sgorava.xyz/tags/programming" term="programming" label="programming" />
                             
                                <category scheme="https://blog.sgorava.xyz/tags/falkon" term="falkon" label="falkon" />
                             
                                <category scheme="https://blog.sgorava.xyz/tags/qml" term="qml" label="qml" />
                            
                        
                    
                
            
        </entry>
    
        
        <entry>
            <title type="html"><![CDATA[Introducing a Falkon extension Cookies.txt]]></title>
            <link href="https://blog.sgorava.xyz/memory/2022/10/introducing-a-falkon-extension-cookies.txt/" rel="alternate" type="text/html" />
            
                <id>https://blog.sgorava.xyz/memory/2022/10/introducing-a-falkon-extension-cookies.txt/</id>
            
            
            <published>2022-10-10T00:00:00+00:00</published>
            <updated>2022-10-10T00:00:00+00:00</updated>
            
            
            <content type="html"><![CDATA[<p>This weekend I decided to test if it is possible to create a
Cookies.txt style extensions for Falkon by using QML API.</p>
<p>This work is partially based on
<a href="https://github.com/lennonhill/cookies-txt">Firefox</a> and
<a href="https://github.com/daftano/cookies.txt/tree/6e22403d489fe841a3013c16c710f87888c7b95f">Chrome</a>
extensions.</p>
<p>The GUI is shamelessly copied from the Firefox extension but I had a
little trouble porting it to QML since I have still long way to go
with this language. I like the GUI being a simple one and to the
point. Either export &ldquo;All&rdquo; or the &ldquo;Current Site&rdquo;, sounds nice.</p>
<p>The harder part was to get the cookies for the current site since the
domain set for a cookie can have a leading dot which probably (yeah I
am guessing) mean it should apply for all subdomains it is even more
trickier. The Firefox extension is cleverly using Firefox API to get
the data and it works fine. The Chrome extension is getting all
cookies all the time and filters the current domain on its own.</p>
<p>While Falkon Cookie API supports the filtering based on domain, the
thing is, I was unable to get it working reliably with this leading
dot and everything and I ended up using the approach from Chrome
version. This can make sense since QtWebEngine is based on Chromium so
there are some similarities. I did not want to import the whole domain
thing as the original does and I only used the &ldquo;fallback&rdquo; for it and
some hacking to get it somehow working.</p>
<p>The hacking consist of checking if the domain ends with the desired
one and other way around. I consider it as a brutal hack since it
should not work like this. But what am I to say, it is just a feature
meant to easy life of people just a little bit. It is always required
to check the results.</p>
<p>On top of everything, this short exercise is stretching my QML
knowledge a bit.I found that the QML JavaScript is limited and
provides only a handful of features and some are available through Qt
module (or object, namespace&hellip;.). The list of available QML
JavaScript thing can be found at <a href="https://doc.qt.io/qt-5/qtqml-javascript-functionlist.html">Qt
docs</a>. Yeah
we are still on Qt5.</p>
<p>I wanted to use the URL thing to get the hostname or domain name but
that is not available in QML JavaScript and executing JavaScript on
the webpage is impossible since that would fail (at least in current
state) when JavaScript is disabled, and that is a bit NO to me. I may
try to look at the way to enable this to allow extensions to execute
JavaScript even when the JS for site is disabled, I think there is a
way and the Falkon QML API just hides it from me</p>
<p>For icon I wanted something at least a bit nice, so I went to <a href="https://www.svgrepo.com/svg/30963/cookie">SVG
Repo</a> and took one.</p>
<p>That was me rumbling about my latest achievement and partial fail.</p>
<p>Enjoy, or scold me.</p>
<p>The extension can be found at Falkon
<a href="https://store.falkon.org/p/1917615">store</a> and code at my
<a href="https://git.sgorava.xyz/Falkon/Cookies.txt">Gitea</a>.</p>
]]></content>
            
                 
                    
                 
                    
                         
                        
                            
                             
                                <category scheme="https://blog.sgorava.xyz/tags/programming" term="programming" label="programming" />
                             
                                <category scheme="https://blog.sgorava.xyz/tags/falkon" term="falkon" label="falkon" />
                             
                                <category scheme="https://blog.sgorava.xyz/tags/qml" term="qml" label="qml" />
                            
                        
                    
                
            
        </entry>
    
        
        <entry>
            <title type="html"><![CDATA[Falkon: Development Update, Sep 2022]]></title>
            <link href="https://blog.sgorava.xyz/memory/2022/10/falkon-development-update-sep-2022/" rel="alternate" type="text/html" />
            
                <id>https://blog.sgorava.xyz/memory/2022/10/falkon-development-update-sep-2022/</id>
            
            
            <published>2022-10-02T00:00:00+00:00</published>
            <updated>2022-10-02T00:00:00+00:00</updated>
            
            
            <content type="html"><![CDATA[<p>Weird news from development of Falkon web browser.</p>
<h2 id="development-site-settings">Development: Site Settings</h2>
<p>I continued working on some system for WebAttributes and it looks fine
at the moment (well, it just works). The thought which I have is to
put all the WebAttributes into one field in the database and parse it
afterwords instead of having a separate field for each attribute. I
did not try this yet and I will keep this idea for later date when
everything will be ready.</p>
<p>Nest I moved to working on Cookie support and because of that started
rewriting the SiteSettingsManager class to have sane interface.</p>
<p>Well, I can only blame my lack of preliminary research of the problems
and possible solutions for this big rewrite. Instead of writing a good
code from get go I change it according to the current needs. So far it
works.</p>
<h2 id="bugs">Bugs</h2>
<p>Right after KDE Gear team released &ldquo;Falkon 22.08.1&rdquo; I took another look
at the <a href="https://bugs.kde.org/show_bug.cgi?id=439268">Bug 439268</a>
(Typing text in the search bar sends data although suggestions are
disabled). During my first look at this I thought I would need to
connect/disconnect signals to this module or to conditionally create
and destroy the OpenSearch object, or that I need to update this
module. Well, I was silly and I was looking at it in a  complicated
way. On the second look I noticed that all I need to do is to set the
suggestionUrl (or domain, or something) to an empty string when the
suggestions are disabled and that fixes the problem. There is some
left over code there which was supposed to hide entries (more like not
show them to user) from search engine.</p>
<h2 id="misc">Misc</h2>
<p>On the other hand I want to put documentation for Falkon to
<a href="https://api.kde.org/">KDE API</a> site and plugin examples and my short
tutorials to <a href="https://develop.kde.org/docs/">KDE Develop</a> site. This
would make it easier for other to develop extensions and help Falkon
to improve.</p>
<h2 id="conclusion">Conclusion</h2>
<p>The development of SiteSettings is going well and there is even a bug
fixed. I call this a success.</p>
<p>Any help is welcome and can speed up or improve the quality of this patch.</p>
<p>You can follow the progress of the development on KDE Invent where I created an <a href="https://invent.kde.org/network/falkon/-/issues/20">issue</a> and draft of a <a href="https://invent.kde.org/network/falkon/-/merge_requests/40">merge request</a>.</p>
]]></content>
            
                 
                    
                 
                    
                         
                        
                            
                             
                                <category scheme="https://blog.sgorava.xyz/tags/kde" term="kde" label="KDE" />
                             
                                <category scheme="https://blog.sgorava.xyz/tags/falkon" term="falkon" label="Falkon" />
                             
                                <category scheme="https://blog.sgorava.xyz/tags/report" term="report" label="Report" />
                            
                        
                    
                
            
        </entry>
    
        
        <entry>
            <title type="html"><![CDATA[My experience with bad example (or my understanding is that bad.)]]></title>
            <link href="https://blog.sgorava.xyz/memory/2022/09/my-experience-with-bad-example-or-my-understanding-is-that-bad./" rel="alternate" type="text/html" />
            
                <id>https://blog.sgorava.xyz/memory/2022/09/my-experience-with-bad-example-or-my-understanding-is-that-bad./</id>
            
            
            <published>2022-09-04T00:00:01+00:00</published>
            <updated>2022-09-04T00:00:01+00:00</updated>
            
            
            <content type="html"><![CDATA[<p>Simple story the likes of which happens all the time where an incorrect example together with my lack of knowledge led me to the world of hurt.</p>
<p>In the Falkon example QML extension in order to set some basic (top level) element the original author decided to use <code>Rectangle</code> component (or class? or object? or whatever, I will call it component). The Rectangle component is not supposed to be used this way since it is by default also setting the background to white and thus it is not styled by the KDE theme.</p>
<p>This led me to believe that the QML plugins in Falkon cannot be styled by the system theme (colors in KDE systemsettings) since the background was always white even when my theme was set to dark.</p>
<p>Than while stalking the <code>#kde-devel</code> IRC channel I saw that for QML (QtQuick) when used in my window manager setup I need to set an environment variable <code>QT_QUICK_CONTROLS_STYLE=org.kde.desktop</code> to follow KDE settings (maybe there is a way to set this automatically outside of KDE Plasma but I was not successful at that).</p>
<p>Back to original thought.</p>
<p>The <code>Rectangle</code> component is probably not supposed to be used to manage layouts and there has to be better suited component to do that.
So far I tried <code>Pane</code> which works exactly as I envisioned it to (it follows system colors set in kde system settings), maybe there is even better suited component than this which would help me even more but so far it is the best result I got from my QML journey.</p>
<p>So my conclusion is to use elements which are styled by Qt by default, but while I was lurking at <code>#kde-devel</code> IRC channel for even longer and asked more and more question I got an answer I half expected but did not like.</p>
<blockquote>
<p><strong>WARNING</strong> Next paragraph can be wrong and is recollection of how I remember it.</p>
</blockquote>
<p>The KDE team recommends using Kirigami or other framework to get the colors from system theme and set them manually. This allow them a great deal of flexibility and it is also used to utilize the additional colors configurable in KDE Plasma System Settings which are not part of general Qt. But for my purpose, I do not want to burden my little extensions with a KDE library just to get some system colors.</p>
<p>PS: This article was postponed for many months for no good reason.</p>
]]></content>
            
                 
                    
                 
                    
                         
                        
                            
                             
                                <category scheme="https://blog.sgorava.xyz/tags/falkon" term="falkon" label="Falkon" />
                             
                                <category scheme="https://blog.sgorava.xyz/tags/thoughts" term="thoughts" label="Thoughts" />
                             
                                <category scheme="https://blog.sgorava.xyz/tags/qml" term="qml" label="Qml" />
                            
                        
                    
                
            
        </entry>
    
        
        <entry>
            <title type="html"><![CDATA[Falkon: Development Update, Aug 2022]]></title>
            <link href="https://blog.sgorava.xyz/memory/2022/09/falkon-development-update-aug-2022/" rel="alternate" type="text/html" />
            
                <id>https://blog.sgorava.xyz/memory/2022/09/falkon-development-update-aug-2022/</id>
            
            
            <published>2022-09-04T00:00:00+00:00</published>
            <updated>2022-09-04T00:00:00+00:00</updated>
            
            
            <content type="html"><![CDATA[<p>Weird news from development of Falkon web browser.</p>
<h2 id="why">Why?</h2>
<p>Sadly, even after project moved under the wings of KDE it did not see many contributors (am I as major stalker at fault?), maybe new contributors did not want to go through hassle of creating KDE account (joining KDE). This is hard to say for me.</p>
<p>Anyway, I wanted to do something what is already outlined and what someone already tried in the past and thus there is a bit of information on how it should be done. That is how I came across &ldquo;Site Settings&rdquo; feature. This idea comes from a merge request on <a href="https://phabricator.kde.org/D12096">Phabricator</a> &ldquo;Added feature to remember the zoom set on a host&rdquo; by Anmol Gautam but was not accepted since it was a lot of code which only handles zoom while all data were still stored in the ini file which would make it slower and slower as time goes on.</p>
<p>In the <a href="https://phabricator.kde.org/D12096#245496">comment</a> David Rosca (The original developer of Falkon) proposed to move the backend to database and add to zoom other settings like javascript, images, html5 permissions etc. and we never saw any changes done after that. Yeah, that was like 4 years ago. I think it rested long enough so I started poking into it.</p>
<h2 id="at-first-thought">At first thought</h2>
<p>When it comes to designing and programming in Qt and C++ I can be considered a better novice and I make a lot of errors and rewrites, This is exactly one such case. While I could spend days and weeks trying to think of all possible cases and desing an interface and everything in most efficient and nice manner, I lack the experience to do so and instead of that I decided to jump into the water and start programming hoping the code and my thoughts will adjust itself over the time.</p>
<p>And that is how it is still ongoing. I create something thinking it is good enough only for it to be replaced by a new code a little after. Or I did not think of some possibilities or edge cases and designed something in a way that adding this functionality will be a total mess. But that is the only way how I think I can make this work since if I tried to spend weeks &ldquo;designing&rdquo; it, it would never be done (like never ever).</p>
<h2 id="the-main-goal">The main goal</h2>
<p>The aim is to add per site setting for some features to Falkon. There already is per site configuration of HTML5 permissions but this needs to be rewritten and integrated with the new SiteSetting manager. The rest of the features will be new to Falkon. The short list of features I would like to have in SiteSettings is:</p>
<ul>
<li>HTML5 permissions</li>
<li>Zoom level</li>
<li>Cookies</li>
<li>Javascript</li>
<li>Autoload Images</li>
<li>Other javascript options (Available in Privacy tab in Preferences)
<ul>
<li>Pop up windows</li>
<li>Clipboard access</li>
<li>Paste from clipboard</li>
<li>Activate windows</li>
</ul>
</li>
<li>And some more located in QtWebEnginePage::SiteOptions enum</li>
</ul>
<p>The list is pretty broad but all SiteOptions can be grouped together to one logic and I believe this can be done and this should simplify the development a little bit (maybe?).</p>
<p>The other part is to create Graphical User Interface for manipulating these settings. I want to have a default browser-wide settings and persite configuration which would override some parts of it when set to do so.</p>
<h2 id="the-current-progress">The current progress</h2>
<p>There are already some working parts of this big patch.</p>
<h3 id="html5-permissions">HTML5 permissions</h3>
<p>This became my first playgruond after getting some backend running, since I believe it is best to get some results quickly. I hooked the current code to SiteSettings and updated current HTML5 permissions dialog to be able to change default configuration. This was a first mock-up interface I did and it works, but it is not good enough so I will replace it with the one I used for SiteInfo window.</p>
<p>Next after I worked on backend a bit more I added a new &ldquo;Permissions&rdquo; tab to SiteInfo window with these permissions and created another mock-up interface which looks similar to the one from Firefox and I think I will stick with this one.</p>
<h3 id="qtwebengine-siteoptions">QtWebEngine SiteOptions</h3>
<p>There is a lot of options in the enum and quite few which I want to add to the SiteSettings system. I have a small example containing Javascript and AutoloadImages options. I also updated StatusBarIcons to work with SiteSettings (but I believe I did terrible job). Hey, the prototype works so I only need to build on top of it.</p>
<h3 id="cookies">Cookies</h3>
<p>I looked at the code of CookiesManager and it looks like the whitelist and blacklist is stored in a ini file and it should not be that hard to modify it to work with SiteSettings. (Or so I hope.)</p>
<h3 id="zoom-level">Zoom level</h3>
<p>This one I think is a bit tricky since it requires special handling and thinking on when to store the new zoom data and when not to and how to work with it. This is my next target fr addition.</p>
<p>##x User interface</p>
<p>As I mentioned before it is a huge work in progress and I hope it will turn out well, otherwise others will be stuck with my little monster which I am totally fine with.</p>
<h3 id="backend">Backend</h3>
<p>Because I did not spend a lot of time designing the whole thing I am rewriting and changing SiteSettingsManager class often, to the point that I worry a little bit since each addition of new feature means I need to rewrite or create something some methods and structures. What I need to do though is to have some method to get all permissions which needs to be set while age is loading so that all of them can be fetched at once and other to fetch all of them for SiteInfo GUI. Or maybe just one with everything? I want to avoid using raw SQL commands just to get some data when there should not be need for it, I have a small desire to hide the SQL backend when possible.</p>
<h2 id="conclusion">Conclusion</h2>
<p>I know you wanted to read something nice, but this is all you will get from me.</p>
<p>Any help is welcome and can speed up or improve the quality of this patch.</p>
<p>You can follow the progress of the development on KDE Invent where I created an <a href="https://invent.kde.org/network/falkon/-/issues/20">issue</a> and draft of a <a href="https://invent.kde.org/network/falkon/-/merge_requests/40">merge request</a>.</p>
]]></content>
            
                 
                    
                 
                    
                         
                        
                            
                             
                                <category scheme="https://blog.sgorava.xyz/tags/kde" term="kde" label="KDE" />
                             
                                <category scheme="https://blog.sgorava.xyz/tags/falkon" term="falkon" label="Falkon" />
                             
                                <category scheme="https://blog.sgorava.xyz/tags/report" term="report" label="Report" />
                            
                        
                    
                
            
        </entry>
    
        
        <entry>
            <title type="html"><![CDATA[Introducing a Falkon extension RSS Finder]]></title>
            <link href="https://blog.sgorava.xyz/memory/2022/01/introducing-a-falkon-extension-rss-finder/" rel="alternate" type="text/html" />
            
                <id>https://blog.sgorava.xyz/memory/2022/01/introducing-a-falkon-extension-rss-finder/</id>
            
            
            <published>2022-01-23T00:00:00+00:00</published>
            <updated>2022-01-23T00:00:00+00:00</updated>
            
            
            <content type="html"><![CDATA[<p>
This weekend I decided to semi automate the process of searching for RSS feeds on websites while using Falkon web browsers. Many websites provide RSS feeds but do not provide any visible link or icon to access them (eg. many Wordpress based sites) and I had to open the source code and search in that mess for xml feeds.</p>
<p>
These feeds are ussualy in HEAD html element but sometimes can appear anywhere on the website. I decided to only include the ones provided in HEAD since this is a standard way of informing browser that there are RSS feeds.</p>
<p>
Since I am aware of some characteristics of Falkon and the way how different plugin types work (written in C++, Python and QML) I decided to play with QML even when I do not like this language at all.</p>
<p>
My decision was based on these facts:</p>
<ul>
<li>There is no need for real time changes, only update when clicked on button.</li>
<li>To make it portable and working even when Python support is playing tricks on us.</li>
<li>To learn a little bit about QML development (for Falkon at least)</li>
</ul>
<p>There is one huge limitation which makes me not like QML support in general, and that is it ignores my Qt widget theme and in Falkon it is all shiny white. The KDE project manages to provide styled QML programs, so I guess there is something either my plugin or Falkon itself is missing. But since I wanted to make it portable and I will use it only once in a while it is good as it is.</p>
<p>
The extension can be found at Falkon <a href="https://store.falkon.org/p/1689113">store</a> and code at my <a href="https://git.sgorava.xyz/Falkon/RSSFinder">Gitea</a>.</p>
<p>
On the end note, this project can be used as an example how to run Javascript code on the webpage and retrieve some information from it while using QML. Well, it is not perfect.</p>
]]></content>
            
                 
                    
                 
                    
                         
                        
                            
                             
                                <category scheme="https://blog.sgorava.xyz/tags/programming" term="programming" label="programming" />
                             
                                <category scheme="https://blog.sgorava.xyz/tags/falkon" term="falkon" label="falkon" />
                             
                                <category scheme="https://blog.sgorava.xyz/tags/qml" term="qml" label="qml" />
                            
                        
                    
                
            
        </entry>
    
        
        <entry>
            <title type="html"><![CDATA[Introducing new Stats page]]></title>
            <link href="https://blog.sgorava.xyz/memory/2022/01/introducing-new-stats-page/" rel="alternate" type="text/html" />
            
                <id>https://blog.sgorava.xyz/memory/2022/01/introducing-new-stats-page/</id>
            
            
            <published>2022-01-02T00:00:00+00:00</published>
            <updated>2022-01-02T00:00:00+00:00</updated>
            
            
            <content type="html"><![CDATA[<p>
I like statisctics and numbers and I like looking at them, how they are changing and growing. Back when this blog was started I wanted to display some statistics on it but due to its very young age it would be meaningless.</p>
<p>
That changes now. This blog is around for over two years and it is time to put some nice numbers on it. At first I struggled about what to actualy count and how to do it within Hugo or if I should prepare the stats outside of it (bit of scripting can never hurt). In the end I managed to do it within Hugo and created somewhat usable template to display the data.</p>
<p>
The link to the <a href="/stats/">stats</a> page is located at the main menu and it shows some basic sumary at the top and few bar charts under it. Specificaly the charts shows details of posts per each year, month, week day and usage of tags.</p>
<p>
I know it is not that much and it is mostly there to masage my ego, but I made so that I have something to do since the times are as crazy as they are.</p>
<p>
That is all for now, I just wanted to brag about the numbers from my little blog.</p>
]]></content>
            
                 
                    
                 
                    
                         
                        
                            
                             
                                <category scheme="https://blog.sgorava.xyz/tags/blog" term="blog" label="Blog" />
                             
                                <category scheme="https://blog.sgorava.xyz/tags/hugo" term="hugo" label="Hugo" />
                            
                        
                    
                
            
        </entry>
    
        
        <entry>
            <title type="html"><![CDATA[PipeWire Media Session: Disable auto port switching on device connect]]></title>
            <link href="https://blog.sgorava.xyz/memory/2021/12/pipewire-media-session-disable-auto-port-switching-on-device-connect/" rel="alternate" type="text/html" />
            
                <id>https://blog.sgorava.xyz/memory/2021/12/pipewire-media-session-disable-auto-port-switching-on-device-connect/</id>
            
            
            <published>2021-12-27T00:00:00+00:00</published>
            <updated>2021-12-27T00:00:00+00:00</updated>
            
            
            <content type="html"><![CDATA[
<div id="outline-container-headline-1" class="outline-2">
<h2 id="headline-1">
Intro
</h2>
<div id="outline-text-headline-1" class="outline-text-2">
<p>
My 10 years old laptop has basically touch and look sensitive connectors, audio jack included. This means that the headphones plugged status is changed at random and with default settings in PulseAudio and PipeWire it will cause constant switching to speakers and I will be unable to enjoy my music (the soundcard is not great but the USB hub is also out of question since USB ports are also often touch sensitive).</p>
</div>
</div>
<div id="outline-container-headline-2" class="outline-2">
<h2 id="headline-2">
PulseAudio
</h2>
<div id="outline-text-headline-2" class="outline-text-2">
<p>
With PA there is a module <code>module-switch-on-port-available</code> in default.pa which can be commented to disable this functionality.</p>
<p>
The comment around this module is not perfect, but the module name speaks for itself and on top of that, it is easy to find help online.</p>
<pre class="example">
### Should be after module-*-restore but before module-*-detect
#load-module module-switch-on-port-available
</pre>
</div>
</div>
<div id="outline-container-headline-3" class="outline-2">
<h2 id="headline-3">
PipeWire
</h2>
<div id="outline-text-headline-3" class="outline-text-2">
<p>
With PipeWire the only thing I found is a mention in the <a href="https://gitlab.freedesktop.org/pipewire/pipewire/-/wikis/Migrate-PulseAudio#modules-1">Migration Guide</a> was the mention that this feature is manager by <code>Session manager</code>.</p>
<table>
<thead>
<tr>
<th>Name</th>
<th>Supported</th>
<th>Alternative</th>
<th>Notes</th>
</tr>
</thead>
<tbody>
<tr>
<td>module-switch-on-port-available</td>
<td>No</td>
<td>Yes</td>
<td>Session manager</td>
</tr>
</tbody>
</table>
<div id="outline-container-headline-4" class="outline-3">
<h3 id="headline-4">
Session manager
</h3>
<div id="outline-text-headline-4" class="outline-text-3">
<p>
From my quick investigation there are two available session managers:</p>
<ul>
<li>WirePlumber</li>
<li>Media Session</li>
</ul>
<div id="outline-container-headline-5" class="outline-4">
<h4 id="headline-5">
WirePlumber
</h4>
<div id="outline-text-headline-5" class="outline-text-4">
<p>
This is their newer and recommended implementation, I am not using this thing yet. Maybe I will write something here after I will be forced to switch to it.</p>
</div>
</div>
<div id="outline-container-headline-6" class="outline-4">
<h4 id="headline-6">
Media Session
</h4>
<div id="outline-text-headline-6" class="outline-text-4">
<p>
This is an example implementation and it looks to be very basic but does the job for me.</p>
<p>
To disable this unwanted behavior, edit <code>pipewire/media-session.d/media-session.conf</code>. This file is located at the install directory of PipeWire eg. </p>
<pre class="example">
/usr/share/pipewire/media-session.d/media-session.conf
</pre>
<p>
Read the header in this file to know where to copy it.</p>
<p>
Than search for <code>default-routes</code> and comment all occurences of it. (You are free to experiment, this is how I have done it after some trial and error debugging).</p>
<p>
The comment near this option in the default list also tells me nothing.</p>
<pre class="example">
#default-routes         # restore default route
</pre>
<p>
My resulting media-session.conf looks like this:</p>
<pre class="example">
# Media session config file for PipeWire version &#34;0.3.33&#34; #
#
# Copy and edit this file in /etc/pipewire/media-session.d/
# for systemwide changes or in
# ~/.config/pipewire/media-session.d/ for local changes.

context.properties = {
    # Properties to configure the session and some
    # modules.
    #mem.mlock-all = false
    #support.dbus  = true
    #log.level     = 2
    #alsa.seq.name  = Midi-Bridge
}

context.spa-libs = {
    # Mapping from factory name to library.
    api.bluez5.*    = bluez5/libspa-bluez5
    api.alsa.*      = alsa/libspa-alsa
    api.v4l2.*      = v4l2/libspa-v4l2
    api.libcamera.* = libcamera/libspa-libcamera
}

context.modules = [
    #{   name = &lt;module-name&gt;
    #    [ args = { &lt;key&gt; = &lt;value&gt; ... } ]
    #    [ flags = [ [ ifexists ] [ nofail ] ]
    #}
    #
    # Loads a module with the given parameters.
    # If ifexists is given, the module is ignored when it is not found.
    # If nofail is given, module initialization failures are ignored.
    #
    # Uses RTKit to boost the data thread priority.
    {   name = libpipewire-module-rtkit
        args = {
            #nice.level   = -11
            #rt.prio      = 88
            #rt.time.soft = 2000000
            #rt.time.hard = 2000000
        }
        flags = [ ifexists nofail ]
    }

    # The native communication protocol.
    {   name = libpipewire-module-protocol-native }

    # Allows creating nodes that run in the context of the
    # client. Is used by all clients that want to provide
    # data to PipeWire.
    {   name = libpipewire-module-client-node }

    # Allows creating devices that run in the context of the
    # client. Is used by the session manager.
    {   name = libpipewire-module-client-device }

    # Makes a factory for wrapping nodes in an adapter with a
    # converter and resampler.
    {   name = libpipewire-module-adapter }

    # Allows applications to create metadata objects. It creates
    # a factory for Metadata objects.
    {   name = libpipewire-module-metadata }

    # Provides factories to make session manager objects.
    {   name = libpipewire-module-session-manager }
]

session.modules = {
    # These are the modules that are enabled when a file with
    # the key name is found in the media-session.d config directory.
    # the default bundle is always enabled.

    default = [
        flatpak                 # manages flatpak access
        portal                  # manage portal permissions
        v4l2                    # video for linux udev detection
        #libcamera              # libcamera udev detection
        suspend-node            # suspend inactive nodes
        policy-node             # configure and link nodes
        #metadata               # export metadata API
        #default-nodes          # restore default nodes
        #default-profile        # restore default profiles
        #default-routes         # restore default route
        #streams-follow-default # move streams when default changes
        #alsa-seq               # alsa seq midi support
        #alsa-monitor           # alsa udev detection
        #bluez5                 # bluetooth support
        #bluez5-autoswitch      # automatic bluetooth HSP/HFP profile switch
        #restore-stream         # restore stream settings
        #logind                 # systemd-logind seat support
    ]
    with-audio = [
        metadata
        default-nodes
        default-profile
#        default-routes
        alsa-seq
        alsa-monitor
    ]
    with-alsa = [
        with-audio
    ]
    with-jack = [
        with-audio
    ]
    with-pulseaudio = [
        with-audio
        bluez5
        bluez5-autoswitch
        logind
        restore-stream
        streams-follow-default
    ]
}
</pre>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="outline-container-headline-7" class="outline-2">
<h2 id="headline-7">
Conclusion
</h2>
<div id="outline-text-headline-7" class="outline-text-2">
<p>
While I am still using deprecated / example session manager I somehow forced it to do what I want. This solution could also affect some other features of which I have no knowledge of. So proceed at you own risk.</p>
</div>
</div>
]]></content>
            
                 
                    
                 
                    
                         
                        
                            
                             
                                <category scheme="https://blog.sgorava.xyz/tags/thoughts" term="thoughts" label="Thoughts" />
                             
                                <category scheme="https://blog.sgorava.xyz/tags/linux" term="linux" label="Linux" />
                            
                        
                    
                
            
        </entry>
    
        
        <entry>
            <title type="html"><![CDATA[Search engines are obsolete]]></title>
            <link href="https://blog.sgorava.xyz/memory/2021/10/search-engines-are-obsolete/" rel="alternate" type="text/html" />
            
                <id>https://blog.sgorava.xyz/memory/2021/10/search-engines-are-obsolete/</id>
            
            
            <published>2021-10-13T00:00:00+00:00</published>
            <updated>2021-10-13T00:00:00+00:00</updated>
            
            
            <content type="html"><![CDATA[<p>
Shortly this post is inspired by a Lukes video when he rumbles about todays search engines.
<a href="https://odysee.com/@Luke:7/search-engines-are-totally-useless:c">https://odysee.com/@Luke:7/search-engines-are-totally-useless:c</a></p>
<p>
Most of the things I search on the web are related to the similar things over and over againg. So the results I get are almost always to the same handful of websites over and over again.</p>
<p>
Since my interest often lies in computers, programming and linux I truly get just handful of sites for my searches. A short example can be StachExchange, StackOverflow, language manuals or documentation, Archwiki pages and from time to time some other site (but this is very rare).</p>
<p>
So I should start thinking a bit more about the topic before I put my question to the general search engine and rather use the correct site or information source (like local documentation) instead of these general search engines.</p>
]]></content>
            
                 
                    
                 
                    
                         
                        
                            
                             
                                <category scheme="https://blog.sgorava.xyz/tags/thoughts" term="thoughts" label="Thoughts" />
                            
                        
                    
                
            
        </entry>
    
        
        <entry>
            <title type="html"><![CDATA[Now compatible with light web browsers]]></title>
            <link href="https://blog.sgorava.xyz/memory/2021/09/now-compatible-with-light-web-browsers/" rel="alternate" type="text/html" />
            
                <id>https://blog.sgorava.xyz/memory/2021/09/now-compatible-with-light-web-browsers/</id>
            
            
            <published>2021-09-18T00:00:00+00:00</published>
            <updated>2021-09-18T00:00:00+00:00</updated>
            
            
            <content type="html"><![CDATA[<p>After reading an article on <a href="https://drewdevault.com/2021/09/11/visurf-announcement.html">Drews blog about
visurf</a>
which is based on Netsurf and his encouragement to make more sites
compatible with this light browser I decided to take a look at my
little blog and found the horrible state it was in.</p>
<p>By looking at my blog from the perspective of the modern web it looked
minimal and nice, but on the inside the theme I decided to base my
blog on was using pretty modern styles a features which I had to get
rid of.</p>
<p>The first thing I noticed was that my color scheme was not respected
and I thought (mistakenly) that Netsurf is not being able to even
color the background. But in the closer look my styles were using at
some parts modern CSS3 (I guess) variables to set theme colors.<br>
Netsurf does not know such a thing for style. My solution was simple,
to move the color scheme style generation to the server side and thus
I rewritten it to use SASL which provides same features regarding my
use of variables as the previous modern solution.</p>
<p>AT this point I called it done and stopped working on it, since it
looked kind of usable. But who would have thought it would stay in my
head and thus I had gone on another journey of backward web
development.</p>
<p>The other big point was to get rid of modern CSS options and replace
them with older and supported ones and also while at it make it look
much nicer in w3m since it is nice terminal &ldquo;web browser&rdquo;. There was
only one feature used from modern CSS and that was <code>display: flex;</code>
and its other options which are unsupported but makes it really easy
to make webpage look nice with whatever elements. I somehow managed to
replace most of the flex elements part with either <code>float:  left/right;</code> and by NOT using <code>div</code> for everything but instead instead
using span or removing it and reworking the part to look the same. I
still kept the flex display option for the mobile view since it makes
it just so easier for me to make (otherwise I would not even bother
with mobile view, who is even using such evil devices to vie my blog
anyway?).</p>
<p>These changes make it look almost same in modern web browsers and
Netsurf also caught with them (round corners are not supported at the
moment). The bonus of reworking it and getting rid of many <code>div</code>s is
that menu and links, tags are now on the same line in w3m, while
before each link, tag was on its separate line. This makes it look
better in my eyes.</p>
<p>I also played with my <code>video</code> template and the alternative text is now
nicely formatted and it even displays the file size of the video.</p>
<p>All in all it is a change which only few will ever notice (since I
believe there is nobody apart from me who reads this blog.</p>
]]></content>
            
                 
                    
                 
                    
                         
                        
                            
                             
                                <category scheme="https://blog.sgorava.xyz/tags/blog" term="blog" label="Blog" />
                             
                                <category scheme="https://blog.sgorava.xyz/tags/web" term="web" label="Web" />
                             
                                <category scheme="https://blog.sgorava.xyz/tags/netsurf" term="netsurf" label="Netsurf" />
                             
                                <category scheme="https://blog.sgorava.xyz/tags/w3m" term="w3m" label="w3m" />
                            
                        
                    
                
            
        </entry>
    
        
        <entry>
            <title type="html"><![CDATA[Once again, I moved to ALSA]]></title>
            <link href="https://blog.sgorava.xyz/memory/2021/05/once-again-i-moved-to-alsa/" rel="alternate" type="text/html" />
            
                <id>https://blog.sgorava.xyz/memory/2021/05/once-again-i-moved-to-alsa/</id>
            
            
            <published>2021-05-10T00:00:00+00:00</published>
            <updated>2021-05-10T00:00:00+00:00</updated>
            
            
            <content type="html"><![CDATA[<p>When I got a new computer a while ago I installed PulseAudio (PA) on
it since I wanted to comfortably use USB headset and switching between
it and my system soundcard. PA worked somehow fine but there where
some problems with my favourite music player (Music On Console) but it
could be to some degree mitigated with a patch.</p>
<p>Later Archlinux pushed PipeWire as hard dependency of few packages I
had installed (namely kwin and PulseEffects). I can remove kwin safely
since I do not use KDE/Plasma and had it for testing and as a backup,
but it is really a pity that PulseEffects would be gone since it is
great program to play with audio effects on the fly. So switching back
to pulse would get rid me of these nice programs (unless I hack the
packages which is another work, so why to bother?). The other huge
issue with PipeWire is that it has some problems with playing audio.<br>
When I start playing (or seek) some video it plays noise for a while
until it catches up with something which is pain since PipeWire was
advertised to me as a drop-in replacement for PA but it sucks even
more.</p>
<p>So I decide to get rid of all that mess and use only ALSA. The basic
switch was easy and almost none configuration was required. But I
encountered 2 problems about which I wish to write about.</p>
<p>PulseAudio allows in its mixer to disable system sound which works
nicely but ALSA does not have such feature (as long as I am aware of)
and I have to disable sound effects for everything manually. In
graphical session I use mostly Qt based programs and there was an
annoying sound effect played whenever some pop-up window showed up. I
searched hard and I was unable to find a solution on the internet and
I found that Qt itself does not contain these audio effects and that
they are part of some theme (or style), in my case it was part of
Oxygen (maybe my configuration is somehow set up to use oxygen and I
am not aware of that). After removing Oxygen from my system the sound
effects are gone and silence returned.</p>
<p>All this I found after going almost mad and catching straws on the
internet. My last straw which allowed me to fix this problem was that
it should load &ldquo;*.ogg&rdquo; file so I started searching for such files and
after few tries it bore fruits.</p>
<p>The search command I used is:</p>
<pre tabindex="0"><code>find /usr -iname &#34;*\.ogg&#34;
</code></pre><p>Second thing was default audio support in Wine which can be easily
solved by running winetricks for given wine prefix.</p>
<pre tabindex="0"><code>winetricks settings sound=alsa
</code></pre>]]></content>
            
                 
                    
                 
                    
                         
                        
                            
                             
                                <category scheme="https://blog.sgorava.xyz/tags/linux" term="linux" label="Linux" />
                             
                                <category scheme="https://blog.sgorava.xyz/tags/thoughts" term="thoughts" label="Thoughts" />
                            
                        
                    
                
            
        </entry>
    
        
        <entry>
            <title type="html"><![CDATA[My view on systemd]]></title>
            <link href="https://blog.sgorava.xyz/memory/2021/04/my-view-on-systemd/" rel="alternate" type="text/html" />
            
                <id>https://blog.sgorava.xyz/memory/2021/04/my-view-on-systemd/</id>
            
            
            <published>2021-04-11T00:00:00+00:00</published>
            <updated>2021-04-11T00:00:00+00:00</updated>
            
            
            <content type="html"><![CDATA[<p>In mt opinion systemd is a huge pain.</p>
<p>SystemD in my eyes is a tool developed by corporation (RedHat) for
other corporations (their customers). RedHat guys (and other kinds)
have many things (tools, configs, manuals, trainings, webinars&hellip;)
prepared for it and thus it would be pain for them to stop using it.</p>
<p>Other corporations like it because it has support from other
corporation which they can call when there is a problem and it is
mostly one package which contains almost all basic stuff they will
need. I see this as major selling point for it since huge corporations
do not wish to play with small things, for them it is better to spend
more money and buy something. In other words, it can give a lot of
people work and thus a good livelihood.</p>
<p>Now when I look at it from the point of normal user like myself I do
not see those benefits which might come into account if I was a huge
corporation. All I see is a needlessly overcomplicated huge mess given
(forced on) to me for testing purpose, so that the major bugs can be
solved before it is used by huge corporations.</p>
<p>Next I see it as perfect example of EEE strategy (Embrace - Extend -
Extinguish).<br>
<a href="https://systemd-free.artixlinux.org/img/systemd-devours-all.gif">https://systemd-free.artixlinux.org/img/systemd-devours-all.gif</a></p>
<p>I dare to say we are at Extinguish phase since other projects which
were providing similar functionality (see image above) to some parts
of systemd are simple gone (or part of systemd now).</p>
<p>I also see it as a &ldquo;killer&rdquo; of a bit chaotic environment in Linux/open
source world. I like the chaotic (modern word would be diverse)
environment of Linux open-source world while systemd tries to bring
some uniformity into this &ldquo;chaos&rdquo;.</p>
<p>PS: If you think systemd is just an init you are not thinking hard
enough. Systemd is (as mentioned in some presentation about systemd I
watched somewhere a long time ago) a system between kernel and user
programs. (lets think of it in similar way Apple is doing things, you
do not directly contact kernel or HW, you use their libraries to do
the job you want).</p>
<p>PS2: Maybe the bar is too high up and thus people expect for
everything to work in same way without any effort.</p>
<p>Enough of my rumbling.</p>
<p>Have a nice day.</p>
<p>This post is a bit refined version of my rumbling on Artix forum:
<a href="https://forum.artixlinux.org/index.php/topic,1939.msg16354.html#msg16354">https://forum.artixlinux.org/index.php/topic,1939.msg16354.html#msg16354</a></p>
<p>PS3: While polishing this post I wanted to write a bit more but it
looks like the stars are not in my favour to do that.</p>
]]></content>
            
                 
                    
                 
                    
                         
                        
                            
                             
                                <category scheme="https://blog.sgorava.xyz/tags/thoughts" term="thoughts" label="Thoughts" />
                             
                                <category scheme="https://blog.sgorava.xyz/tags/linux" term="linux" label="Linux" />
                            
                        
                    
                
            
        </entry>
    
        
        <entry>
            <title type="html"><![CDATA[RTFM - How to split audio wave file]]></title>
            <link href="https://blog.sgorava.xyz/memory/2021/01/rtfm-how-to-split-audio-wave-file/" rel="alternate" type="text/html" />
            
                <id>https://blog.sgorava.xyz/memory/2021/01/rtfm-how-to-split-audio-wave-file/</id>
            
            
            <published>2021-01-06T00:00:00+00:00</published>
            <updated>2021-01-07T00:00:00+00:00</updated>
            
            
            <content type="html"><![CDATA[<p>Few years ago (4 or 5 I think) when I was downloading music in a hope
of a higher quality the content was delivered in a 3 files, flac, cue
and log. The flac file contains whole CD or album, cue is to describe
where/when each song starts, ends, its name and author etc and log is
a log from the program which made it.</p>
<p>This is all nice and great if you are using some more complicated
music player with library function which can create index of the songs
contained in such files and play them accordingly from its UI. But as
a believer that GUI is bloated I am using Music on Console player
which does not have this function and is strictly reading files (so I
think). So I needed to split this huge file and extract each song with
correct tags.</p>
<p>So I searched internet and even written a script to automate this (a
monster to say). I was too lazy and did not check manual at all just
copy pasted commands from different places and glued it together. To a
script which first created WAV files and than converted it to FLAC
with tags. This conversion took a long time while my machine was under
a huge load, truly a waste. But I was happy that it works.</p>
<p>Now a smarter me read a manual and found out that the utility which is
used to split the wave (flac) file <code>shntool</code> has an option to
configure the output format which works flawlessly and is very fast.
It does not include tags though, and as I am writing this channel I
found a very good article on <a href="https://wiki.archlinux.org/index.php/CUE_Splitting">Arch Wiki</a> which
describes exactly what I wish to do.</p>
<p>So instead of boasting how good I am at scripting and messing around
as I originally intended I ended up learning to revise my old scripts
after reading the manual and reading wiki. What a night.</p>
<p>EDIT: After being happy for a while I ran into a wall which consist of
shntool being unable to process big files. So I did another bit of
research and found utility <code>unflac</code> which is able to do the job a bit
better. The code can be found <a href="https://git.sr.ht/~ft/unflac">here</a>.</p>
]]></content>
            
                 
                    
                 
                    
                         
                        
                            
                             
                                <category scheme="https://blog.sgorava.xyz/tags/thoughts" term="thoughts" label="Thoughts" />
                             
                                <category scheme="https://blog.sgorava.xyz/tags/linux" term="linux" label="Linux" />
                            
                        
                    
                
            
        </entry>
    
        
        <entry>
            <title type="html"><![CDATA[Switching to Hugo]]></title>
            <link href="https://blog.sgorava.xyz/memory/2021/01/switching-to-hugo/" rel="alternate" type="text/html" />
            
                <id>https://blog.sgorava.xyz/memory/2021/01/switching-to-hugo/</id>
            
            
            <published>2021-01-05T00:00:00+00:00</published>
            <updated>2021-01-05T00:00:00+00:00</updated>
            
            
            <content type="html"><![CDATA[<p>Until &ldquo;now&rdquo; I was happy user of Jekyll static site generator,
everything worked fine with it and blog was easy to manage. The major
drawback of Jekyll (for me that is) is that it is written in Ruby and
I never before worked with Ruby. Because of this I diceded to go the
&ldquo;easy&rdquo; route and use docker image to simplify the initial installation
and Jekyll management.</p>
<p>The official docker image works fine, the only thing I needed to do
was to add ruby gem local cache so it would not need to download all
that mess over and over again (what a hell that is). This setup worked
fine until for some reason docker started crashing from time to time.<br>
It somehow was always down after some time when I wanted to create
some post. And since this is the only thing using docker on my VPS I
decided to throw it away and once again jump into the rabbit hole of
internet to find a good solution to replace it (I am too lazy to craft
one from the ground up).</p>
<p>I did a bit of searching here and there and I also had some memories
from the time I was first setting my blog and I decided to go with
Hugo. Hugo is written in go and which I am not a big fan (dependencies
listed as urls scares me) but for me as end user it is great since the
thing I need to use/get is only one binary. No need for docker and for
gem (libraries) cache.</p>
<p>During my research of Hugo I discovered that themes and templates are
done in a bit different way than in Jekyll so if I wanted to keep my
theme from Jekyll I would need to rewrite it on my own (which is pain)
so I decided to dive into another rabbit hole of design and search for
the &ldquo;good&rdquo; theme. Lucky me I found one good looking (to me that is)
called <a href="https://themes.gohugo.io/hugo-dusk/">Hugo Dusk</a> which I took and modified to suit my
weird taste and needs. I think it looks even better than the previous
one.</p>
<p>With Jekyll I was using few include templates to make writing posts
easier like inputing images and videos. Luckily Hugo provides similar
functionality with its &ldquo;shortcodes&rdquo; which already contains one for
images (figure) but lacked one for video (I do not count youtube and
vimeo) so I crafted one by myself and everything works just fine.</p>
<p>Here and there I still play with design a bit, adjusting details might
take a while.</p>
<p>To sum it up, I got rid of docker and ruby. I added Hugo and changed
the theme of my blog (it was a good opportunity to do so). Overall it
was a good move, I still have a lot to learn with Hugo to make a
better use of it and for now I am fully satisfied with it.</p>
<p>That is all, you can find the source codes at the <a href="https://git.sgorava.xyz/Websites/blog.sgorava.xyz">website
repository</a></p>
]]></content>
            
                 
                    
                 
                    
                         
                        
                            
                             
                                <category scheme="https://blog.sgorava.xyz/tags/thoughts" term="thoughts" label="Thoughts" />
                             
                                <category scheme="https://blog.sgorava.xyz/tags/blog" term="blog" label="Blog" />
                             
                                <category scheme="https://blog.sgorava.xyz/tags/jekyll" term="jekyll" label="Jekyll" />
                             
                                <category scheme="https://blog.sgorava.xyz/tags/hugo" term="hugo" label="Hugo" />
                            
                        
                    
                
            
        </entry>
    
        
        <entry>
            <title type="html"><![CDATA[Estimate installed size of pacman repository]]></title>
            <link href="https://blog.sgorava.xyz/memory/2021/01/estimate-installed-size-of-pacman-repository/" rel="alternate" type="text/html" />
            
                <id>https://blog.sgorava.xyz/memory/2021/01/estimate-installed-size-of-pacman-repository/</id>
            
            
            <published>2021-01-04T00:00:00+00:00</published>
            <updated>2021-01-04T00:00:00+00:00</updated>
            
            
            <content type="html"><![CDATA[<p>Some time ago on #artix IRC channel popped up a question on how to get
the installed size of all packages in given repository and I together
with other people on the channel created a one liner in shell to do
exactly that.</p>
<p>But before I have to mention that Pacman prints the &ldquo;Installed size&rdquo;
value when we try to install packages. So one way is to try to install
all packages but this can also include dependencies and may require
some pacman magic which I am not aware of. I forgot to mention, this
method may require root access or sudo privileges which is not good
enough for me.</p>
<p>There was also one more brute-force idea which consisted of
downloading of all packages and checking their uncompressed sizes and
counting this value somehow.This is way too brutal.</p>
<p>The basic idea behind this script is based on the fact that pacman
prints the installed size value when we run <code>pacman -Si &quot;package&quot;</code>and
as such it can be automated with bit of skill and luck.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#000;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-shell" data-lang="shell"><span style="display:flex;"><span>$ pacman -Si pacman
</span></span><span style="display:flex;"><span>Repository      : system
</span></span><span style="display:flex;"><span>Name            : pacman
</span></span><span style="display:flex;"><span>Version         : 5.2.2-1
</span></span><span style="display:flex;"><span>Description     : A library-based package manager with dependency support
</span></span><span style="display:flex;"><span>Architecture    : x86_64
</span></span><span style="display:flex;"><span>URL             : https://www.archlinux.org/pacman/
</span></span><span style="display:flex;"><span>Licenses        : GPL
</span></span><span style="display:flex;"><span>Groups          : base-devel
</span></span><span style="display:flex;"><span>Provides        : libalpm.so=12-64
</span></span><span style="display:flex;"><span>Depends On      : bash  glibc  libarchive  curl  gpgme  artix-mirrorlist  artix-keyring  archlinux-mirrorlist  archlinux-keyring
</span></span><span style="display:flex;"><span>Optional Deps   : perl-locale-gettext: translation support in makepkg-template
</span></span><span style="display:flex;"><span>Conflicts With  : None
</span></span><span style="display:flex;"><span>Replaces        : None
</span></span><span style="display:flex;"><span>Download Size   : 838,79 KiB
</span></span><span style="display:flex;"><span>Installed Size  : 4538,70 KiB
</span></span><span style="display:flex;"><span>Packager        : Artix Build Bot &lt;jenkins@artixlinux.org&gt;
</span></span><span style="display:flex;"><span>Build Date      : Št  2. júl 2020, 00:28:07
</span></span><span style="display:flex;"><span>Validated By    : MD5 Sum  SHA-256 Sum  Signature</span></span></code></pre></div>
<p>So all we need to do is get this information out of this output. This
can be done with few commands or some smart awk or whatever you are
good at using. The tricky part is to get the actual size because it
has different prefixes we need a bit smarter tool to count formatted
sizes like <code>numfmt</code> (this tool is truly great and I am happy it was
recommended to me after I use awk script which I stole from something
else) or some smart awk.</p>
<p>After adding a bit of counting magic and formating the result into
human readable format I thought &ldquo;I am done&rdquo; (how foolish of me).<br>
During the creation of this script I did not realize i was working
with my local locale and thus the number formatting was totally messed
up and I reflected this mess with few sed replacements in the script
which made a mess when run in universal locale <code>LC_ALL=C</code>.</p>
<p>Well, I do not wish to write about every little change which I made
and everything which was done, if you wish for a bit more detail you
can only regret since you probably do not have logs from that channel.</p>
<p>So here is the final script, which is a bit of shell magic and I know
that it can be improved, but it is good enough to run it from time to
time and just for fun.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#000;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>$ export <span style="color:#eedd82">LC_ALL</span>=C &amp;&amp; pacman -Sl system | cut -d<span style="color:#87ceeb">&#34; &#34;</span> -f2 | xargs pacman -Si | grep -i <span style="color:#87ceeb">&#34;installed size&#34;</span> | cut -d: -f2 | sed <span style="color:#87ceeb">&#34;s/\s//;s/ //;s/B//;s/i//&#34;</span> | numfmt --from=iec | paste -sd+ - | bc | numfmt --to=iec-i -- &amp;&amp; export <span style="color:#eedd82">LC_ALL</span>=</span></span></code></pre></div>
<p>Example output:
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#000;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>2.9Gi</span></span></code></pre></div></p>
<p>This script as it is written here will show the installed size of all
packages in Artix system repository. It can be adapted to show some
other package group or repository.</p>
<p>The result is nice and it works just fine, for me that is. As a bonus
I learnt some nice utilities a way to use them, for me this was a win.</p>
<p>That is enough of my rumbling.</p>
]]></content>
            
                 
                    
                 
                    
                         
                        
                            
                             
                                <category scheme="https://blog.sgorava.xyz/tags/thoughts" term="thoughts" label="Thoughts" />
                             
                                <category scheme="https://blog.sgorava.xyz/tags/artix" term="artix" label="Artix" />
                             
                                <category scheme="https://blog.sgorava.xyz/tags/linux" term="linux" label="Linux" />
                            
                        
                    
                
            
        </entry>
    
        
        <entry>
            <title type="html"><![CDATA[Changes on this blog]]></title>
            <link href="https://blog.sgorava.xyz/memory/2020/12/changes-on-this-blog/" rel="alternate" type="text/html" />
            
                <id>https://blog.sgorava.xyz/memory/2020/12/changes-on-this-blog/</id>
            
            
            <published>2020-12-13T00:00:00+00:00</published>
            <updated>2020-12-13T00:00:00+00:00</updated>
            
            
            <content type="html"><![CDATA[<p>After a while I am writing about changes on this blog. The major
changes in short are:</p>
<ul>
<li>New domain name.</li>
<li>Self-hosted on VPS which is powered by <a href="https://artixlinux.org/">Artix</a>.</li>
<li>Own git server powered by <a href="https://git.sgorava.xyz/">Gitea</a>.</li>
<li><a href="https://git.sr.ht/~sircmpwn/openring">Openring</a> integration which provides links to articles
from blogs I follow.</li>
</ul>
<p>For the future I plan some things, but the current setup is working
fine so I have no idea when it will be done. The things I plan to do
in the future are:</p>
<ul>
<li>Move to different static site generator</li>
<li>Change the html template to something of my own creation</li>
<li>Prepare some nice landing page at my top level domain, which is for
now empty</li>
<li>And probably many more but I will be glad to make even one of these
work.</li>
</ul>
]]></content>
            
                 
                    
                 
                    
                         
                        
                            
                             
                                <category scheme="https://blog.sgorava.xyz/tags/thoughts" term="thoughts" label="Thoughts" />
                             
                                <category scheme="https://blog.sgorava.xyz/tags/blog" term="blog" label="Blog" />
                             
                                <category scheme="https://blog.sgorava.xyz/tags/report" term="report" label="Report" />
                            
                        
                    
                
            
        </entry>
    
        
        <entry>
            <title type="html"><![CDATA[Protecting my sleep]]></title>
            <link href="https://blog.sgorava.xyz/memory/2020/12/protecting-my-sleep/" rel="alternate" type="text/html" />
            
                <id>https://blog.sgorava.xyz/memory/2020/12/protecting-my-sleep/</id>
            
            
            <published>2020-12-08T00:00:00+00:00</published>
            <updated>2020-12-08T00:00:00+00:00</updated>
            
            
            <content type="html"><![CDATA[<p>My another attempt to break the habit of being up until very late into
the night and as such very tired the next day.</p>
<p>For years I thought of configuring my computer to suspend at around
night time so I will be somehow forced to go to sleep. Well, the main
problem with this was that I only thought about it and never actually
did any research on this subject.</p>
<p>At normal times under my normal user I suspend my machine with elogind
loginctl command and this works fine but there might be a problem with
sessions and stuff around that which I refuse to work with. So I
searched a bit and found out that there is nice system API to manage
power state.</p>
<p>The system/kernel API consist of a file located at <code>/sys/power/state</code>.<br>
When I try to print the content of this file it shows the currently
available states (or values it accepts) which is my case are:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#000;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-zsh" data-lang="zsh"><span style="display:flex;"><span>$ cat /sys/power/state
</span></span><span style="display:flex;"><span>freeze mem disk
</span></span></code></pre></div><p>And when I looked at the printed values I saw <code>mem</code> option which is
probably what I want (I was lazy and did not look at any docs) to
suspend my machine into RAM. The power state can be changed by writing
desired state into <code>/sys/power/state</code> file.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#000;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-zsh" data-lang="zsh"><span style="display:flex;"><span>$ echo <span style="color:#87ceeb">&#34;mem&#34;</span> &gt; /sys/power/state
</span></span></code></pre></div><p>Sure, you need to be root to do so, but so what? This is my machine
and I can. Since I figured this out I put it into a file, set it
executable and configured cron to start it at 23:00 from Sunday to
Thursday like this.</p>
<pre tabindex="0"><code>0 23 * * 0-4 root /usr/scripts/suspend
</code></pre><p>And done, now I hope it can help me get my desired rest.</p>
]]></content>
            
                 
                    
                 
                    
                         
                        
                            
                             
                                <category scheme="https://blog.sgorava.xyz/tags/thoughts" term="thoughts" label="Thoughts" />
                             
                                <category scheme="https://blog.sgorava.xyz/tags/linux" term="linux" label="Linux" />
                            
                        
                    
                
            
        </entry>
    
        
        <entry>
            <title type="html"><![CDATA[Usage of kateschema converter]]></title>
            <link href="https://blog.sgorava.xyz/memory/2020/09/usage-of-kateschema-converter/" rel="alternate" type="text/html" />
            
                <id>https://blog.sgorava.xyz/memory/2020/09/usage-of-kateschema-converter/</id>
            
            
            <published>2020-09-22T00:00:00+00:00</published>
            <updated>2020-09-22T00:00:00+00:00</updated>
            
            
            <content type="html"><![CDATA[<p>Last weekend I went nuts and wrote a script to convert my old theme
for Kate/KDevelop, I truly almost <a href="/memory/2020/09/my-thoughts-on-kateschema-to-theme-converter/">lost</a>
it.</p>
<p>The script as I made it only works with files exported by the GUI,
when you export whole scheme and save it somewhere. I don&rsquo;t think it
will work with only data for one file type (it can be easily modified
to do so). So, if you try to use your full kateschema/highlighting
file which stores multiple themes at once the script can &ldquo;export&rdquo; a
random mix (I wonder how usable that would be, maybe we can get some
funny results).</p>
<p>The interface/command line options part of the script was done at the
last moment when it was actually working (for me that is) and I was
deadly tired. Before you start open the script in some text editor and
look at the top for &ldquo;settings&rdquo; dictionary and its values, which I
tried to briefly explain there. There are two configuration options
available:</p>
<ol>
<li>prefferStandAloneData</li>
<li>IncludeCustoms</li>
</ol>
<p><code>prefferStandAloneData</code> forces script to use settings stored for that
data type. The reasoning for this option is simple, in old file format
you could specify color/style settings for one data type differently
based on current file type. In other words your CSS file content could
be styled in different way when opened standalone in editor, different
when viewed in HTML (inside &lt;style&gt;&lt;/style&gt;), different in
PHP and so on. This is one of the reason for moving to theme files,
but it is pain to convert. SO select what you wish or design a better
solution. A sad thing is that you will not see the generated values as
defaults, but I can live with that.</p>
<p><code>IncludeCustoms</code> allows script to attempt (I am only aware of one
tester which is me) to convert the style for all data types/syntax
highlighting settings available. When set to <code>False</code> it will generate
simple theme file without any custom things, it is nice base to start
adapting your current theme which you spent years using.</p>
<p>And start the program:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#000;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-shell" data-lang="shell"><span style="display:flex;"><span>script.py ThemeName mytheme.kateschema
</span></span></code></pre></div><p>The script requires 2 arguments.</p>
<ol>
<li>ThemeName - specify how you wish to name the theme, it is so far
only used for metadata</li>
<li>kateschema file - path to your exported kateschema file.</li>
</ol>
<p>The results will be printed to stdout. I was too tired and this was
the simplest way I could think of. You can always redirect the output
to the file with your shell:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#000;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-shell" data-lang="shell"><span style="display:flex;"><span>script.py ThemeName mytheme.kateschema &gt; new.theme
</span></span></code></pre></div><p>And in the end, import the theme to Kate/KDevelop and enjoy.</p>
<p>For brave one here are my suggestions on improvements.</p>
<ul>
<li>The theme name could be used to select right highlighting setting
from global kateschema file, probably by just adding check if string
ends with the name. The INI file section for highlighting are names
as &ldquo;Highlighting language - Schema MySchemaName&rdquo; and such I think
this.</li>
<li>Some user interface could be made to select theme to export from
global file (in my thoughts this is done when you export it from
Kate/KDevelop directly). It can be useful in the future</li>
<li>There re probably many checks which I did not do in the code. It is
probably not possible to convert files for single data
type/language.</li>
</ul>
<p>In short:</p>
<ol>
<li>Export your theme</li>
<li>Open script in text editor and adjust <code>settings</code> to your needs</li>
<li>Run the script and save the output. (the result is printed to
stdout)</li>
<li>Import theme to Kate/KDevelop</li>
<li>Use the script as an example and create even better one.</li>
</ol>
<p>And I almost forgot, the script can be either found at my
<a href="https://git.sgorava.xyz/Miscellaneous/kscheme-converter">repository</a>
or in KDE Syntax Highlighting
<a href="https://invent.kde.org/frameworks/syntax-highlighting/-/blob/master/data/generators/kateschema_to_theme_converter.py">repository</a>.</p>
]]></content>
            
                 
                    
                 
                    
                         
                        
                            
                             
                                <category scheme="https://blog.sgorava.xyz/tags/kde" term="kde" label="KDE" />
                            
                        
                    
                
            
        </entry>
    
        
        <entry>
            <title type="html"><![CDATA[My thoughts on kateschema to theme converter]]></title>
            <link href="https://blog.sgorava.xyz/memory/2020/09/my-thoughts-on-kateschema-to-theme-converter/" rel="alternate" type="text/html" />
            
                <id>https://blog.sgorava.xyz/memory/2020/09/my-thoughts-on-kateschema-to-theme-converter/</id>
            
            
            <published>2020-09-21T00:00:00+00:00</published>
            <updated>2020-09-21T00:00:00+00:00</updated>
            
            
            <content type="html"><![CDATA[<p>Or how I spent a weekend.</p>
<p>With the latest changes in ksyntaxhighlighting library the old themes
(they are called &ldquo;kateschema&rdquo;) will become obsolete and one will have
to either use some new theme and hope it will fit or try to adapt the
old one and spent hours doing so.</p>
<p>The old format is a bit complicated, the settings for one language can
vary depending on the current file type. In other words you could have
different settings if you opened CSS file directly or when styles were
used in HTML. This looks like a nice feature to have which allowed
users to tweak everything but also added a huge overhead when doing
changes to the theme. So one has to decide how to export these
changes, I decided to take 2 approaches:</p>
<ul>
<li>First come first serve - whatever setting is read first for given
data type, that is used</li>
<li>main type rules - In other words it would prefer settings stored for
that standalone data type and will overwrite any previously read
ones</li>
</ul>
<p>Another huge drawback while writing this script was lack of
documentation which forced me to go through the source code to find
answers to my questions, which took a lot of time and energy. A huge
part of the script is comprised of dictionaries which are used to
convert old settings to new one.</p>
<p>I also got a bit of help from the developer <a href="https://invent.kde.org/cullmann">Christoph
Cullmann</a> on
<a href="https://www.reddit.com/r/kde/comments/ivddbn/submit_a_ksyntaxhighlighting_color_theme_improve/">reddit</a>.<br>
There you can see how big spammer I actually can be, at least I
managed to somehow finish it.</p>
<p>In the end I managed to convert my theme with some drawback compared
to old solution. In new version you cant define default style for
something by using the theme. These defaults are set by syntax
highlighting definitions. So the &ldquo;default&rdquo; values are almost always
not met and will restore setting to some theme keyword defined in
syntax file (well, nothing to do here from my side).</p>
<p>The script was than pushed to the
<a href="https://invent.kde.org/frameworks/syntax-highlighting/-/blob/master/data/generators/kateschema_to_theme_converter.py">frameworks/syntax-highlighting</a>
repository.</p>
<p>I was too tired to do some proper user interface and such it is very
crude. In general you need to supply 2 arguments:</p>
<ol>
<li>Theme name</li>
<li>kateschema file</li>
</ol>
<p>And the results will be printed to the stdout, it is up to user to
save it into the file or whatever.</p>
<p>In the end, the script did the job for me and I can have same colors
(for time being until I fix or change the theme) as I have on old one.<br>
I use it to convert exported theme with all the mess around (16k
lines) and I got a nice theme as a result together with messy custom
styles. But there is nothing to do with that, I did not wish to lay
with theme for hours to make it looks nice again.</p>
<p>So these are my messy thoughts about this script, it works but it is
not perfect. It can be used as an example for your own (hope better)
creation.</p>
]]></content>
            
                 
                    
                 
                    
                         
                        
                            
                             
                                <category scheme="https://blog.sgorava.xyz/tags/kde" term="kde" label="KDE" />
                             
                                <category scheme="https://blog.sgorava.xyz/tags/thoughts" term="thoughts" label="Thoughts" />
                            
                        
                    
                
            
        </entry>
    
        
        <entry>
            <title type="html"><![CDATA[My experience with taskwarrior]]></title>
            <link href="https://blog.sgorava.xyz/memory/2020/08/my-experience-with-taskwarrior/" rel="alternate" type="text/html" />
            
                <id>https://blog.sgorava.xyz/memory/2020/08/my-experience-with-taskwarrior/</id>
            
            
            <published>2020-08-12T00:00:00+00:00</published>
            <updated>2020-08-12T00:00:00+00:00</updated>
            
            
            <content type="html"><![CDATA[<h2 id="introduction">Introduction</h2>
<p>After a month at new work I realized I need a good way to manage my tasks and
things todo lists. Managing things manually is not exactly what I wanted to do
and even through the main operating system at work is M$ Windows I decided to
try my luck and compile taskwarrior within Cygwin which is luckily present.</p>
<p>After going through a bit of problems due to my lack of knowledge of how to do
things under M$ Windows and to top it of I also added timewarrior. My primary
reason for adding timewarrior is because I like graphs. Seeing colorred graphs
representing my work is the best way how to end the month.</p>
<h2 id="my-workflow">My workflow</h2>
<p>I tried to use taskwarrior for personal tasks multiple times in the past but I
did not managed to stick with it. Now as I started to use it at work I see the
true potential and flexibility of this program.</p>
<p>At first I simply put in the main (read huge) task which should be completed
and as I progressed I put annotations to it and created some small tasks around
to help me switch focus a bit. The downfall of this strategy is that I ended up
having this one task in my task list for a long time and as I progressed the
number of annotations also increased and it was a mess.</p>
<p>It was a bit later as I again went through taskwarrior website and read the
&ldquo;Best practice&rdquo; recommendations and realized how stupid I was. Now I create
small tasks which can be cmpleted in a short period of time. I assign them to
project according to my main task and add some tags to represent nature of what
it is.</p>
<p>I am also slowly learning how to use other commands to manage &ldquo;time&rdquo; with
taskwarrior like wait, until, some reccuring things and so on (go read manual).</p>
<h2 id="final-thought">Final thought</h2>
<p>I am truly amazed that such a flexible program was laying in my computer
for years unused.</p>
<h2 id="bonus">Bonus</h2>
<p>I truly love how timewarrior can be set to automatically exclude certain time
ranges so I do not need to even move a finger to get a nice looking graphs and
summary from it.</p>
]]></content>
            
                 
                    
                 
                    
                         
                        
                            
                             
                                <category scheme="https://blog.sgorava.xyz/tags/thoughts" term="thoughts" label="Thoughts" />
                            
                        
                    
                
            
        </entry>
    
        
        <entry>
            <title type="html"><![CDATA[My experience cloning Windows 10]]></title>
            <link href="https://blog.sgorava.xyz/memory/2020/08/my-experience-cloning-windows-10/" rel="alternate" type="text/html" />
            
                <id>https://blog.sgorava.xyz/memory/2020/08/my-experience-cloning-windows-10/</id>
            
            
            <published>2020-08-10T00:00:00+00:00</published>
            <updated>2020-08-10T00:00:00+00:00</updated>
            
            
            <content type="html"><![CDATA[<h1 id="introduction">Introduction</h1>
<p>I bought an SSD to replace classic slow HDD on home M$ Windows 10 machine. This
SSD is a smaller than the original HDD (250 GB vs 500 GB) so I could not clone
whole disk which I hope would be easier (anyway I will probably never know).</p>
<h1 id="initial-research">Initial research</h1>
<p>Before I started I decided to check internet (DuckDuckGo) and asked how to
migrate M$ Windows 10 from HDD to SSD. Sadly all I got and wasted time on were
articles advertising commercial product (or features of commercial version) as
free product and nothing constructive which would help me. (Such a costly
system and it does not even has a migration tool.)</p>
<p>My second thought was to use CloneZilla as it is great tool for cloning driver
in general.</p>
<h1 id="cloning">Cloning</h1>
<p>Before starting I prepared partitions on SSD in the same way as they were on
the original drive apart from the one for data.</p>
<p>I cloned all partitions one by one, started M$ Windows rescue medium (or
something of that sort) to fix the bootloader (which worked after few tries)
and was happy to get to M$ Windows loading screen but than I got only
blackscreen with working mouse cursor (my thoughts at the time were as follow:
wtf? You can find the cursor so show me the rest!). So I searched how to fix
this (maybe error during cloning, or some M$ Windows thing) but nothing helped
solve my problem.</p>
<h1 id="solution">Solution</h1>
<p>I ran out of patiance for this crazy product and downloaded installation media
from the website, &ldquo;burn&rdquo; it on USB and installed new &ldquo;clean&rdquo; system on SSD.
After doing so I had to code the data and install programs and set few things
(it is not very customized machine). This also took a while.</p>
<h1 id="conclusion">Conclusion</h1>
<p>It is probably me who was unable to find the &ldquo;right&rdquo; manual for migration and
also me who does not understand the essence of M$ Windows.</p>
<h1 id="final-thought">Final thought</h1>
<p>Commercial products suck.</p>
]]></content>
            
                 
                    
                 
                    
                         
                        
                            
                             
                                <category scheme="https://blog.sgorava.xyz/tags/thoughts" term="thoughts" label="Thoughts" />
                            
                        
                    
                
            
        </entry>
    
        
        <entry>
            <title type="html"><![CDATA[Monthly report - February]]></title>
            <link href="https://blog.sgorava.xyz/memory/2020/03/monthly-report-february/" rel="alternate" type="text/html" />
            
                <id>https://blog.sgorava.xyz/memory/2020/03/monthly-report-february/</id>
            
            
            <published>2020-03-04T00:00:00+00:00</published>
            <updated>2020-03-04T00:00:00+00:00</updated>
            
            
            <content type="html"><![CDATA[<p>Hello,</p>
<p>I continued to slowly work o Falkon and also resumed work on Falkon
Plugins and once again started to fill Falkon store.</p>
<p>I am also slowly investigating / researching Falkon Qml API which should
work out of box on all platforms (while some may have problems with
Python), the API is insufficient, in other words &ldquo;there are too many
restrictions&rdquo;. I document my progress at file which can be found in
<strong>_drafts</strong> folder of this repository.</p>
<h3 id="falkon-contribution">Falkon contribution</h3>
<ul>
<li>Speeddial can now properly work with Unicode characters
<a href="https://bugs.kde.org/show_bug.cgi?id=406095">406095</a></li>
<li>SearchBar - Show number of matches found on page search
<a href="https://bugs.kde.org/show_bug.cgi?id=395429">395429</a></li>
</ul>
<p>On a side note, I am preparing a VPS with nice domain to move this blog
and many other things on. My domain and VPS are up just for few weeks
and I already have too many bots to kick out.</p>
]]></content>
            
                 
                    
                 
                    
                         
                        
                            
                             
                                <category scheme="https://blog.sgorava.xyz/tags/report" term="report" label="Report" />
                            
                        
                    
                
            
        </entry>
    
        
        <entry>
            <title type="html"><![CDATA[Introducing Tab Counter an extension for Falkon]]></title>
            <link href="https://blog.sgorava.xyz/memory/2020/03/introducing-tab-counter-an-extension-for-falkon/" rel="alternate" type="text/html" />
            
                <id>https://blog.sgorava.xyz/memory/2020/03/introducing-tab-counter-an-extension-for-falkon/</id>
            
            
            <published>2020-03-01T00:00:00+00:00</published>
            <updated>2020-03-01T00:00:00+00:00</updated>
            
            
            <content type="html"><![CDATA[<h2 id="introduction">Introduction</h2>
<p>Hello,
while using Vertical Tabs extensions in Tree Style mode I developed
a habit of keeping tabs and only unloading them. This leads Falkon to
have hundreds and hundreds of tabs always prepared for me to load.</p>
<p>In face of this I became curious about how many tabs there actually are
and how many are un/loaded so I developed
<a href="https://store.falkon.org/p/1363693/">Tab Counter</a>
extension.</p>
<p>Let me show you it&rsquo;s features!</p>
<h2 id="toolbar-button-actually-label">Toolbar Button, actually Label</h2>
<p>The tab count is shown in a toolbar button, which can be moved where
user desires is to be.</p>
<figure><img src="/images/2020-03-01_tab_counter_toolbar_button.png"
    alt="Toolbar button/label example"><figcaption>
      <p>Toolbar button/label example</p>
    </figcaption>
</figure>

<h2 id="settings-window">Settings window</h2>
<p>There is also a settings window in which user can change which count is
actually displayed.</p>
<p>There are following options:</p>
<ul>
<li>All</li>
<li>Loaded</li>
<li>Unloaded</li>
<li>Loaded/All</li>
</ul>
<figure><img src="/images/2020-03-01_tab_counter_settings_window.png"
    alt="Settings window"><figcaption>
      <p>Settings window</p>
    </figcaption>
</figure>

<h2 id="how-it-works">How it works</h2>
<p>The counts are updated whenever the tabs are changed.
This includes: added, removed, moved, loaded, unloaded.</p>
<h2 id="conclusion">Conclusion</h2>
<p>This is a great extension for people who like me keep a huge number of
tabs (and use tabs instead of bookmarks) to see how many tabs there are.</p>
]]></content>
            
                 
                    
                 
                    
                         
                        
                            
                             
                                <category scheme="https://blog.sgorava.xyz/tags/falkon" term="falkon" label="Falkon" />
                             
                                <category scheme="https://blog.sgorava.xyz/tags/programming" term="programming" label="Programming" />
                            
                        
                    
                
            
        </entry>
    
        
        <entry>
            <title type="html"><![CDATA[Monthly report - January]]></title>
            <link href="https://blog.sgorava.xyz/memory/2020/01/monthly-report-january/" rel="alternate" type="text/html" />
            
                <id>https://blog.sgorava.xyz/memory/2020/01/monthly-report-january/</id>
            
            
            <published>2020-01-31T00:00:00+00:00</published>
            <updated>2020-01-31T00:00:00+00:00</updated>
            
            
            <content type="html"><![CDATA[<p>Hello,</p>
<p>This was too short but also a very long month.
Many things I wanted to do I was unable to and had to push it to the
near future.</p>
<h2 id="artix-linux">Artix Linux</h2>
<ul>
<li>To make information more accessible we prepared RSS feed for our news.
You can subscribe at
<a href="https://artixlinux.org/feed.php">https://artixlinux.org/feed.php</a></li>
</ul>
<h2 id="falkon">Falkon</h2>
<ul>
<li>After a long while the bug
<a href="https://bugs.kde.org/show_bug.cgi?id=409575">409575</a>
(Python plugins don&rsquo;t load with PySide 5.13)
has finally a working with Qt (PySide2) <strong>5.14.1</strong>.</li>
<li>GreaseMonkey can now grab userscript URLs (*.user.js) with newer Qt
versions.
<a href="https://commits.kde.org/falkon/6974f8c25446d9cd2baae1be3298435f79d6b021">6974f8c2</a></li>
<li>Falkon can now handle web notifications (since QtWebEngine <strong>5.13</strong>)
with it&rsquo;s notification system
<a href="https://bugs.kde.org/show_bug.cgi?id=409045">409045</a></li>
</ul>
<h2 id="other">Other</h2>
<ul>
<li>I helped to hunt very annoying bug in ktexteditor
<a href="https://bugs.kde.org/show_bug.cgi?id=413848">413848</a>
(Drag&amp;copy function (by using Ctrl Key) does not work anymore)</li>
</ul>
]]></content>
            
                 
                    
                 
                    
                         
                        
                            
                             
                                <category scheme="https://blog.sgorava.xyz/tags/report" term="report" label="Report" />
                            
                        
                    
                
            
        </entry>
    
        
        <entry>
            <title type="html"><![CDATA[Monthly report - December]]></title>
            <link href="https://blog.sgorava.xyz/memory/2019/12/monthly-report-december/" rel="alternate" type="text/html" />
            
                <id>https://blog.sgorava.xyz/memory/2019/12/monthly-report-december/</id>
            
            
            <published>2019-12-31T00:00:00+00:00</published>
            <updated>2019-12-31T00:00:00+00:00</updated>
            
            
            <content type="html"><![CDATA[<p>Hello,</p>
<p>This month was full of work and I did not have much time to do things
which I would love to do.</p>
<h2 id="kdevelop">KDevelop</h2>
<p>Some patches I made
(<a href="https://invent.kde.org/kdevelop/kdevelop/merge_requests/66">!66</a>,
<a href="https://invent.kde.org/kdevelop/kdevelop/merge_requests/68">!68</a>,
<a href="https://invent.kde.org/kdevelop/kdevelop/merge_requests/75">!75</a>)
were accepted and will be part of the KDevelop <strong>5.5</strong>.</p>
<h2 id="falkon">Falkon</h2>
<p>We are still walking on edge when it comes to Python plugin support.
The problem is there is probably &ldquo;only&rdquo; me who is testing the
<a href="https://bugreports.qt.io/browse/PYSIDE-1135">patch</a>
for real to ensure the patch is correct, but since there was no time&hellip;</p>
<p>In this way I would like to ask anyone to help with solving this issue.</p>
<p>On the other end, at the end of this month (year) I finally found a bit
of time and tried to port Falkon code away from deprecated things.
If there is any problem please create report at
<a href="https://bugs.kde.org/buglist.cgi?component=general&amp;list_id=1697719&amp;product=Falkon&amp;resolution=---">bug tracker</a></p>
<h2 id="conclusion">Conclusion</h2>
<p>That is all what I deem worthy of praise.</p>
<p>Happy new year and happy coding.</p>
]]></content>
            
                 
                    
                 
                    
                         
                        
                            
                             
                                <category scheme="https://blog.sgorava.xyz/tags/report" term="report" label="Report" />
                            
                        
                    
                
            
        </entry>
    
        
        <entry>
            <title type="html"><![CDATA[KDevelop AppWizard - DVCS fix for empty project]]></title>
            <link href="https://blog.sgorava.xyz/memory/2019/11/kdevelop-appwizard-dvcs-fix-for-empty-project/" rel="alternate" type="text/html" />
            
                <id>https://blog.sgorava.xyz/memory/2019/11/kdevelop-appwizard-dvcs-fix-for-empty-project/</id>
            
            
            <published>2019-11-08T00:00:00+00:00</published>
            <updated>2019-11-08T00:00:00+00:00</updated>
            
            
            <content type="html"><![CDATA[<h2 id="backstory">Backstory</h2>
<p>Few days ago I wanted to play with Falkon and create some basic Qml
plugin. (What else to do to play, Python support is broken and C++ is
for built-in plugins).</p>
<p>I started KDevelop (the big IDE I use) and went to create new <strong>Empty</strong>
project because as I am not big Qml lover I did not create template for
it yet. But I was met with errors which made me change my focus and fix
the tool I use (KDevelop) before playing with Qml and Falkon.</p>
<blockquote>
<p>Man must shape his tools lest they shape him. - Arthur Miller</p>
</blockquote>
<h2 id="problem">Problem</h2>
<p>During the project creation AppWizard is trying add files and than
commit changes into new DVCS (Decentralized Version Control System)
repository. When there are no files to add there will naturally be
nothing to commit which results in error message from DVCS and the
project creation is stopped and project removed.</p>



<video width="480" height="320" controls>

	<source src="/videos/2019-11-08_kdevelop_appwizard_dvcs_error.webm">

	<source src="/videos/2019-11-08_kdevelop_appwizard_dvcs_error.mp4">

<div class="video">

Your browser does not support HTML5 video.

<ul>

	<li>
		<a href="/videos/2019-11-08_kdevelop_appwizard_dvcs_error.webm">/videos/2019-11-08_kdevelop_appwizard_dvcs_error.webm</a>
		
		
		(376 kiB)
	</li>

	<li>
		<a href="/videos/2019-11-08_kdevelop_appwizard_dvcs_error.mp4">/videos/2019-11-08_kdevelop_appwizard_dvcs_error.mp4</a>
		
		
		(262 kiB)
	</li>

</ul>

</div>
</video>


<h2 id="solution">Solution</h2>
<p>Lets dive into KDevelop code and check what can be done about it.
My humble solution relays on checking the state of the DVCS repository
before commit. To achieve this I am trying to get actual status of the
repository from VCS (Version Control System) and then checking if the
result contains some items.</p>
<p>The KDevPlatform provides nice API to work with VCSs and thus I only
need to call few method to get all the data.</p>
<p>Actual code is truly simple and works for me. (only my changes)</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#000;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-cpp" data-lang="cpp"><span style="display:flex;"><span>qCDebug(PLUGIN_APPWIZARD) &lt;&lt; <span style="color:#87ceeb">&#34;Checking for valid files in the DVCS repository:&#34;</span> &lt;&lt; dest;
</span></span><span style="display:flex;"><span>job = dvcs-&gt;status({dest}, KDevelop::IBasicVersionControl::Recursive);
</span></span><span style="display:flex;"><span><span style="color:#f00">if</span> (!job || !job-&gt;exec() || job-&gt;status() != VcsJob::JobSucceeded)
</span></span><span style="display:flex;"><span>{
</span></span><span style="display:flex;"><span>    vcsError(i18n(<span style="color:#87ceeb">&#34;Could not check status of the DVCS repository&#34;</span>), scratchArea, dest);
</span></span><span style="display:flex;"><span>    <span style="color:#f00">return</span> false;
</span></span><span style="display:flex;"><span>}
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#f00">if</span> (job-&gt;fetchResults().toList().isEmpty())
</span></span><span style="display:flex;"><span>{
</span></span><span style="display:flex;"><span>    qCDebug(PLUGIN_APPWIZARD) &lt;&lt; <span style="color:#87ceeb">&#34;No files to add, skipping commit in the DVCS repository:&#34;</span> &lt;&lt; dest;
</span></span><span style="display:flex;"><span>    <span style="color:#f00">return</span> true;
</span></span><span style="display:flex;"><span>}
</span></span></code></pre></div><h3 id="brief-description">Brief description</h3>
<ul>
<li>Print notice into debug output</li>
<li>Prepare job with status command to run</li>
<li>Execute the job and check for failure
<ul>
<li>If failed put notice in debug output</li>
</ul>
</li>
<li>Check if the response contains some items
<ul>
<li>If not put notice in debug output</li>
<li>Skip add files &amp; commit by returning true</li>
</ul>
</li>
<li>Test many times and done.</li>
</ul>
<h2 id="results">Results</h2>
<p>KDevelop is able to create Empty project from template with initialized
DVCS repository which is really helpful when one wish to start a project
from scratch.</p>
<h3 id="git">Git</h3>
<p>Works just fine.</p>



<video width="480" height="320" controls>

	<source src="/videos/2019-11-08_kdevelop_appwizard_dvcs_result_git.webm">

	<source src="/videos/2019-11-08_kdevelop_appwizard_dvcs_result_git.mp4">

<div class="video">

Your browser does not support HTML5 video.

<ul>

	<li>
		<a href="/videos/2019-11-08_kdevelop_appwizard_dvcs_result_git.webm">/videos/2019-11-08_kdevelop_appwizard_dvcs_result_git.webm</a>
		
		
		(237 kiB)
	</li>

	<li>
		<a href="/videos/2019-11-08_kdevelop_appwizard_dvcs_result_git.mp4">/videos/2019-11-08_kdevelop_appwizard_dvcs_result_git.mp4</a>
		
		
		(141 kiB)
	</li>

</ul>

</div>
</video>


<h3 id="bazaar">Bazaar</h3>
<p>The world is never perfect and there is always a room for improvements.</p>



<video width="480" height="320" controls>

	<source src="/videos/2019-11-08_kdevelop_appwizard_dvcs_result_bzr.webm">

	<source src="/videos/2019-11-08_kdevelop_appwizard_dvcs_result_bzr.mp4">

<div class="video">

Your browser does not support HTML5 video.

<ul>

	<li>
		<a href="/videos/2019-11-08_kdevelop_appwizard_dvcs_result_bzr.webm">/videos/2019-11-08_kdevelop_appwizard_dvcs_result_bzr.webm</a>
		
		
		(546 kiB)
	</li>

	<li>
		<a href="/videos/2019-11-08_kdevelop_appwizard_dvcs_result_bzr.mp4">/videos/2019-11-08_kdevelop_appwizard_dvcs_result_bzr.mp4</a>
		
		
		(316 kiB)
	</li>

</ul>

</div>
</video>


<h2 id="links">Links</h2>
<p>The merge request is waiting for review at
<a href="https://invent.kde.org/kdevelop/kdevelop/merge_requests/73">invent.kde.org !73</a>.</p>
]]></content>
            
                 
                    
                 
                    
                         
                        
                            
                             
                                <category scheme="https://blog.sgorava.xyz/tags/kde" term="kde" label="KDE" />
                             
                                <category scheme="https://blog.sgorava.xyz/tags/kdevelop" term="kdevelop" label="KDevelop" />
                             
                                <category scheme="https://blog.sgorava.xyz/tags/programming" term="programming" label="Programming" />
                            
                        
                    
                
            
        </entry>
    
        
        <entry>
            <title type="html"><![CDATA[YouTube Design Changes and my peaceful life]]></title>
            <link href="https://blog.sgorava.xyz/memory/2019/11/youtube-design-changes-and-my-peaceful-life/" rel="alternate" type="text/html" />
            
                <id>https://blog.sgorava.xyz/memory/2019/11/youtube-design-changes-and-my-peaceful-life/</id>
            
            
            <published>2019-11-01T00:00:00+00:00</published>
            <updated>2019-11-01T00:00:00+00:00</updated>
            
            
            <content type="html"><![CDATA[<p>Around a week ago YouTube switched <em>my</em> homepage to their <em>new</em> design
with very big video previews which is suitable for tablets or
<em>smart</em>phones but totally unusable on desktop with reasonable huge
screen.</p>
<p>So I searched a way how to disable it, but as almost always there was
none. In the end I used &ldquo;Feedback&rdquo; function and described how unusable
it is on desktop and now (at the time of writing this post) I have
older homepage design.</p>
<h2 id="meanwhile">Meanwhile</h2>
<p>While YouTube was playing tricks on me I decided to play tricks on
YouTube. My first idea was to change the user interface with some
UserScript but that failed. The second idea was to simply discard
web browser and use
<a href="https://github.com/trizen/youtube-viewer">YouTube Viewer</a>,
to be exact its GTK version to browse and watch videos.</p>
<p>The other big hurdle of YouTube is that videos often do missing or are
simply blocked, audio muted, cut and so on. Due to this I decided to
create a little video cache. This cache also helps me to get better
video quality out of youtube-dl and YouTube-viewer.</p>
<p>Another things is that my machine does not like modern software which
supports playing YouTube videos such as MPV (restarts? GPU) or VLC
(does not work at all whatever I set in settings) I went for simpler
Mplayer which works fine to my surprise.</p>
<p>The goal was to get videos with 1080p or lower with fps 30 or lower.
I was unable to set this special condition directly in YouTube Viewer.
I decided to create little &ldquo;proxy&rdquo; script which will be called from
YouTube Viewer with video <strong>URL</strong> and video <strong>title</strong> (I am truly lazy
here).</p>
<h2 id="little-script">Little script</h2>
<p>Since youtube-dl is written in Python I also decided to use Python and
use youtube-dl python API to call it instead of cli. In this way the
script has full control over youtube-dl configuration and I could play.</p>
<p>The biggest hurdle is that youtube-dl does not provide final filename
for downloaded video. The only way to get the final filename which is
used the script has to parse (with regular expression to have some
<a href="http://txt2re.com/">fun</a>)
the debug output of youtube-dl to snatch the real filename in which the
file exists or will exist in file system.</p>
<p>In the end I just called mplayer with video filename and title which
was provided in argument.</p>
<p>The script is still not up to the standard and only works thanks to
luck, use with a caution. You can download it
<a href="https://git.sgorava.xyz/Miscellaneous/yt-download">here</a></p>
<h2 id="conclusion">Conclusion</h2>
<p>I have to thank YouTube for providing me with this oportunity, without
I am afraid I would be still mostly locked in YouTube interface, not
wanting to go out.</p>
<p>Really big Thanks goes to
<a href="https://github.com/ytdl-org/youtube-dl">youtube-dl</a>
and
<a href="https://github.com/trizen/youtube-viewer">youtube-viewer</a>
projects.
Thank you.</p>
]]></content>
            
                 
                    
                 
                    
                         
                        
                            
                             
                                <category scheme="https://blog.sgorava.xyz/tags/youtube" term="youtube" label="YouTube" />
                             
                                <category scheme="https://blog.sgorava.xyz/tags/thoughts" term="thoughts" label="Thoughts" />
                            
                        
                    
                
            
        </entry>
    
        
        <entry>
            <title type="html"><![CDATA[Good night NVIDIA, sweet dreams]]></title>
            <link href="https://blog.sgorava.xyz/memory/2019/10/good-night-nvidia-sweet-dreams/" rel="alternate" type="text/html" />
            
                <id>https://blog.sgorava.xyz/memory/2019/10/good-night-nvidia-sweet-dreams/</id>
            
            
            <published>2019-10-24T00:00:00+00:00</published>
            <updated>2019-10-24T00:00:00+00:00</updated>
            
            
            <content type="html"><![CDATA[<p>Back in the year I bought a cheap <code>Lenovo</code> laptop with Intel and NVIDIA Optimus gpu.
It was not great but I am unable to say it was bad, it still runs fine, so it was a good choice.
Even though the Linux support for Optimus enabled gpu was kind of bad it was still manageable.</p>
<p>At the time I decided to use <code>Bumblebee</code> + <code>bbswitch</code> (to disable the card), it worked fine.
There was a bit of drawback on CPU but it worked kind of nicely, I could run things on NVIDIA with simple command without closing current X.</p>
<p>Years went by on and everything was mostly fine, small things over the time as always.
As plus there was support in mainline of NVIDIA drivers.
But after a bit more this support was dropped and after an update I was welcomed with not working card, welcome legacy branch (390 for me).</p>
<p>Meanwhile <code>libglvnd</code> landed in Archlinux, what a pain.
At first I did not manage to configure Bumblebee properly with it.
But after some time I managed and it worked fine, using the card went fine.</p>
<p>There appeared a problem when NVIDIA card just randomly turned on and stayed on.
I only heard noise, felt heat or experienced empty battery.
This truly turned into HELL, waking up this hungry friend is costly.
But I endured for a long time.</p>
<p>After a long time with help of some internet people and entities I managed to resolve one <a href="https://wiki.archlinux.org/index.php/Bumblebee#Discrete_card_is_silently_activated_when_egl_is_requested_by_some_application">case</a> but it still did not help and other things like <code>Steam</code>, <code>Lutris</code> and even <code>SimpleScreenRecorder</code> still somehow managed to activate the NVIDIA gpu.</p>
<p>It is sad to say but I desire a bit more stable environment.
So I had disabled NVIDIA gpu in <code>BIOS</code>.</p>
<p>It was a good ride.</p>
<p>Good night NVIDIA, have a sweet dream.</p>
]]></content>
            
                 
                    
                 
                    
                         
                        
                            
                             
                                <category scheme="https://blog.sgorava.xyz/tags/nvidia" term="nvidia" label="NVIDIA" />
                             
                                <category scheme="https://blog.sgorava.xyz/tags/thoughts" term="thoughts" label="Thoughts" />
                            
                        
                    
                
            
        </entry>
    
        
        <entry>
            <title type="html"><![CDATA[Building blog based on GitHub pages]]></title>
            <link href="https://blog.sgorava.xyz/memory/2019/10/building-blog-based-on-github-pages/" rel="alternate" type="text/html" />
            
                <id>https://blog.sgorava.xyz/memory/2019/10/building-blog-based-on-github-pages/</id>
            
            
            <published>2019-10-21T00:00:00+00:00</published>
            <updated>2019-10-21T00:00:00+00:00</updated>
            
            
            <content type="html"><![CDATA[<p>After some time I once again tried to create a blog.
This time with it should be nice static site with dark design and only memories.</p>
<p>At first I went on journey to find a nice dark theme which I would use as a base.
After a bit I found <a href="https://github.com/tocttou/hacker-blog">tocttou/hacker-blog</a> which is really nice. See <a href="https://ashishchaudhary.in/hacker-blog">demo.</a></p>
<h2 id="customization">Customization</h2>
<p>It sounds all nice and fine but it is a bit plain.
I decided that categories or tags would be nice.
I chose tags because it is shorter and looks better.
After a bit of search I stumbled upon a nice <a href="https://blog.webjeda.com/jekyll-categories/">example</a>.
In the end it required a bit more work to add all functions but the basic idea was there.
I added list of tags for each post on index:</p>
<figure><img src="/images/2019-10-21_blog_tags_on_index.png"
    alt="List of tags on the index page"><figcaption>
      <p>List of tags on the index page</p>
    </figcaption>
</figure>

<p>memory page:</p>
<figure><img src="/images/2019-10-21_blog_tags_on_memory.png"
    alt="List of tags on the memory/post page"><figcaption>
      <p>List of tags on the memory/post page</p>
    </figcaption>
</figure>

<p>and tags page:</p>
<figure><img src="/images/2019-10-21_blog_tags_page.png"
    alt="List of all tags with posts (like an archive for tags)"><figcaption>
      <p>List of all tags with posts (like an archive for tags)</p>
    </figcaption>
</figure>

<p>Even if it looks easy it took me a while.
I also added some hidden features which noone will probably see unless you look at the code.</p>
<h2 id="rss--atom-feed">RSS / Atom feed</h2>
<p>The theme / blog came with some atom.xml file which generated Atom compatible feed.
I thought it is pain to manage and went for Jekyll plugin <strong>jekyll-feed</strong>.
This plugin can create nice feeds, it should also be able to create feeds for each category.
After many trials and errors there was a catch.
the plugin could create category feeds only if <em>category</em> variable for post (memory) was present.
Because I decided to use tags I changed it to categories, and so it did not work.</p>
<p>So I went and downloaded template from <strong>jekyll-feed</strong> repository and adapted it to work with my project.
Surprisingly it was easy to do.
After it was done I saved it as <em>feed.xml</em> and also saved a copy at <em>feed/KDE.xml</em></p>
<h2 id="making-the-generated-code-nicer">Making the generated code nicer</h2>
<p>After a while of working on the site I was more and more dissatisfied with the html code it generated.
HTML was fine but there was a <strong>LOT</strong> of blank lines with white spaces left from templates.</p>
<p>The way how to get rid of this is to ass <strong>-</strong> at the beginning of template tags.
That will make the Liquid template engine to remove the line on which this element is.</p>
<pre tabindex="0"><code>{%- template logic ... %}
</code></pre><p>After using this syntax on almost whole template the generated code looks much nicer.</p>
<h2 id="add-videos">Add videos</h2>
<p>In my second <a href="/memory/2019/10/kdevelop-filetemplates-preview-toolview-tweaks/">post</a> I wanted to add few videos.
There are already prepared solutions to load youtube, video and some other external video services.
But I wanted to host these small mini videos in git repository, so it was no go.
It is sad to say but there is not {% video url %} tag.
After a bit of <a href="https://stackoverflow.com/questions/30522960/macro-in-liquid-template-language">searching</a> there is truly a nice solution.</p>
<p>The files in _include directory can take a parameter when included from other files. See <a href="https://jekyllrb.com/docs/includes/#passing-parameters-to-includes">documentation</a>.</p>
<p>While I was at it, I made it so that it is nice and easy to use. The code can be found in the <a href="https://github.com/SGOrava/sgorava.github.io/blob/master/_includes/video_embed.html">repository</a>.</p>
<p>In the &ldquo;template&rdquo; file I also included ffmpeg commands to convert video to mp4 and webm which are supported by browsers these days.</p>
<p>Example of usage:</p>
<pre tabindex="0"><code>{%- include video_embed.html video=&#34;video name&#34; extensions=&#34;mp4,webm %}
</code></pre><p>It is easy and nice.</p>
<h2 id="revising-feeds">Revising feeds</h2>
<p>After I learnt of this nice feature I adapted RSS feeds and made them use one template called atom.xml.</p>
<p>The whole xml file can now be reduced to few lines:</p>
<pre tabindex="0"><code>---
layout: none
tag: KDE
---
{% include atom.xml %}
</code></pre><h2 id="conclusion">Conclusion</h2>
<p>Third-party plugins sucks.</p>
<p>Make your own and be happy.</p>
<p>The code with all changes and &ldquo;tweak&rdquo; can be found at
<a href="https://git.sgorava.xyz/Websites/blog.sgorava.xyz">Gitea</a>.</p>
]]></content>
            
                 
                    
                 
                    
                         
                        
                            
                             
                                <category scheme="https://blog.sgorava.xyz/tags/github" term="github" label="GitHub" />
                             
                                <category scheme="https://blog.sgorava.xyz/tags/jekyll" term="jekyll" label="Jekyll" />
                             
                                <category scheme="https://blog.sgorava.xyz/tags/blog" term="blog" label="Blog" />
                            
                        
                    
                
            
        </entry>
    
        
        <entry>
            <title type="html"><![CDATA[KDevelop filetemplates preview toolview - tweaks]]></title>
            <link href="https://blog.sgorava.xyz/memory/2019/10/kdevelop-filetemplates-preview-toolview-tweaks/" rel="alternate" type="text/html" />
            
                <id>https://blog.sgorava.xyz/memory/2019/10/kdevelop-filetemplates-preview-toolview-tweaks/</id>
            
            
            <published>2019-10-21T00:00:00+00:00</published>
            <updated>2019-10-21T00:00:00+00:00</updated>
            
            
            <content type="html"><![CDATA[<p>The KDevelop`s user interface (UI) suffers from required minimal width of widgets and toolviews.
The &ldquo;Template Preview&rdquo; toolview is one such toolview.
In my case it pushes part of the KDevelop window out of the screen.</p>



<video width="480" height="320" controls>

	<source src="/videos/2019-10-21_kdevelop_template_preview_original.mp4">

	<source src="/videos/2019-10-21_kdevelop_template_preview_original.webm">

<div class="video">

Your browser does not support HTML5 video.

<ul>

	<li>
		<a href="/videos/2019-10-21_kdevelop_template_preview_original.mp4">/videos/2019-10-21_kdevelop_template_preview_original.mp4</a>
		
		
		(1042 kiB)
	</li>

	<li>
		<a href="/videos/2019-10-21_kdevelop_template_preview_original.webm">/videos/2019-10-21_kdevelop_template_preview_original.webm</a>
		
		
		(1328 kiB)
	</li>

</ul>

</div>
</video>


<p>Apart from other widgets in KDevelop window the main culprits in &ldquo;Template Preview&rdquo; toolview are
kMessageWidged, line policy combo box and its label.</p>
<p>The combo box is wide, the proposed solution would be to set some fixed width or to move the label above or under it.</p>
<p>The other solution is to enable word-wrap for KMessageWidget and the line policy label.
While I was at it I also removed one spacer which was only causing trouble.
The effect of this change is very nice, the toolview requires a bit less space than before and the KDevelop window can now fit my screen.</p>
<p>But as always, there is a drawback. There seems to be a bug on <a href="https://bugs.kde.org/show_bug.cgi?id=412829">KMessageWidget</a> which does not look nice.</p>



<video width="480" height="320" controls>

	<source src="/videos/2019-10-21_kdevelop_template_preview_bug.mp4">

	<source src="/videos/2019-10-21_kdevelop_template_preview_bug.webm">

<div class="video">

Your browser does not support HTML5 video.

<ul>

	<li>
		<a href="/videos/2019-10-21_kdevelop_template_preview_bug.mp4">/videos/2019-10-21_kdevelop_template_preview_bug.mp4</a>
		
		
		(207 kiB)
	</li>

	<li>
		<a href="/videos/2019-10-21_kdevelop_template_preview_bug.webm">/videos/2019-10-21_kdevelop_template_preview_bug.webm</a>
		
		
		(249 kiB)
	</li>

</ul>

</div>
</video>


<p>After a bit of playing with layout I sent a bug report and prepard merge request at <a href="https://invent.kde.org/kdevelop/kdevelop/merge_requests/68">invent.kde.org</a></p>
<p>The final results can be seen here. And it seems like the bug report should be edited&hellip;.</p>



<video width="480" height="320" controls>

	<source src="/videos/2019-10-21_kdevelop_template_preview_final.mp4">

	<source src="/videos/2019-10-21_kdevelop_template_preview_final.webm">

<div class="video">

Your browser does not support HTML5 video.

<ul>

	<li>
		<a href="/videos/2019-10-21_kdevelop_template_preview_final.mp4">/videos/2019-10-21_kdevelop_template_preview_final.mp4</a>
		
		
		(346 kiB)
	</li>

	<li>
		<a href="/videos/2019-10-21_kdevelop_template_preview_final.webm">/videos/2019-10-21_kdevelop_template_preview_final.webm</a>
		
		
		(441 kiB)
	</li>

</ul>

</div>
</video>


<p>The KMessageWidgets size is not changing when the width is decreased and words needs to be wrapped, it looks bad.</p>]]></content>
            
                 
                    
                 
                    
                         
                        
                            
                             
                                <category scheme="https://blog.sgorava.xyz/tags/kde" term="kde" label="KDE" />
                             
                                <category scheme="https://blog.sgorava.xyz/tags/kdevelop" term="kdevelop" label="KDevelop" />
                             
                                <category scheme="https://blog.sgorava.xyz/tags/programming" term="programming" label="Programming" />
                            
                        
                    
                
            
        </entry>
    
        
        <entry>
            <title type="html"><![CDATA[KDevelop filetemplates - Tooltip for custom options]]></title>
            <link href="https://blog.sgorava.xyz/memory/2019/10/kdevelop-filetemplates-tooltip-for-custom-options/" rel="alternate" type="text/html" />
            
                <id>https://blog.sgorava.xyz/memory/2019/10/kdevelop-filetemplates-tooltip-for-custom-options/</id>
            
            
            <published>2019-10-18T00:00:00+00:00</published>
            <updated>2019-10-18T00:00:00+00:00</updated>
            
            
            <content type="html"><![CDATA[<p>After few ups and downs with <a href="https://www.pling.com/c/1312270/">file templates</a>, the journey through source code started once again.</p>
<p>Based on the comment in <a href="https://invent.kde.org/kdevelop/kdevelop/blob/ad0cbbb82d8d8a57412048ec2585c5ea84fcf41b/kdevplatform/language/codegen/sourcefiletemplate.h#L187">source code</a>, it should be possible to add tooltips for custom options in file templates.<br>
How foolish I was to trust the comments.
The option loading logic never counted with such possibility,
it takes any data it can find in &rsquo;label&rsquo;, &rsquo;tooltip&rsquo; and &lsquo;whatsthis&rsquo; field and sets it as option`s <a href="https://invent.kde.org/kdevelop/kdevelop/blob/ad0cbbb82d8d8a57412048ec2585c5ea84fcf41b/kdevplatform/language/codegen/sourcefiletemplate.cpp#L63">label</a>.
The displayed text is the last read value of these three fields.</p>
<p>So I went and changed it to properly load the tooltip and adjusted the custom option page to display them.
The merge request is waiting at <a href="https://invent.kde.org/kdevelop/kdevelop/merge_requests/66">invent.kde.org</a></p>
<p>And the result is:</p>
<figure><img src="/images/2019-10-18_kdevelop_file_template_tooltip.png"
    alt="File template custom options window"><figcaption>
      <p>File template custom options window</p>
    </figcaption>
</figure>

]]></content>
            
                 
                    
                 
                    
                         
                        
                            
                             
                                <category scheme="https://blog.sgorava.xyz/tags/kde" term="kde" label="KDE" />
                             
                                <category scheme="https://blog.sgorava.xyz/tags/kdevelop" term="kdevelop" label="KDevelop" />
                             
                                <category scheme="https://blog.sgorava.xyz/tags/programming" term="programming" label="Programming" />
                            
                        
                    
                
            
        </entry>
    
</feed>
