Skip to content

Monday, 15 July 2024

Profiling displays is already not a super simple thing on its own, but things get more complicated when you try to profile your display in Wayland - profiling applications don’t support Wayland yet, some APIs on the compositor side to make it work well are still missing, and there’s a general lack of information on the topic. So today I’ll show you how to profile your display in the Plasma Wayland session.

I did this in Fedora 40, but you can follow these steps in other distributions as well.

Step 1: Install DisplayCal and start it

This sounds easy, but

  • it’s not packaged for Fedora. That’s being worked on, but right now it’s not an option | edit: turns out there is a COPR for it
  • installing it with pip just gave me a bunch of compilation errors, and I haven’t figured out how to fix them
  • the package on Flathub is really old and broken

To work around that, I used distrobox to install the Arch Linux package for DisplayCAL:

sudo dnf install distrobox
distrobox create --name archinabox --image archlinux:latest
distrobox enter archinabox
sudo pacman -S displaycal
distrobox-export --app displaycal
exit

After running these commands, DisplayCAL can be started from any app launcher, like Kickoff or KRunner.

Step 2: Setup

To get correct measurement results, the compositor needs to pass the pixel data from the profiling app directly to the display, and not do any color management itself. This will be automated at some point, but for now you need to manually ensure that

  • HDR is disabled
  • the color profile of the display is set to “None” in the display settings
  • night light is off, or at least suspended in the system tray
  • all KWin effects that modify colors, like the color blindness correction effect, are disabled
  • if you’re on a new-ish AMD laptop and want to profile the internal display, that you’re either plugged in to a power source, or have the power profile set to performance, to disable a power saving feature that changes the colors

display settings

Now start DisplayCal and head to the Calibration tab. Here it’s important to set the tone curve to “as measured”, and untick interactive display adjustment, as those don’t work correctly right now and will mess up the profile.

DisplayCAL profiling tab

You’ve done everything correctly if the button on the bottom of the application shows “Profile only”.

Last but not least, you also need to adjust the display settings to what you want to use with the profile later, as the profile is only correct for one specific set of display settings. This includes the brightness of the display!

Step 3: Profile

In the profiling tab of DisplayCAL, select your desired settings - in most cases the default will be sufficient - and click “Profile only”. When it asks if you want to continue with the current calibration curves, select “use linear calibration instead” and de-select “embed calibration curves in profile”. Then put the colorimeter in the center of the screen, and let it do its thing.

DisplayCAL warning

Once it’s done, it’ll ask you to install the profile. Installing it will not automatically enable that profile to be used, but it’ll save the profile in ~/.config/color/icc/devices/display/ and you can select that file in the display settings.

Step 4: Verification (optional)

If you’d like to make sure the profile is correct or accurate enough, you can use DisplayCAL to verify the result. Make sure you’ve set the profile in the display settings, switch to the verification tab in DisplayCAL and select your newly created profile in the “settings”

Here again, because DisplayCAL doesn’t support Wayland yet, you need to adjust a few settings for everything to work correctly. You need to select the simulation profile “Rec.709 ITU-R BT.709”, select “Use simulation profile as display profile” and set the tone curve to “Gamma 2.2”. Afterwards, click on “Measurement report”, choose a location to save it in, put the colorimeter in the center of the screen again and wait for it to complete.

DisplayCAL verification tab

Don’t be alarmed if the result says the whitepoint is wrong, this is simply caused by DisplayCAL assuming we want to target the whitepoint of the simulation profile, which doesn’t necessarily match the whitepoint of your display.

What about calibration though?

To calibrate the display, that is, to adjust brightness, tone curves for non color managed applications and the whitepoint of the display, DisplayCAL uses an X11 API to set the gamma lookup tables of the GPU. That API doesn’t work in the Wayland session and the profiling process doesn’t handle that situation properly, which is why all calibration needs to be disabled for the created profile to be correct.

DisplayCAL (or ArgyllCMS, which does the actual profiling) could add support for applying a lookup table in the application instead of having the compositor do it, but we can also handle calibration entirely on the compositor side instead, which offers a bit more flexibility.

Changing the tone curves for non color managed applications doesn’t make sense in the Plasma Wayland session, as all windows are always color managed, so that part is already dealt with. Adjusting the brightness on screens that don’t have any native means of brightness control is already implemented for Plasma 6.2, and I have a working proof of concept for changing the whitepoint of the display without needing a new ICC profile too, so we should be at feature parity soon. I’ll talk more about these adjustments in a future post.

Week 7 of my 14-week GSoC project has finished, which means that it’s time for a midterm update! Many things have happened since the last update.

I added support for KI18n, KGuiAddons, KNotifications, KUnitConversion and KXMLGui. That was faster than expected. I also created a small unit conversion demo using KUnitConversion (it’s written in Python):

Unit Converter Demo

We have decided to move on to upstream the bindings to their corresponding repositories. For that, I set up a development environment and I’m now adding the code to each library.

Sunday, 14 July 2024

Dear digiKam fans and users,

After five months of active maintenance and long bugs triage, the digiKam team is proud to present version 8.4.0 of its open source digital photo manager.

Long time bugs present in older versions have been fixed and we spare a lot of time to contact users to validate changes in pre-release to confirm fixes before deploying the program in production.

Saturday, 13 July 2024

I have become a bit wary of “at what cost” arguments. You know the kind…

Friday, 12 July 2024

Let’s go for my web review for the week 2024-28.


Take action to stop chat control now!

Tags: tech, politics, law, privacy

It’s time to push European governments to abandon this nonsense.

https://www.patrick-breyer.de/en/take-action-to-stop-chat-control-now/


VLMs are Blind

Tags: tech, ai, machine-learning, gpt, computer-vision

Those brand new models keep failing at surprisingly simple tasks.

https://vlmsareblind.github.io/


Universal Code Execution by Chaining Messages in Browser Extensions

Tags: tech, browser, security

This is a concerning finding. One can escape from the browser to the system with such chaining.

https://spaceraccoon.dev/universal-code-execution-browser-extensions/


Let’s talk about supply chain attacks and backdoored dependencies

Tags: tech, security, supply-chain, dependencies

Good tour of all the way dependencies might get compromised in your supply chain. Getting this easy to detect is needed.

https://kerkour.com/supply-chain-attacks-and-backdoored-dependencies


Ubuntu Security Updates Are a Confusing Mess | Grey Lumpy Dinosaur

Tags: tech, ubuntu, security

The title is a bit pushing it. Still, I didn’t realize some of the fine prints of the Ubuntu support schemes.

https://gld.mcphail.uk/posts/ubuntu-security-updates-are-a-confusing-mess/


An Empirical Study of Rust-for-Linux: The Success, Dissatisfaction, and Compromise | USENIX

Tags: tech, linux, kernel, rust

It’s nice to have a balanced view on the matter. It’s not just roses and rainbows. This gives a good overview of the current limitations and where Rust can give most benefits in the kernel.

https://www.usenix.org/conference/atc24/presentation/li-hongyu


A new way to develop on Linux

Tags: tech, linux, system, systemd

Interesting approach to test system changes. Especially welcome on immutable systems.

https://www.codethink.co.uk/articles/2024/A-new-way-to-develop-on-Linux/


nmbl: we don’t need a bootloader

Tags: tech, linux, uefi, boot, system

Looks like GRUB days as the standard bootloader are counted. Booting straight using the Linux kernel could bring interesting benefits. Probably not doable on every hardware platform though.

https://fizuxchyk.wordpress.com/2024/06/13/nmbl-we-dont-need-a-bootloader/


Towards Idempotent Rebuilds?

Tags: tech, linux, packaging

An interesting puzzle to pursue. Is it possible to rebuild exactly the same binary distribution packages?

https://blog.josefsson.org/2024/07/10/towards-idempotent-rebuilds/


Binary Search Tree with SIMD

Tags: tech, simd, performance

Another interesting algorithm to handle using SIMD.

https://clement-jean.github.io/simd_binary_search_tree/


Making Python Less Random — Andrew Healey

Tags: tech, linux, system

It’s really a good reminder of how powerful ptrace is. You can nicely intercept and change the behavior of syscalls with it.

https://healeycodes.com/making-python-less-random


Cryptomator: end-to-end encrypt files in any cloud

Tags: tech, cloud, storage, cryptography, security, tools

Looks like a nice tool indeed. Might be handy.

https://www.andreagrandi.it/posts/cryptomator-end-to-end-encrypt-files-in-cloud/


Dirty writes – Surfing Complexity

Tags: tech, databases

A simple explanation about dirty writes during database transactions.

https://surfingcomplexity.blog/2024/07/05/dirty-writes/


PostgreSQL and UUID as primary key

Tags: tech, databases, uuid, performance

Forced to use UUID as primary key in a table? Then make sure to use them properly to not kill the performance more than necessary. Ideally use something else though.

https://maciejwalkowiak.com/blog/postgres-uuid-primary-key/


Unravelling attribute access in Python

Tags: tech, programming, python

Ever wondered how attributes work in Python under the hood? Here is how.

https://snarky.ca/unravelling-attribute-access-in-python/


Making an iterator out of a function | mathspp

Tags: tech, programming, python

An interesting Python construct to make iterators based on a simple function.

https://mathspp.com/blog/til/making-an-iterator-out-of-a-function


State of Text Rendering 2024

Tags: tech, gui, fonts

Very long read but will be an essential resource to have a fine understanding of text rendering in its current form.

https://behdad.org/text2024/


the software crisis

Tags: tech, quality, craftsmanship, engineering, complexity, history

Interesting musing about the “software crisis” which was declared in the late 60s. We’re coping with it by piling levels of abstractions but clearly we’re still not out of it. Our craft still needs to grow.

https://wryl.tech/log/2024/the-software-crisis.html


Standups: Individual → Teammate - by Kent Beck

Tags: tech, team, organization, agile

Good reminder that teams are made out of people. It’s good to look at the daily standups less as a technical management tool and more as a need to get into the work.

https://tidyfirst.substack.com/p/standups-individual-teammate



Bye for now!

Thursday, 11 July 2024

OPC UA: Programming against Type Descriptions

OPC UA client code that relies on hardcoded NodeIds is brittle and often only works with a specific OPC UA server instance. This article shows the proper way to write robust and portable OPC UA client code.

Continue reading OPC UA: Programming against Type Descriptions at basysKom GmbH.

Wednesday, 10 July 2024

Hi there! The past few weeks have been really busy with my final exams, so I had to slow down my work. Here’s a brief status report on my progress over the past 4 weeks:

I created a SubtitleEvent class to help us better manage subtitle event information, which can replace the original SubtitledTime class. To distinguish subtitles from different layers, I also added basic display support for subtitle layers as multiple subtitle tracks.

Currently, I’m focused on refining these features. There are still some minor tasks to complete and bugs to fix. You can find more information at this MR.

Stay tuned!

Monday, 8 July 2024

The second maintenance release of the 24.05 series is out.

Sunday, 7 July 2024

I have a very.. unusual notetaking and task setup with Kate, using Orgmode files. I wanted to showcase it and explain how it works, maybe someone else has similar needs.

Here's a small screenshot of my journal notes, I blurred out some things I didn't want to share.

Screenshot of my Journal 2024 org mode notes where many items are blurred out

Why OrgMode?

I actually prefer markdown much more. I enjoy writing markdown files and it just works in most editors. However, there is zero markdown note taking apps on android, that allow me to sync from my nextcloud and have notifications.

I write very journal style notes. I have one big journal file (used to be a file per day before), where I write down all the interesting things that happened, plus most importantly, my work tasks.

I tried to use calendar with tasks before.. But theres way too much context switching between notetaking apps, calendars, tasks (and on android you have to have two apps for tasks and calendar!!!). I was drowning in various apps and windows, constantly hopping around..

All I wanted to do was write down a task in my journal, then have that task notify me on my phone and on my desktop whenever it was scheduled.

So eventually I found an app called Orgzly Revived. It lets me take the outline style notes where everything is a bulletpoint, with tasks and such, timers, repeats.. And it has the dang phone notifications no other note taking app has. So it's perfect. Works awesome for my needs.

Only thing is that it requires Orgmode files. Okay, I can do that. I first used Logseq with both markdown and orgmode files, but it's quite slow app, even on my nice PC. And no notifications on mobile of course.

I then realised that I am trying to overcomplicate things. I live a lot of my work life in Kate editor, so I decided to start using that. I had to update the Orgmode Kate syntax file a bit to make it work better for me (it's been upstreamed now yay), but other than that it works really nicely.

And why not Emacs? I need an editor, not an OS. Well, jokes aside, I am just not really into learning yet another tool for something like note taking. Last time I tried to set up Neovim config that works for me, I just ended up doing everything in Kate.. I wager same would happen with emacs. I am very happy with Kate, that's all. And I contribute to it now and then, so it just makes sense to use it. :)

Now I just sync all my note files through my Nextcloud to my phone and my computers. I have couple scripts that make figuring out my agenda and have notifications on my PC as well.

My Kate setup

My setup took some time to get together and with couple scripts and snippets it works pretty well.

  • First, you need to git clone https://codeberg.org/akselmo/kate-orgmode.git
    • In there I have couple python and shell scripts, and snippets for Kate
    • You need to create a .venv for it with python -m venv .venv and then pip install -r requirements.txt
    • Check the Readme file for how to use the snippets
  • Create session called Notes.
    • In Plasma, you can just search "Notes" in KRunner and open the Notes session, that just opens the files.
  • Symlink the org mode snippets to ~/.local/share/ktexteditor_snippets/data/ and make sure they work in Kate
    • Snippets are incredibly powerful in Kate, i recommend using them for many things!
    • These snippets automate stuff like "worktask" entries.
    • Unfortunately any timestamps need to be modified by hand, i have not yet had time to make an external tool that spawns a calendar view and spits out a timestamp.
    • For example, "worktask" adds a following item.
* TODO [#ABC] task_name :work:
SCHEDULED: <2024-07-07 Sun 21:12> DEADLINE: <2024-07-07 Sun 21:12>
  :PROPERTIES:
  :CREATED: [2024-07-07 Sun 21:12]
  :product: product
  :kdebug: [[https://bugs.kde.org/show_bug.cgi?id=bugid][bugid]]
  :merge-request: UPDATE_ME
  :END:
  • Add an "external tool" entry for the run-orgagenda.sh item in the files.
    • Set the "Output" setting to "Display in a panel"
    • For the scripts, make sure they're reading right folder (where your notes are)
    • Now you can press ctrl+alt+i and type Org Agenda and it shows you a fun lil overview in a panel of all your items in agenda
  • In your DE's autostart, add the run-orgnotifier.sh script.
    • This will send notification for anything you have set as scheduled or deadline before 30 min, and before/after 5 min of the timestamp.

That should be it for the setup, the code for these scripts is absolutely horrid but you should check that all filepaths match yours etc. I need to clean up the code when I feel like it but honestly it Just Works:tm: for now.. lol.

Journaling?

I have one single file that is called Journal-2024 and I create new journal every year. In this journal file, I prepend new items on top of the file, like this.


* Daily notes 2024-07-07
  :PROPERTIES:
  :CREATED:  [2024-07-07 Sun 21:20]
  :END:
Some notes for this day
** Some specific subnote for this daily note
blabla

* TODO [#A] do this task ples :personal:
SCHEDULED: <2024-07-06 Sat 21:22> DEADLINE: <2024-07-07 Sun 21:23>
  :PROPERTIES:
  :CREATED: [2024-07-05 Fri 21:22]
  :END:
blalbla

* DONE [#B] ancient task :work:
  :PROPERTIES:
  :CREATED: [2000-01-01 someDayIdk 21:23]
  :END:
its been 24 years
#+BEGIN_SRC code
ancient code
#+END_SRC

This means that you can just quickly see all the new items. Also in Kate, there's a handy feature for folding all toplevel nodes when you press ctrl+alt+i so you get just list of all headers. I use it all the time. Folding the nodes only works with the newest ksyntaxhighlighting since i recently updated the orgmode syntax file to support that lol.

Anything else

Any other items go to their respective note files.

For example anything related to programming goes to "Programming notes" file. Then I use tags for those items to categorize them based on language, framework, etc..

Instead of having many small files, I have multiple big files, where I categorize items with tags. I can then easily search for items by typing :tag: in the search field in Kate, and it shows me all items related to that tag. Just, well, remember to tag your items! :D

Wrap up

To wrap it up, this system has made things much easier to remember for me, and I can handle more complicated tasks like repeating workout tasks with my phone. (I can do it in Kate too but it requires manual number changing).

I wouldn't mind changing back to markdown if there was a markdown app for phone that has actual notifications.

Sorry this post is a bit all over the place, but there's really not much more interesting things to share about this. It's just couple scripts reminding me or showing all the items in my agenda, and the rest is snippets in Kate and writing orgmode files.

And I am quite happy with my system. Maybe it'll help you to get some ideas too!

Also please tell me about any markdown note taking apps that have notifications on mobile and desktop, if you know any. You can ping me on fedi, which you can find on my about section.

Thanks for reading!

Saturday, 6 July 2024

Who am I?

I am Ajay Chauhan (IRC: hisir:matrix.org), currently in my second year of undergraduate studies in Computer Science & Engineering. I'll be working on porting Arianna to Foliate-js for my Google Summer of Code project. I have previously worked on Kdenlive as part of the Season of KDE '24.

I hope to help bring the said feature into reality, but also to sharpen my own development skills through real-world projects, contribute back to the open source community and gain more inner confidence.

What am I working on for this year’s GSoC?

Arianna uses epub.js, which is no longer actively maintained. This creates a challenge as the epub.js may not be able to keep up with the evolving standards and new changes. To address this issue, the proposed solution is to port Arianna to the Foliate-js, which is an actively maintained epub renderer and has more features compared to epub.js and is used by the Foliate ebook reader also.

The problem that this project aims to solve is the need for a reliable and up-to-date epub rendering solution for the Arianna ebook reader. By porting Arianna to Foliate-js, the project will ensure that Arianna can continue to provide support for the latest epub standards and features.

My mentors for the project is Carl Schwan, and I appreciate the opportunity to collaborate with and learn from him during this process.

My work done so far

Setting up the development environment

First step was to setup the dev environment, I used Qt Creator for that, it’s fairly easy to set up the development environment.

Reading through existing codebase

The journey began with a thorough review of the existing implementation of epub.js (epub-viewer.js) in Arianna. I identified the features and functionalities that needed to be ported to Foliate-js, understanding how epub.js was used in Arianna for rendering, navigation, and user interactions, and the C++ backend code.

Next, I focused on identifying all the places where epub.js was integrated with Qt in Arianna. This involved comparing the existing implementation with Foliate-js's approach to implementing the same features. To document the changes, I prepared a draft merge request.

Familiarised myself with the current Foliate reader implementation of the foliate-js. However, challenging for me to understand the backend architecture and how different components are interconnected within Foliate-js, requiring additional time to fully grasp the codebase.

Implementing changes

  • Fixing the tricky part of the loading process. I had a hard time wrapping my head around how all the pieces fit together. My mentor helped me in this.

Implemented Table of Contents (TOC) functionality:

const { book } = action.payload;
if (book && book.toc) {
  applicationWindow().contextDrawer.model.importFromJson(
    JSON.stringify(book.toc)
  );
} else {
  console.warn("Book or TOC not available");
}

It takes the TOC data from the book and imports it into the app's context drawer. This way, users can easily access and navigate through the book's structure.

table of contents (TOC) screenshot

Added metadata handling:

const metadata = action.payload.book.metadata;
if (metadata) {
  backend.metadata = metadata;
  root.bookReady(backend.metadata.title);
  Database.addBook(backend.file, JSON.stringify(metadata));
}

Let me break down what this does:

  • First, it grabs the metadata from the book that's been loaded.
  • If there's metadata, it does a few important things:
    • Updates the backend with this new info.
    • Tells the app that the book is ready to go, passing along the title.
    • Stores all this metadata in the database.

metadata showing screenshot

What’s next?

In the following weeks of GSoC, I plan to first to focus on tackling the rendition setup. This is a crucial step - it's what will allow our ebook reader to display the content of ebooks correctly, and also setting the style for the reader. This will involve integrating the Foliate-js rendition module with Arianna's Qt implementation.

Thanks for your reading, stay tuned for updates on my progress via my blog and feel free to connect with me.