<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Plasma on KDE Blogs</title><link>https://blogs.kde.org/categories/plasma/</link><description>Recent content in Plasma on KDE Blogs</description><generator>Hugo -- gohugo.io</generator><language>en</language><lastBuildDate>Tue, 31 Mar 2026 18:04:10 +0300</lastBuildDate><atom:link href="https://blogs.kde.org/categories/plasma/index.xml" rel="self" type="application/rss+xml"/><item><title>Streamline Plasma with Activities to be more focused and productive</title><link>https://blogs.kde.org/2026/01/17/streamline-plasma-with-activities-to-be-more-focused-and-productive/</link><pubDate>Sat, 17 Jan 2026 00:00:00 +0000</pubDate><author>Tracey Clark</author><guid>https://blogs.kde.org/2026/01/17/streamline-plasma-with-activities-to-be-more-focused-and-productive/</guid><description>&lt;p&gt;Have you seen Activities in your system settings and wondered what they're used for? Have you read about them them in a blog post and wanted to know more? Have you been interested in giving them a try, but weren't sure where to start? This is where I was once upon a time, so I'd like to share how I've set up Activities to streamline my workflows. Maybe this can help others who also want to experiment. The experience hasn't always been smooth. Due to various bugs, there was one point where I threw up my hands and migrated everything back to virtual desktops in anger. Eventually, the bugs were fixed, and other improvements were made. I gave them another try and I'm glad I did. Many thanks to the contributors who fixed those bugs and who maintain this awesome feature! Today, Activities are now an integral part of my Plasma setup.&lt;/p&gt;
&lt;h2 id="activities-but-i-already-have-virtual-desktops"&gt;Activities? But I already have Virtual Desktops!&lt;/h2&gt;
&lt;p&gt;When I first discovered this &amp;quot;Activities&amp;quot; thing, I had no idea what it was, really. I was already using Virtual Desktops, what did Activities do that they couldn't? It wasn't until I found a few blog posts explaining the fundamentals that I got it. Activities are meant for different workflows a.k.a. contexts (not just tasks within one). At the most basic level:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Virtual Desktops&lt;/strong&gt;, a.k.a. Workspaces, separate different tasks within a context / workflow / project. For instance, when doing KDE work, I might have the bug tracker and docs opened in a browser on Workspace1, and then on Workspace2 have a terminal and code editor. These are things related to the context of &amp;quot;KDE work&amp;quot;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Activities&lt;/strong&gt; are meant for a higher level of separation based on a particular workflow or project. Some examples would be Work, Finances, Gaming, Development or Streaming. They can be added, changed and deleted in Settings -&amp;gt; Activities or in the Activities Manager (Meta+Q by default).&lt;/p&gt;
&lt;h3 id="benefits-for-organization-and-speeding-up-getting-into-a-workflow"&gt;Benefits for organization and speeding up getting into a workflow&lt;/h3&gt;
&lt;p&gt;Each Activity can have a set of applications, widgets and linked files. You can tailor these to a workflow / context / project. You can quickly switch between them with keyboard shortcuts or the Activities Manager.&lt;/p&gt;
&lt;p&gt;For me, they make it much easier to launch the tools I need, and maintain focus on the task at hand. My brain is context-driven, so this helps me keep track of where things are and avoid getting lost in a sea of stuff. My brain is also sometimes easily distracted. Having only the shortcuts and applications I need front of me helps me maintain focus.&lt;/p&gt;
&lt;h2 id="so-what-can-i-actually-do-with-activities-that-i-cant-already-do-with-virtual-desktops"&gt;So what can I actually do with Activities that I can't already do with Virtual Desktops?&lt;/h2&gt;
&lt;p&gt;Most folks already know that with Virtual Desktops, you can place different windows on specific or all desktops (Wayland has more flexibility than X11 here). Of course, this can be used to separate workflows, and there are plenty of people using them this way. That's the beauty of Plasma, you can make it fit your individual needs. Here are some things Activities allows for that Virtual Desktops do not.&lt;/p&gt;
&lt;p&gt;Starting with the System Settings - Activities page, you can choose to enable or disable, for each:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Track file and app usage (disable for privacy, on a Financial Activity, for example)&lt;/li&gt;
&lt;li&gt;Automatically turn the screen off (disable when gaming, presenting, streaming, etc.)&lt;/li&gt;
&lt;li&gt;Automatically shut down or sleep the system (disable when gaming, presenting, streaming etc.)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Then, for these features, you can choose one Activity, multiple, or all.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Place different application windows (ex: your code editor on a Programming Activity) by launching it in that activity.&lt;/li&gt;
&lt;li&gt;Pin an application to the task manager or in Favorites in the app menu (ex: your accounting software on a Financial Activity)&lt;/li&gt;
&lt;li&gt;Desktop icons can be associated per Activity (Go to Settings -&amp;gt; Wallpaper -&amp;gt; Location and select &amp;quot;Files linked to current activity&amp;quot;. This can be set per activity!)&lt;/li&gt;
&lt;li&gt;Open an app in an activity (ex: opening your accounting software only on a Financial Activity, or a media player in all) with window rules&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Additionally, for each Activity, you can have different wallpapers and widgets per Activity. This allows me to see, at a glance, which Activity is active and easily launch things.&lt;/p&gt;
&lt;h2 id="use-cases"&gt;Use cases&lt;/h2&gt;
&lt;p&gt;Here are some ways you can use Activities, and how I've found them helpful.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Separate your work stuff from your personal stuff
Since I work from home, this helps me shift from my &amp;quot;at work&amp;quot; mindset to &amp;quot;at home&amp;quot;. I much prefer this to relying on the old 45 minute commute ;)&lt;/li&gt;
&lt;li&gt;Keep focus on the current task and context&lt;br&gt;
I can avoid being distracted by stuff not related to what I'm doing at the moment by keeping things separated. While working on KDE bug triage, for instance, I won't be distracted by stuff that's not related. As much. Squirrel.&lt;/li&gt;
&lt;li&gt;Keep sensitive information from being accidentally displayed until you want it to be
One day, at a coffee shop, I realized that I didn't want people around me to necessarily see shortcuts like &amp;quot;Budget&amp;quot;. I created a Financial Activity to keep sensitive information related to financial stuff hidden unless specifically switching to it.&lt;/li&gt;
&lt;li&gt;A sparse Activity for presentations / recording / streaming&lt;br&gt;
It could have nothing shown outside of the specific needs for that context. This not only avoids showing things to strangers you would prefer not to, it keeps your environment looking tailored.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="how-i-organize-my-stuff-by-context"&gt;How I organize my stuff by context&lt;/h2&gt;
&lt;p&gt;I have five Activities. All except the first one are configured to only show files related to the activity on the desktop.&lt;/p&gt;
&lt;p&gt;Things common to all via pinned task manager icons:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Kate session chooser&lt;/li&gt;
&lt;li&gt;Note widgets&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Favorites and Quick Launch widgets per Activity:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Personal&lt;/strong&gt; - All the stuff that isn't specific to anything else (general browsing, emails, etc).&lt;br&gt;
No specific shortcuts, just a Weather widget on the desktop for my home city.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;KDE&lt;/strong&gt; - Where I focus on bug related work, MR testing, and such.&lt;br&gt;
Favorites include a KDE Obsidian vault, Firefox KDE profile and a Discord client.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Solus&lt;/strong&gt; - Volunteer work for packaging and distro coordination.&lt;br&gt;
Favorites: Solus Obsidian vault and Vivaldi (it works better with Jitsi Meet than Firefox).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Financial&lt;/strong&gt; - Budgeting, accounting, etc.&lt;br&gt;
Favorites: an Obsidian vault and KMyMoney.
There's a QuickLaunch widget containing links to a few folders, documents and spreadsheets.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Conference&lt;/strong&gt; - Conference tasks and notes.
Favorites: (you guessed it) a Travel Obsidian Vault.
Weather widget set to the city I'll be in.&lt;br&gt;
If speaking, I might have shortcuts to relevant documents and presentations.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id="ramping-up-a-workflow-using-the-kde-activity"&gt;Ramping up a workflow using the KDE Activity&lt;/h2&gt;
&lt;p&gt;To briefly illustrate efficiently getting into a workflow, I'll describe using my KDE Activity. It's based on my multi-screen setup at home. When I'm traveling and only have a single laptop display, applications are spread out across different Virtual Desktops as well.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Thunderbird email and Nheko chat have automatically started at login (through Session Saving). Using kwin window rules, they run on all Activities.&lt;/li&gt;
&lt;li&gt;I open a music app via a Favorite (pinned on all Activities) and start playing music, which helps me focus. It has window rules to display on all Activities, so I can control it from wherever.&lt;/li&gt;
&lt;li&gt;Then I launch applications from Favorites that are only on this Activity:
&lt;ul&gt;
&lt;li&gt;A Discord client for work chat&lt;/li&gt;
&lt;li&gt;An Obsidian Notes vault for KDE (kwin rules also set position and size)&lt;/li&gt;
&lt;li&gt;Firefox with my KDE profile. It has specific bookmarks, as well as tabs for a time tracker, the KDE bug tracker, Invent, specific bugs and merge requests I need to test etc.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;And now I'm ready to start working.&lt;/p&gt;
&lt;h2 id="going-further----combining-virtual-desktops-and-activities"&gt;Going further - Combining Virtual Desktops and Activities&lt;/h2&gt;
&lt;p&gt;As I mentioned above, sometimes I also use Virtual Desktops to segregate different tasks per context. For instance, in my KDE Activity, I might have VDs for:
Communication - email, chat
Development - terminal, code editor
Documentation - browser, notes app&lt;/p&gt;
&lt;h2 id="wrapping-up"&gt;Wrapping up&lt;/h2&gt;
&lt;p&gt;These are some ways you can customize Activities. Hopefully, you can see how they might streamline your own desktop and help your workflows be more efficient.&lt;/p&gt;
&lt;h2 id="technical-notes---making-shortcuts-for-specific-firefox-profiles-and-obsidian-vaults"&gt;Technical notes - making shortcuts for specific Firefox profiles and Obsidian vaults&lt;/h2&gt;
&lt;h3 id="firefox"&gt;Firefox&lt;/h3&gt;
&lt;p&gt;Open Firefox with &lt;code&gt;firefox -p&lt;/code&gt; to gain access to the profile picker. Use one of the profile names in your shortcut. In the menu editor, for example, after copying and pasting the default entry, change the Arguments:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;%u -p profile_name
&lt;/code&gt;&lt;/pre&gt;&lt;h3 id="obsidian"&gt;Obsidian&lt;/h3&gt;
&lt;p&gt;To create a shortcut to an Obsidian Notes vault, I copied the default &lt;code&gt;.desktop&lt;/code&gt; file to &lt;code&gt;~/.local/share/applications/&lt;/code&gt; and changed it to load the vault by name:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;Exec=/usr/bin/flatpak run --branch=stable --arch=x86_64 --command=obsidian.sh --file-forwarding md.obsidian.Obsidian @@u %u @@ &amp;#39;obsidian://open?vault=vaultname&amp;#39;
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Then, I customized the icon through the Menu Editor.&lt;/p&gt;
&lt;p&gt;To find the location of the default &lt;code&gt;.desktop&lt;/code&gt; file on your system:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Find Obsidian Notes in the application menu&lt;/li&gt;
&lt;li&gt;Right click, and click Edit Application&lt;/li&gt;
&lt;li&gt;Right click the entry in the Menu Editor and click &amp;quot;Open Containing Folder&amp;quot;&lt;/li&gt;
&lt;/ol&gt;</description></item><item><title>Going all-in on a Wayland future</title><link>https://blogs.kde.org/2025/11/26/going-all-in-on-a-wayland-future/</link><pubDate>Wed, 26 Nov 2025 00:01:00 +0000</pubDate><author>The Plasma Team</author><guid>https://blogs.kde.org/2025/11/26/going-all-in-on-a-wayland-future/</guid><description>&lt;p&gt;Well folks, it’s the beginning of a new era: after nearly three decades of KDE desktop environments running on X11, the future KDE Plasma 6.8 release will be Wayland-exclusive! Support for X11 applications will be fully entrusted to Xwayland, and the Plasma X11 session will no longer be included.&lt;/p&gt;
&lt;p&gt;For most users, this will have no immediate impact. The vast majority of our users are already using the Wayland session, it’s the default on most distributions, and some of them have already dropped — or are planning to drop — the Plasma X11 session independently of what we decide.&lt;/p&gt;
&lt;p&gt;In the longer term, this change opens up new opportunities for features, optimizations, and speed of development.&lt;/p&gt;
&lt;p&gt;Because we’re certain that many people will have questions about this change, the Plasma team has prepared the following FAQ:&lt;/p&gt;
&lt;h2 id="plasma-68-means-the-x11-session-will-be-supported-by-kde-until"&gt;Plasma 6.8 means the X11 session will be supported by KDE until…?&lt;/h2&gt;
&lt;p&gt;The Plasma X11 session will be supported by KDE into early 2027.&lt;/p&gt;
&lt;p&gt;We cannot provide a specific date, as we’re exploring the possibility of shipping some extra bug-fix releases for Plasma 6.7. The exact timing of the last one will only be known when we get closer to its actual release, which we expect will be sometime in early 2027.&lt;/p&gt;
&lt;h2 id="what-if-i-still-really-need-x11"&gt;What if I still really need X11?&lt;/h2&gt;
&lt;p&gt;This is a perfect use case for long term support (LTS) distributions shipping older versions of Plasma. For example, AlmaLinux 9 includes the Plasma X11 session and will be supported until sometime in 2032.&lt;/p&gt;
&lt;h2 id="will-x11-applications-still-work"&gt;Will X11 applications still work?&lt;/h2&gt;
&lt;p&gt;Outside of rare special cases, yes, they will still work using the Xwayland compatibility layer. It does a great job of providing compatibility for most X11 applications, and we provide several additional compatibility features on top, namely improved support for fractional scaling and (opt-in) backwards compatibility with X11 global shortcuts and input emulation.&lt;/p&gt;
&lt;p&gt;In certain cases, 3rd-party applications doing specialized tasks like taking screenshots or screencasting need to be adjusted to work as expected on Wayland. Most have already done so, and the remaining ones are making progress all the time.&lt;/p&gt;
&lt;h2 id="does-x11-forwarding-still-work"&gt;Does X11 forwarding still work?&lt;/h2&gt;
&lt;p&gt;Yes, Xwayland supports it. Waypipe exists for similar functionality in Wayland native applications as well.&lt;/p&gt;
&lt;h2 id="can-i-still-run-kde-applications-on-x11-in-another-desktop-environment"&gt;Can I still run KDE applications on X11 in another desktop environment?&lt;/h2&gt;
&lt;p&gt;Yes. There are currently no plans to drop X11 support in KDE applications outside of Plasma.&lt;/p&gt;
&lt;p&gt;This change only concerns Plasma’s X11 login session, which is what’s going away.&lt;/p&gt;
&lt;h2 id="what-about-gaming"&gt;What about gaming?&lt;/h2&gt;
&lt;p&gt;Games run better than ever on the Wayland session! Adaptive sync, &lt;em&gt;optional&lt;/em&gt; tearing, and high-refresh-rate multi-monitor setups are all supported out of the box. HDR gaming works with some additional setup, too!&lt;/p&gt;
&lt;h2 id="what-about-nvidia-gpus"&gt;What about NVIDIA GPUs?&lt;/h2&gt;
&lt;p&gt;While Wayland support in the proprietary NVIDIA driver was quite rocky a few years ago, it has matured tremendously. Graphics cards still supported by the manufacturer work just fine nowadays, and for very old NVIDIA GPUs, the open source Nouveau driver can be used instead.&lt;/p&gt;
&lt;h2 id="what-about-accessibility"&gt;What about accessibility?&lt;/h2&gt;
&lt;p&gt;Accessibility is a very broad topic, so it’s hard to make any definite statements, but we’re generally on par with the X11 session. All the basics already work as expected, including screen readers, sticky &amp;amp; bounce keys, zooming in, and so on.&lt;/p&gt;
&lt;p&gt;Some things are better, like touchpad gestures for adjusting the zoom level, and applying systemwide color filters to correct for colorblindness. And even more improvements are expected by the time Plasma 6.8 rolls around.&lt;/p&gt;
&lt;p&gt;However, accessibility features provided by third-party applications may be worse in some aspects. Please open a bug report if you have any special requirements that we don’t cover yet! This is an active topic we’re very interested in improving.&lt;/p&gt;
&lt;h2 id="what-about-automation"&gt;What about automation?&lt;/h2&gt;
&lt;p&gt;Many tools can be used for automation in the Wayland session; for example &lt;code&gt;wl-copy&lt;/code&gt;/&lt;code&gt;wl-paste&lt;/code&gt;, &lt;code&gt;ydotool&lt;/code&gt;, &lt;code&gt;kdotool&lt;/code&gt;, &lt;code&gt;kscreen-doctor&lt;/code&gt;, and the &lt;code&gt;plasma-apply-*&lt;/code&gt; tools. Generally Plasma is extensible enough that you can add what’s still missing yourself, for example through KWin scripts or plugins.&lt;/p&gt;
&lt;h2 id="what-about-the-significant-known-issues"&gt;What about the &lt;a href="https://community.kde.org/Plasma/Wayland_Known_Significant_Issues"&gt;Significant Known Issues&lt;/a&gt;?&lt;/h2&gt;
&lt;p&gt;While we can’t promise all problems will be completely gone (some depend on application support), we’re actively working on addressing the last stragglers on that Wiki page.&lt;/p&gt;
&lt;p&gt;Some of them are really close to being fixed; for example, the issues around output mirroring will be gone in Plasma 6.6. Session restore and remembering window positions are also being actively worked on.&lt;/p&gt;
&lt;h2 id="what-about-plasma-on-the-bsds"&gt;What about Plasma on the BSDs?&lt;/h2&gt;
&lt;p&gt;FreeBSD is already shipping a working Wayland session, so there should be no upstream problems on that front. If there are any remaining issues we can help with upstream, please reach out to us!&lt;/p&gt;
&lt;h2 id="what-about-the-kwin_wayland-and-kwin_x11-split"&gt;What about the kwin_wayland and kwin_x11 split?&lt;/h2&gt;
&lt;p&gt;In Plasma 6.4, we &lt;a href="https://blog.vladzahorodnii.com/2025/03/13/kwin_x11-and-kwin_wayland-split/"&gt;split KWin into separate X11 and Wayland versions&lt;/a&gt;. This allowed KWin to go all-in on Wayland earlier, without being held up so much with legacy support for X11. For users with remaining edge-case requirements for X11, we put in the extra effort to keep X11 support for the rest of the desktop since then.&lt;/p&gt;
&lt;p&gt;While the split helped a lot, KWin is only one piece of the puzzle. The Plasma desktop as a whole has many places where development is held back by the need to support the lowest common denominator of the two window systems.&lt;/p&gt;
&lt;h2 id="the-bottom-line"&gt;The bottom line&lt;/h2&gt;
&lt;p&gt;This is happening because we believe that eventually dropping the Plasma X11 session will allow us to move faster to improve stability and functionality for the majority of our users — who are already using Wayland.&lt;/p&gt;
&lt;p&gt;If we want to keep producing the best free desktop out there, we have to be nimble enough to adapt to a rapidly changing environment with many opportunities, without the need to drag forward legacy support that holds back a great deal of work.&lt;/p&gt;
&lt;p&gt;The Wayland transition has been long, and at times painful. But we’re very close to the finish line. Passing it will unlock a lot of positive changes over the next few years that we think folks are going to appreciate!&lt;/p&gt;</description></item><item><title>Revisiting X11 vs Wayland With Multiple Displays</title><link>https://blogs.kde.org/2025/06/02/revisiting-x11-vs-wayland-with-multiple-displays/</link><pubDate>Mon, 02 Jun 2025 00:00:00 +0000</pubDate><author>Tracey Clark</author><guid>https://blogs.kde.org/2025/06/02/revisiting-x11-vs-wayland-with-multiple-displays/</guid><description>&lt;h2 id="the-things-i-do-for-qa"&gt;The things I do for QA...&lt;/h2&gt;
&lt;p&gt;A few years ago, I was among those who found Wayland too painful to use every day. Over time, I gave Wayland a try now and then. It finally got usable enough for me to switch to as my default a couple of years ago.&lt;/p&gt;
&lt;p&gt;Recently, during the soft freeze before the Plasma 6.4 Beta was released, I used mainly X11 on both my laptops - for science! And by science, I mean regression testing. I was curious what the experience was like compared to what I've become accustomed to with Wayland.&lt;/p&gt;
&lt;p&gt;In short, Wayland supports multiple displays and color so much better. It was painful using X11 again.&lt;/p&gt;
&lt;h2 id="my-setup-for-daily-work"&gt;My setup for daily work&lt;/h2&gt;
&lt;p&gt;I was using two laptops and two external monitors. Both were running Plasma built from git-master.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Main: Dell XPS laptop, plugged into a dock. This is connected to 2 ultrawide monitors - one via Displayport, the other via HDMI.&lt;/li&gt;
&lt;li&gt;Secondary: Lenovo Flex laptop, usually just using its built-in screen. Sometimes I swap the right hand monitor over to it, for testing display shenanigans.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id="initial-impression---so-limited"&gt;Initial impression - so limited&lt;/h2&gt;
&lt;p&gt;I fired up the XPS, did updates, and booted into an X11 session. Next, to Display Configuration to re-enable the right hand monitor (disabled the night before). Immediately, I was struck by how bare the settings window looks compared to Wayland. Here are screenshots of the settings for same HDR monitor on 6.3.5.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Wayland:&lt;/strong&gt;&lt;/p&gt;
&lt;figure&gt;
 &lt;img class="img-fluid" src="https://blogs.kde.org/2025/06/02/revisiting-x11-vs-wayland-with-multiple-displays/display_config_wayland.jpeg"
 style="max-width: 100%; height: auto"
 /&gt;
&lt;/figure&gt;
&lt;p&gt;&lt;strong&gt;X11:&lt;/strong&gt;&lt;/p&gt;
&lt;figure&gt;
 &lt;img class="img-fluid" src="https://blogs.kde.org/2025/06/02/revisiting-x11-vs-wayland-with-multiple-displays/display_config_x11.jpeg"
 style="max-width: 100%; height: auto"
 /&gt;
&lt;/figure&gt;
&lt;h2 id="second-thoughts-and-hello-dr-konqi"&gt;Second thoughts and hello, Dr Konqi&lt;/h2&gt;
&lt;p&gt;Time to enable the display. For reference, this takes moments in Wayland. It was just a wee bit longer and more fraught with X11.&lt;/p&gt;
&lt;p&gt;After enabling the monitor and clicking Apply, all 3 screens went dark. After about 20s the laptop display came on. After about another minute, the right hand display finally got output before all 3 displays were dark again. I unplugged the laptop from the dock. It came up to the login screen. After logging in I saw the good Dr Konqi telling me there was a crash in plasmashell. We were off to a great start.&lt;/p&gt;
&lt;p&gt;Like a good tester, I sent the crash report off. With some trepidation, I plugged the docking cable back in, as similar struggles from years past came back to haunt me. All three displays were black, although I could move the cursor around in them. It took a good couple of minutes for plasmashell to display everything, along with window decorations and panel contents. It was faster later, but wow, was this a noticeably worse experience than Wayland.&lt;/p&gt;
&lt;h2 id="other-observations-or-third-thoughts"&gt;Other observations, or third thoughts&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Wayland advantages&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Fractional scaling - the ability to have a screen at, say, 110% zoom. See that lovely screenshot, above.&lt;br&gt;
When paired with how easy it is to change font face and style, this is great for accessibility. Being able to read the text on any display at whatever resolution can't be overstated. When I have to use Windows, where you can't adjust text separately from resolution, I have sadness. I also have eyestrain trying to read tiny text in dialogs.&lt;/li&gt;
&lt;li&gt;Scaling per display - so my laptop's high resolution display can be at 150% and my external displays at 100% to make things readable on all of them. Another plus for accessibility.&lt;/li&gt;
&lt;li&gt;HDR and color profile (ICC) support. This is important for getting the mos out of my monitor with games and more. Also... preeeetty.&lt;/li&gt;
&lt;li&gt;Snappier overall performance (on my systems).&lt;/li&gt;
&lt;li&gt;The ability to send a window to multiple desktops, or just one. In X11, you can ....THNG&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Wayland pain points&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;These are the things I ran into personally. There's also the list of &lt;a href="https://community.kde.org/Plasma/Wayland_Known_Significant_Issues"&gt;Plasma/Wayland Known Significant Issues&lt;/a&gt;.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The most annoying problem for me is with LibreOffice, since I use Calc almost daily. There's a &lt;a href="https://bugs.documentfoundation.org/show_bug.cgi?id=141578"&gt;bug&lt;/a&gt; (on their tracker) where, with multiple monitors with different scale factors, UI elements are too big.&lt;/li&gt;
&lt;li&gt;Lack of a robust, easy to use text expander with a GUI - that actually works out of the box. Autokey has been on my installs for many years, used for work and personal stuff. While it launches, and I have access to my phrases, there's no actual text expansion. There's an &lt;a href="https://github.com/autokey/autokey/issues/87"&gt;open issue for Wayland support&lt;/a&gt; (that pre-dates the Pandemic) but it hasn't gotten much traction. I've been keeping an eye out for years for a decent replacement, and have tried a few things but not found what I'm looking for, yet.&lt;/li&gt;
&lt;li&gt;Copy and paste to and from VMs
I use VMs a lot for testing things on different Linux distros. My workaround for this is to have text files saved in a directory that's shared from host to guest.&lt;/li&gt;
&lt;li&gt;It took time and a few forks to get KVM software that was reliably developed and worked with Wayland.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; I had been using &lt;code&gt;barrier&lt;/code&gt; on X11. A few software forks and experiments later, I've settled on &lt;code&gt;deskflow&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;X11 Advantages&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Remembering window positions across reboots.&lt;/li&gt;
&lt;li&gt;Working text expansion.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;X11 pain points&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Drawing the screen is slower after logging in or restarting plasmashell, for example, with the same hardware and open applications.&lt;/li&gt;
&lt;li&gt;Floating panels and adaptive opacity are known to cause performance issues with X11 with an NVIDIA GPU.&lt;/li&gt;
&lt;li&gt;Lack of scaling per-monitor.&lt;br&gt;
Text on my XPS's screen is too small to be readable if the external monitors are at a comfortable scale. I had to move any window I needed to read text on (most of them) to the external monitors.&lt;/li&gt;
&lt;li&gt;The HDMI monitor was set to the wrong resolution and refresh rate if I connected it to the second laptop. I had to manually correct it.&lt;/li&gt;
&lt;li&gt;After enabling HDR on that monitor with the Flex in Wayland, and switching to an X11 session, the monitor enabled HDR but the colors were over-saturated.&lt;/li&gt;
&lt;li&gt;After working with a few windows, fonts in Firefox became badly hinted. This made characters look weirdly colored instead of white / black, and made reading things difficult.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="final-thoughts"&gt;Final thoughts&lt;/h2&gt;
&lt;p&gt;Once upon a time, Wayland was too painful for me to use as a daily driver. It didn't support some of my utilities and it wasn't stable enough with my multi-monitor setup.&lt;/p&gt;
&lt;p&gt;These days, Wayland is so much more usable and stable with multiple displays that it makes using X11 painful by comparison. While there are still those few issues I mentioned, I feel Wayland's advantages outweigh them.&lt;/p&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;The KVM software journey... The first one I used was &lt;a href="https://symless.com/synergy"&gt;Synergy&lt;/a&gt;, which was &lt;em&gt;amazing&lt;/em&gt; to me. Being able to use the same keyboard and mouse on both a Linux laptop and Windows desktop &lt;em&gt;at the same time&lt;/em&gt; was &lt;em&gt;magic&lt;/em&gt;. Unfortunately, Synergy took their UI in directions I didn't like. An open source fork named &lt;a href="https://github.com/debauchee/barrier"&gt;&lt;code&gt;barrier&lt;/code&gt;&lt;/a&gt; emerged, which aimed to restore the simplicity I was looking for, so I switched to it. This served me for a long time, but development stopped in 2021. With the advent of Wayland, &lt;code&gt;barrier&lt;/code&gt; was forked to &lt;a href="https://github.com/input-leap/input-leap"&gt;&lt;code&gt;input-leap&lt;/code&gt;&lt;/a&gt; which implemented Wayland support. Sadly, development seems to have languished. There is yet another project, &lt;a href="https://github.com/deskflow/deskflow"&gt;&lt;code&gt;deskflow&lt;/code&gt;&lt;/a&gt;, which is also free and open source. It's sponsored by the Synergy folks. We end where we began.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>kcursorgen and SVG cursors</title><link>https://blogs.kde.org/2025/01/12/kcursorgen-and-svg-cursors/</link><pubDate>Sun, 12 Jan 2025 08:00:00 +0000</pubDate><author>Jin Liu</author><guid>https://blogs.kde.org/2025/01/12/kcursorgen-and-svg-cursors/</guid><description>&lt;p&gt;In the latest Plasma 6.3 Beta, you will find a new executable named &lt;code&gt;kcursorgen&lt;/code&gt; in &lt;code&gt;/usr/bin&lt;/code&gt;. It can convert an &lt;a href="https://blog.vladzahorodnii.com/2024/10/06/svg-cursors-everything-that-you-need-to-know-about-them/"&gt;SVG cursor theme&lt;/a&gt; to the XCursor format, in any sizes you like. Although this tool is intended for internal use in future Plasma versions, there are a few tricks you can play now with it and an SVG cursor theme.&lt;/p&gt;
&lt;p&gt;(Unfortunately, the only theme with the support that I know, besides Breeze, is &lt;a href="https://github.com/catppuccin/cursors"&gt;Catppuccin&lt;/a&gt;. I have this &lt;a href="https://github.com/jinliu/svg-cursor/tree/main/build-svg-theme"&gt;little script&lt;/a&gt; that might help you convert more cursor themes.)&lt;/p&gt;
&lt;h2 id="requirements"&gt;Requirements&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;The &lt;code&gt;qt6-svg&lt;/code&gt; library.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;xcursorgen&lt;/code&gt; command, usually found in &lt;code&gt;xorg-xcursorgen&lt;/code&gt; package.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id="trick-1-cursors-at-any-size-you-like"&gt;Trick 1: Cursors at any size you like&lt;/h2&gt;
&lt;p&gt;You should be able to set any cursor size with SVG cursors, right? Well, not at the moment, because:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Only those apps using the Wayland cursor shape protocol would be using SVG cursors. Other apps still use the XCursor format, with a limited list of sizes.&lt;/li&gt;
&lt;li&gt;Plasma's cursor setting UI hasn't been updated to allow arbitrary sizes.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;But we can do it manually with &lt;code&gt;kcursorgen&lt;/code&gt;. Take Breeze for example:&lt;/p&gt;
&lt;h3 id="step-1-make-a-copy-of-the-theme"&gt;Step 1: Make a copy of the theme&lt;/h3&gt;
&lt;p&gt;First, copy the cursor theme to your home directory. And let's change the directory name, so the original one is not overriden:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mkdir -p ~/.local/share/icons
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;cp -r /usr/share/icons/breeze_cursors ~/.local/share/icons/breeze_cursors.my
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then open &lt;code&gt;~/.local/share/icons/breeze_cursors.my/index.theme&lt;/code&gt; in the editor. Change the name in &lt;code&gt;Name[_insert your locale_]=&lt;/code&gt; so you can tell it from the original in the cursor settings.&lt;/p&gt;
&lt;h3 id="step-2-regenerate-the-xcursor-files"&gt;Step 2: Regenerate the XCursor files&lt;/h3&gt;
&lt;p&gt;For example, if we want a size 36 cursor, and the display scale is 250%:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; ~/.local/share/icons/breeze_cursors.my
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;rm -r cursors/
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;kcursorgen --svg-theme-to-xcursor --svg-dir&lt;span class="o"&gt;=&lt;/span&gt;cursors_scalable --xcursor-dir&lt;span class="o"&gt;=&lt;/span&gt;cursors --sizes&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="m"&gt;36&lt;/span&gt; --scales&lt;span class="o"&gt;=&lt;/span&gt;1,2.5,3
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Some Wayland apps don't support fractional scaling, so they will round the scale up. So we need to include both 2.5 and 3 in the scale list.&lt;/p&gt;
&lt;p&gt;The above command generates XCursor at size 36, 90 and 108. Note that the max size of the original Breeze theme is 72, so this is something not possible with the original theme.&lt;/p&gt;
&lt;p&gt;(&lt;code&gt;kcursorgen&lt;/code&gt; also adds paddings when necessary, to satisfy alignment requirements of some apps / toolkits. E.g., GTK3 requires cursor image sizes to be multiple of 3 when the display scale is 3. So please use &lt;code&gt;--sizes=36 --scales=1,2.5,3&lt;/code&gt;, not &lt;code&gt;--sizes=36,90,108 --scales=1&lt;/code&gt;, because only the former would consider alignments.)&lt;/p&gt;
&lt;p&gt;Then you can go to &lt;code&gt;systemsettings - cursor themes&lt;/code&gt;, select your new theme, and choose size 36 in the dropdown.&lt;/p&gt;
&lt;p&gt;(Yes, you can have HUGE cursors without shaking. Size 240.)
&lt;figure&gt;
 &lt;img class="img-fluid" alt="Yes, you can have HUGE cursors without shaking" src="https://blogs.kde.org/2025/01/12/kcursorgen-and-svg-cursors/huge-cursor.png"
 style="max-width: 100%; height: auto"
 /&gt;
&lt;/figure&gt;
&lt;/p&gt;
&lt;h2 id="trick-2-workaround-for-the-huge-cursor-problem-in-gtk4"&gt;Trick 2: Workaround for the huge cursor problem in GTK4&lt;/h2&gt;
&lt;p&gt;&lt;a href="https://blogs.kde.org/2024/10/09/cursor-size-problems-in-wayland-explained/"&gt;As explained before&lt;/a&gt;, Breeze theme triggers a bug in GTK4 when global scaling is used, resulting in huge cursors. It's because Breeze's &amp;quot;nominal size&amp;quot; (24) is different from the image size (32).&lt;/p&gt;
&lt;p&gt;We can work around this problem by changing the nominal size to 32.&lt;/p&gt;
&lt;p&gt;Step 1 is same as above. Then we modify the metadata:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; ~/.local/share/icons/breeze_cursors.my
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;find cursors_scalable/ -name &lt;span class="s1"&gt;&amp;#39;metadata.json&amp;#39;&lt;/span&gt; -exec sed -i &lt;span class="s1"&gt;&amp;#39;s/&amp;#34;nominal_size&amp;#34;: 24/&amp;#34;nominal_size&amp;#34;: 32/g&amp;#39;&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;{}&amp;#39;&lt;/span&gt; &lt;span class="se"&gt;\;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;rm -r cursors/
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;kcursorgen --svg-theme-to-xcursor --svg-dir&lt;span class="o"&gt;=&lt;/span&gt;cursors_scalable --xcursor-dir&lt;span class="o"&gt;=&lt;/span&gt;cursors --sizes&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="m"&gt;32&lt;/span&gt; --scales&lt;span class="o"&gt;=&lt;/span&gt;1,1.5,2,2.5,3
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then you can go to &lt;code&gt;systemsettings - cursor themes&lt;/code&gt;, select your new theme, and choose size 32 in the dropdown. Cursors in GTK4 apps should be fixed now.&lt;/p&gt;
&lt;h2 id="extra-idea-for-distro-maintainers-reduce-cursor-theme-package-size-to-110"&gt;Extra idea: (For distro maintainers) reduce cursor theme package size to 1/10&lt;/h2&gt;
&lt;p&gt;It might be possible to only package the &lt;code&gt;index.theme&lt;/code&gt; file and &lt;code&gt;cursors_scalable&lt;/code&gt; directory for the Breeze cursor theme (and other SVG cursors themes), then in an postinstall script, use &lt;code&gt;kcursorgen&lt;/code&gt; to generate the &lt;code&gt;cursors&lt;/code&gt; directory on the user's machine.&lt;/p&gt;
&lt;p&gt;This would greatly reduce the package size. And also you can generate more sizes without worrying about blown package size.&lt;/p&gt;
&lt;p&gt;But the fact that &lt;code&gt;kcursorgen&lt;/code&gt; is in the &lt;code&gt;breeze&lt;/code&gt; package might make some dependency problems. I have an &lt;a href="https://github.com/jinliu/svg-cursor/tree/main/svg-theme-to-xcursor"&gt;standalone Python script&lt;/a&gt; that does the same. (But it requires Python and PySide6.)&lt;/p&gt;</description></item><item><title>Limit Application Memory Usage with systemd</title><link>https://blogs.kde.org/2024/10/18/limit-application-memory-usage-with-systemd/</link><pubDate>Fri, 18 Oct 2024 10:00:00 +0000</pubDate><author>Jin Liu</author><guid>https://blogs.kde.org/2024/10/18/limit-application-memory-usage-with-systemd/</guid><description>&lt;p&gt;I saw this &lt;a href="https://discuss.kde.org/t/how-to-limit-memory-size-used-by-specific-application-in-kde/23565"&gt;question on KDE forum&lt;/a&gt; about how to limit memory usage of a specific application in KDE, using systemd specifically. I did some research on that.&lt;/p&gt;
&lt;h2 id="resource-control-in-systemd"&gt;Resource control in systemd&lt;/h2&gt;
&lt;p&gt;&lt;a href="https://www.freedesktop.org/software/systemd/man/latest/systemd.resource-control.html"&gt;man systemd.resource-control&lt;/a&gt; lists plenty of options that we can set to a &lt;em&gt;cgroup&lt;/em&gt;. E.g., to limit the memory usage of a service, we can add:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-ini" data-lang="ini"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="na"&gt;MemoryAccounting&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;yes&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="na"&gt;MemoryHigh&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;2G&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;under the &lt;code&gt;[Service]&lt;/code&gt; section of its &lt;code&gt;.service&lt;/code&gt; file.&lt;/p&gt;
&lt;p&gt;The difference between this and &lt;code&gt;ulimit&lt;/code&gt; is that &lt;code&gt;ulimit&lt;/code&gt; is per process, while systemd resource control is per &lt;em&gt;cgroup&lt;/em&gt;. I.e., the &lt;code&gt;MemoryHigh&lt;/code&gt; is accounted to the sum of both the service process, and all sub-processes it spawns, and even detached processes, i.e., daemons.&lt;/p&gt;
&lt;p&gt;(That's actually the main point of &lt;em&gt;cgroup&lt;/em&gt;: a process tree that a process can't escape via double-forking / daemonizing.)&lt;/p&gt;
&lt;h2 id="apps-as-systemd-services"&gt;Apps as systemd services&lt;/h2&gt;
&lt;p&gt;KDE Plasma launches apps as systemd services. (See &lt;a href="https://systemd.io/DESKTOP_ENVIRONMENTS/"&gt;this doc&lt;/a&gt; and &lt;a href="https://blog.davidedmundson.co.uk/blog/modern-process-management-on-the-desktop/"&gt;this blog&lt;/a&gt; for more details.)&lt;/p&gt;
&lt;p&gt;We can find the name of the systemd service of an app like this:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$ systemd-cgls&lt;span class="p"&gt;|&lt;/span&gt;grep konsole
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;│ │ │ ├─app-org.kde.konsole@0d82cb37fcd64fe4a8b7cf925d86842f.service
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;│ │ │ │ ├─35275 /usr/bin/konsole
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;│ │ │ │ └─35471 grep --color&lt;span class="o"&gt;=&lt;/span&gt;auto konsole
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;But the problem is:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;The part of the name after &lt;code&gt;@&lt;/code&gt; is a random string, changes every time the app is launched.&lt;/li&gt;
&lt;li&gt;The service is generated dynamically:&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$ systemctl --user cat app-org.kde.konsole@0d82cb37fcd64fe4a8b7cf925d86842f.service
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# /run/user/1000/systemd/transient/app-org.kde.konsole@0d82cb37fcd64fe4a8b7cf925d86842f.service&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# This is a transient unit file, created programmatically via the systemd API. Do not edit.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;[&lt;/span&gt;Service&lt;span class="o"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;Type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;simple
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;...
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;So if we want to limit the memory usage of Konsole, there's no persistent &lt;code&gt;.service&lt;/code&gt; file on disk that we can edit.&lt;/p&gt;
&lt;p&gt;Luckily, systemd allows us to create &lt;em&gt;drop-in&lt;/em&gt; files to partially modify a service. Also, systemd considers &lt;code&gt;app-org.kde.konsole@0d82cb37fcd64fe4a8b7cf925d86842f.service&lt;/code&gt; to be instances of a &lt;em&gt;template&lt;/em&gt; named &lt;code&gt;app-org.kde.konsole@.service&lt;/code&gt;. (This is how things like &lt;code&gt;getty@tty3.service&lt;/code&gt; work.) So we can create a drop-in file named &lt;code&gt;~/.config/systemd/user/app-org.kde.konsole@.service.d/override.conf&lt;/code&gt; with the content:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-ini" data-lang="ini"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;[Service]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="na"&gt;MemoryAccounting&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;yes&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="na"&gt;MemoryHigh&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;2G&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;and it will apply to all instances of &lt;code&gt;app-org.kde.konsole@.service&lt;/code&gt;, even if there's no service file with that name.&lt;/p&gt;
&lt;p&gt;(The file doesn't have to be named &amp;quot;override.conf&amp;quot;. Any name with &lt;code&gt;.conf&lt;/code&gt; works.)&lt;/p&gt;
&lt;p&gt;Then we need to reload the systemd user manager: &lt;code&gt;systemctl --user daemon-reload&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Now we can launch Konsole, and check if the memory limit works:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$ systemctl --user show &lt;span class="s1"&gt;&amp;#39;app-org.kde.konsole@*.service&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;|&lt;/span&gt;grep &lt;span class="nv"&gt;MemoryHigh&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;EffectiveMemoryHigh&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="m"&gt;2147483648&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;MemoryHigh&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="m"&gt;2147483648&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;StartupMemoryHigh&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;infinity
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Note: as explained above, the limit applies to the sum of Konsole and all processes it spawns. E.g., if we run &lt;code&gt;kwrite&lt;/code&gt; in Konsole, the memory usage of &lt;code&gt;kwrite&lt;/code&gt; will be accounted to the limit of Konsole, and the limit we set to KWrite won't apply.&lt;/p&gt;
&lt;h2 id="set-defaults-for-all-apps"&gt;Set defaults for all apps&lt;/h2&gt;
&lt;p&gt;We can put defaults in &lt;code&gt;~/.config/systemd/user/app-.service.d/override.conf&lt;/code&gt;, and it will match all services whose name starts with &lt;code&gt;app-&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Alternatively, if we run &lt;code&gt;systemd-cgls&lt;/code&gt;, we can see that all apps are under a node named &lt;code&gt;app.slice&lt;/code&gt;. So we can also put defaults in &lt;code&gt;~/.config/systemd/user/app.slice.d/override.conf&lt;/code&gt;, and all apps will inherit the settings. However, this is different from the previous method, as user services are also under &lt;code&gt;app.slice&lt;/code&gt; by default, so they will also inherit the settings.&lt;/p&gt;</description></item><item><title>Cursor Size Problems In Wayland, Explained</title><link>https://blogs.kde.org/2024/10/09/cursor-size-problems-in-wayland-explained/</link><pubDate>Wed, 09 Oct 2024 09:36:02 +0000</pubDate><author>Jin Liu</author><guid>https://blogs.kde.org/2024/10/09/cursor-size-problems-in-wayland-explained/</guid><description>&lt;p&gt;I've been fixing cursor problems on and off in the last few months. Here's a recap of what I've done, explanation of some cursor size problems you might encounter, and how new developments like &lt;a href="https://wayland.app/protocols/cursor-shape-v1"&gt;Wayland cursor shape protocol&lt;/a&gt; and &lt;a href="https://blog.vladzahorodnii.com/2024/10/06/svg-cursors-everything-that-you-need-to-know-about-them/"&gt;SVG cursors&lt;/a&gt; might improve the situation.&lt;/p&gt;
&lt;p&gt;(&lt;em&gt;I'm by no means an expert on cursors, X11 or Wayland, so please correct me if I'm wrong.&lt;/em&gt;)&lt;/p&gt;
&lt;h2 id="why-dont-we-have-cursors-in-the-same-size-anymore"&gt;Why don't we have cursors in the same size anymore?&lt;/h2&gt;
&lt;p&gt;My involvement with cursors started back in the end of 2023, when KDE Plasma 6.0 was about to be released. A major change in 6.0 was enabling Wayland by default. And if you enabled global scaling in Wayland, especially with a fractional scale like 2.5x, cursor sizes would be a mess across various apps (the upper row: Breeze cursors in Plasma 6.0 Beta 1, Wayland, 2.5x global scale, the lower row: Same cursors in Plasma 6.0):&lt;/p&gt;
&lt;figure&gt;
 &lt;img class="img-fluid" alt="Breeze cursors in Plasma 6.0 Beta 1, Wayland, 2.5x global scale" src="https://blogs.kde.org/2024/10/09/cursor-size-problems-in-wayland-explained/cursor-sizes.png"
 style="max-width: 100%; height: auto"
 /&gt;
&lt;/figure&gt;
&lt;p&gt;So I dug into the code of my favorite terminal emulator, &lt;a href="https://sw.kovidgoyal.net/kitty/"&gt;Kitty&lt;/a&gt;, which at the time drew the cursor in a slightly smaller size than it should be (similar to vscode in the above image). I gained some understanding of the problem, and eventually fixed it. Let me explain.&lt;/p&gt;
&lt;h3 id="how-to-draw-cursors-in-the-same-size-in-different-apps"&gt;How to draw cursors in the same size in different apps?&lt;/h3&gt;
&lt;p&gt;In X11, there used to be &lt;a href="https://tronche.com/gui/x/xlib/appendix/b/"&gt;a standard set of cursors&lt;/a&gt;, but nowadays most apps use &lt;a href="https://www.x.org/releases/X11R7.6/doc/man/man3/Xcursor.3.xhtml"&gt;the XCursor lib&lt;/a&gt; to load a (user-specified) cursor theme and draw the cursor themselves. So in order to have cursors in the same theme and size across apps, we need to make sure that:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Apps get the same cursor theme and size from the system.&lt;/li&gt;
&lt;li&gt;Apps draw the cursor in the same way.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The transition to Wayland created difficulties in both points:&lt;/p&gt;
&lt;h4 id="1-get-the-same-cursor-theme-and-size-from-the-system"&gt;1. Get the same cursor theme and size from the system&lt;/h4&gt;
&lt;p&gt;It used to be simple in X11: we have &lt;code&gt;Xcursor.size&lt;/code&gt; and &lt;code&gt;Xcursor.theme&lt;/code&gt; in &lt;code&gt;xrdb&lt;/code&gt;, also &lt;code&gt;XCURSOR_SIZE&lt;/code&gt; and &lt;code&gt;XCURSOR_THEME&lt;/code&gt; in environment variables. Setting them to the same value would make sure that all apps get the same cursor theme and size.&lt;/p&gt;
&lt;p&gt;But Wayland apps don't use &lt;code&gt;xrdb&lt;/code&gt;, and they interpret &lt;code&gt;XCURSOR_SIZE&lt;/code&gt; differently: in X11, the size is in physical pixels, but in Wayland it's in logical pixels. E.g., if you have a cursor size 24 and global scale 2x, then in X11, &lt;code&gt;XCURSOR_SIZE&lt;/code&gt; should be 48, but in Wayland it should be 24.&lt;/p&gt;
&lt;p&gt;The Wayland way is necessary. Imagine you have two monitors with different DPI, e.g. they are both 24&amp;quot; but monitor A is 1920x1080, while monitor B is 3840x2160. You set scale=1 for A and scale=2 for B, so UI elements would be the same size on both monitors. Then you would also want the cursor to be of the same size on both monitors, which requires it to have 2x more physical pixels on B than on A, but it would be the same logical pixels.&lt;/p&gt;
&lt;p&gt;So Plasma 6.0 no longer sets the two environment variables, because &lt;code&gt;XCURSOR_SIZE&lt;/code&gt; can't be simultaneously correct for both X11 and Wayland apps. But without them and &lt;code&gt;xrdb&lt;/code&gt;, Wayland apps no longer have a standard way to get the cursor theme and size. Instead, different frameworks / toolkits have their own ways. In Plasma, KDE / Qt apps get them from the Qt platform integration plugin provided by Plasma, GTK4 apps from &lt;code&gt;~/.config/gtk-4.0/settings.ini&lt;/code&gt; (also set by Plasma), Flatpak GTK apps from the GTK-specific configs in &lt;a href="https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.portal.Settings.html"&gt;XDG Settings Portal&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The last one is particularly weird, as you need to install &lt;code&gt;xdg-desktop-portal-gtk&lt;/code&gt; in order fix Flatpak apps in Plasma, which surprised many. It might seem like a hack, but it's not. Plasma &lt;a href="https://community.kde.org/Distributions/Packaging_Recommendations"&gt;officially recommends&lt;/a&gt; installing &lt;code&gt;xdg-desktop-portal-gtk&lt;/code&gt;, and this was suggested by GNOME developers.&lt;/p&gt;
&lt;p&gt;But what for 3rd-party Wayland apps besides GTK and Qt? The best hope is to read settings in either the GTK or the Qt way, piggy-backing the two major toolkits, assuming that the DE would at least take care of the two.&lt;/p&gt;
&lt;p&gt;(IMHO either Wayland or the XDG Settings Portal should provide a standard way for apps to get the cursor theme and size.)&lt;/p&gt;
&lt;p&gt;That was part of the problem in Kitty. It used to read settings from the GTK portal, but only under a GNOME session. I changed it to always try to read from the portal, even if under Plasma. But that's not the end of the story...&lt;/p&gt;
&lt;h4 id="2-draw-the-cursor-in-the-same-way"&gt;2. Draw the cursor in the same way&lt;/h4&gt;
&lt;p&gt;It's practically a non-issue in X11, as the user usually sets a size that the cursor theme provides, and the app just draws the cursor images as-is. But if you do set a cursor size not available in the theme (you can't do that in the cursor theme settings UI, but you can manually set &lt;code&gt;XCURSOR_SIZE&lt;/code&gt;), you'll open a can of worms: various toolkits / apps deal with it differently:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Some just use the closest size available (Electron and Kitty at the time), so it can be a bit smaller.&lt;/li&gt;
&lt;li&gt;Some use the &lt;code&gt;XCursor&lt;/code&gt; default size 24, so it's a lot smaller.&lt;/li&gt;
&lt;li&gt;Some scale the cursor to the desired size, and the scaling algorithm might be different, resulting in pixelated or blurry cursors; Also they might scale from either the default size or the closest size available, resulting in very blurry (GTK) or slightly blurry (Qt) cursors.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The situation becomes worse with Wayland, as the user now specifies the size in logical pixels, then apps need to multiply it by the global scale to get the size in physical pixels, and try to load a cursor in that size. (If the app load the cursor in the logical size, then either the app or the compositor needs to scale it, resulting in a blurry / pixelated cursor.) With fractional scaling, it's even more likely that the required physical size is not available in the theme (which typically has only 2~5 sizes), and you see the result in the picture above.&lt;/p&gt;
&lt;h2 id="one-way-to-fix-it-and-why-i-didnt-do"&gt;One way to fix it (and why I didn't do)&lt;/h2&gt;
&lt;p&gt;It can be fixed by moving the &amp;quot;when we can't load cursors in the size we need, load a different size and scale it&amp;quot; logic from apps / toolkits to the XCursor lib. When the app requests cursors in a size, instead of returning the closest size available, the lib could scale the image to the requested size. So apps would always get the cursor in the size they ask for, and their own different scaling algorithms won't get a chance to run.&lt;/p&gt;
&lt;p&gt;Either the default behavior can be changed, or it can be hidden behind a new option. But I didn't do that, because I felt at the time that it would be difficult to either convince XCursor lib maintainers to make a (potentially breaking) change to the default behavior, or to go around convincing all apps / toolkits to use a new option.&lt;/p&gt;
&lt;h2 id="my-fix-or-shall-we-say-workaround"&gt;My fix (or shall we say workaround)&lt;/h2&gt;
&lt;p&gt;Then it came to me that although I can't fix all these toolkits / apps, they seem to all work the same way if the required physical size is available in the theme - then they just draw the cursor as-is. So I &lt;a href="https://invent.kde.org/plasma/breeze/-/merge_requests/380"&gt;added a lot of sizes to the Breeze theme&lt;/a&gt;. It only has size 24, 36 and 48 at the time, but I added physical sizes corresponding to a logical size 24 and all global scales that Plasma allows, from 0.5x to 3x, So it's 12, 18, 24 ... all the way to 72.&lt;/p&gt;
&lt;p&gt;It was easy. The source code of the Breeze theme is SVG (so are most other themes). Then a build script renders it into images using Inkscape, and packages them to XCursor format. The script has a list of the sizes it renders in, so I added a lot more.&lt;/p&gt;
&lt;p&gt;And it worked! If you choose Breeze and size 24, then (as in the bottom row in the picture above) various apps draw the cursor in the same size at any global scale available in Plasma.&lt;/p&gt;
&lt;p&gt;But this method has its limitations:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;We can't do that to 3rd-party themes, as we don't have their source SVG.&lt;/li&gt;
&lt;li&gt;It only works if you choose the default size 24. If you choose a different size, e.g. 36, and a global scale 3x, then the physical size &lt;code&gt;36x3=108&lt;/code&gt; is not available in the theme, and you see the mess again. But we can't add sizes infinitely, as &lt;a href="https://blog.vladzahorodnii.com/2024/10/06/svg-cursors-everything-that-you-need-to-know-about-them/"&gt;explained in Vlad's blog&lt;/a&gt;, the XCursor format stores cursor images uncompressed, so the binary size grows very fast when adding larger sizes.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Both limitations can be lifted with SVG cursors. But before getting to that, let's talk about the &amp;quot;right&amp;quot; way to fix the cursor size problem:&lt;/p&gt;
&lt;h2 id="the-right-fix-wayland-cursor-shape-protocol"&gt;The &amp;quot;right&amp;quot; fix: Wayland cursor shape protocol&lt;/h2&gt;
&lt;p&gt;The simple and reliable way to get consistent cursors across apps is to &lt;em&gt;not let apps draw the cursor at all&lt;/em&gt;. Instead, they only specify the name of the cursor shape, and the compositor draws the cursor for them. This is how &lt;a href="https://wayland.app/protocols/cursor-shape-v1"&gt;Wayland cursor shape protocol&lt;/a&gt; works. Apps no longer need to care about the cursor theme and size (well, they might still need the size, if they want to draw custom cursors in the same size as standard shapes), and since the compositor is the only program drawing the cursor, it's guaranteed to be consistent for all apps using the protocol.&lt;/p&gt;
&lt;p&gt;(It's quite interesting that we seem to went a full circle back to the original server-defined cursor font way in X11.)&lt;/p&gt;
&lt;p&gt;Support for this protocol leaves a lot to improve, though. &lt;a href="https://wayland.app/protocols/cursor-shape-v1#compositor-support"&gt;Not all compositors support it.&lt;/a&gt; On the client side, both Qt and Electron have the support, but GTK doesn't.&lt;/p&gt;
&lt;p&gt;There are &lt;a href="https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/6212"&gt;merge requests&lt;/a&gt; for GTK and Mutter, but GNOME devs request &lt;a href="https://gitlab.freedesktop.org/wayland/wayland-protocols/-/issues/185"&gt;some modifications&lt;/a&gt; in the Wayland protocol before merging them, and the request seems to be stuck for some months. I hope the recent Wayland &amp;quot;things&amp;quot; could move it out of this seemingly deadlock.&lt;/p&gt;
&lt;p&gt;Anyway, with this protocol, only the compositor has to be modified to support a new way to draw cursors. This makes it much easier to change how cursors work. So we come to:&lt;/p&gt;
&lt;h2 id="svg-cursors"&gt;SVG cursors&lt;/h2&gt;
&lt;p&gt;Immediately after the fix in Breeze, I &lt;a href="https://invent.kde.org/plasma/kwin/-/issues/187"&gt;proposed this idea&lt;/a&gt; of shipping the source SVG files of the Breeze cursor theme to the end user, and re-generate the XCursor files whenever the user changes the cursor size or global scale. This way, the theme will always be able to provide the exact size requested by apps. (Similar to the &amp;quot;modify XCursor lib&amp;quot; idea, but in a different way.) It would remove the limitation 2 above (and also limitation 1 if 3rd-party themes ship their source SVGs too).&lt;/p&gt;
&lt;p&gt;With &lt;a href="https://blog.vladzahorodnii.com/2024/10/06/svg-cursors-everything-that-you-need-to-know-about-them/"&gt;SVG cursors support in KWin and Breeze&lt;/a&gt;, I plan to implement this idea. It would also allow the user to set arbitrary cursor size, instead of limited to a predefined list.&lt;/p&gt;
&lt;h2 id="problems-you-might-still-encounter-today"&gt;Problems you might still encounter today&lt;/h2&gt;
&lt;h3 id="huge-cursors-in-gtk4-apps"&gt;Huge cursors in GTK4 apps&lt;/h3&gt;
&lt;p&gt;It's a new problem in GTK 4.16. If you use the Breeze cursor theme and a large global scale like 2x or 3x, you get huge cursors:&lt;/p&gt;
&lt;figure&gt;
 &lt;img class="img-fluid" alt="Huge cursors in GTK4 apps" src="https://blogs.kde.org/2024/10/09/cursor-size-problems-in-wayland-explained/gtk4.png"
 style="max-width: 100%; height: auto"
 /&gt;
&lt;/figure&gt;
&lt;p&gt;It has not limited to Plasma. Using Breeze in GNOME would result in the same problem. To explain it, let me first introduce the concept of &amp;quot;nominal size&amp;quot; and &amp;quot;image size&amp;quot; in XCursor.&lt;/p&gt;
&lt;p&gt;Here is GNOME's default cursor theme, Adwaita:&lt;/p&gt;
&lt;figure&gt;
 &lt;img class="img-fluid" alt="Adwaita cursors" src="https://blogs.kde.org/2024/10/09/cursor-size-problems-in-wayland-explained/adwaita.png"
 style="max-width: 100%; height: auto"
 /&gt;
&lt;/figure&gt;
&lt;p&gt;&amp;quot;Nominal size&amp;quot; is the &amp;quot;cursor size&amp;quot; we are talking about above. It makes the list of sizes you choose from in the cursor theme settings UI. It's also the size you set in &lt;code&gt;XCURSOR_SIZE&lt;/code&gt;. &amp;quot;Image size&amp;quot; is the actual size of the cursor image. &amp;quot;Hot spot&amp;quot; is the point in the image where the cursor is pointing at.&lt;/p&gt;
&lt;p&gt;Things are a bit different in the Plasma default cursor theme, Breeze:&lt;/p&gt;
&lt;figure&gt;
 &lt;img class="img-fluid" alt="Breeze cursors" src="https://blogs.kde.org/2024/10/09/cursor-size-problems-in-wayland-explained/breeze.png"
 style="max-width: 100%; height: auto"
 /&gt;
&lt;/figure&gt;
&lt;p&gt;Unlike Adwaita, the image size is larger than the nominal size. That, combined with a global scale, triggers the bug in GTK4. &lt;a href="https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/7722"&gt;Explanation of the bug.&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;XCursor allows the image size to be different from the nominal size. I don't know why it was designed this way, but my guess is so you can crop the empty part of the image. This both reduces file size, and reduces flicking when the cursor changes (with software cursors under X11). But the image size can also be larger than the nominal size, and Breeze (and a lot of other themes) uses this feature.&lt;/p&gt;
&lt;p&gt;You can see in the above images that the &amp;quot;arrow&amp;quot; of nominal size 24 in Breeze is actually similar in size to the same nominal size in Adwaita. But the &amp;quot;badge&amp;quot; in Breeze is further apart, so it can't fit into a 24x24 image. That's why Breeze is built this way. In a sense, &amp;quot;nominal size&amp;quot; is similar to how &amp;quot;font size&amp;quot; works, where it resembles the &amp;quot;main part&amp;quot; of a character in the font, but some characters can have &amp;quot;extra parts&amp;quot; that go through the ceiling or floor.&lt;/p&gt;
&lt;p&gt;This problem is already fixed &lt;a href="https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/7760"&gt;in the main branch of GTK 4&lt;/a&gt;, but it's not backported to 4.16 yet, probably because the fix uses a Wayland feature that Mutter doesn't support yet. So at the moment, your only option is to use a different cursor theme whose &amp;quot;nominal size&amp;quot; and &amp;quot;image size&amp;quot; are equal.&lt;/p&gt;
&lt;h3 id="smaller-cursors-in-gtk3-apps-most-notably-firefox"&gt;Smaller cursors in GTK3 apps (most notably, Firefox)&lt;/h3&gt;
&lt;p&gt;The cursor code in GTK3 is different from GTK4, with its own limitations. You might find the cursor to be smaller than in other apps, and if you run the app in a terminal, you might see warnings like:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;cursor image size (64x64) not an integer multiple of scale (3)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;GTK3 doesn't support fractional scales in cursors. So if you have cursor size 24 and global scale 2.5x or 3x, it will use a scale 3x and try to load a cursor with a nominal size &lt;code&gt;24x3=72&lt;/code&gt;. And it requires the image size to be an integer multiple of the scale. So if your theme doesn't have a size 72, or it does but the image size is not multiple of 3, GTK3 fallbacks to a smaller unscaled cursor.&lt;/p&gt;
&lt;h2 id="end-words"&gt;End words&lt;/h2&gt;
&lt;p&gt;OK, this is a long post. Hope I can bring you more cursor goodies in Plasma 6.3 and beyond.&lt;/p&gt;</description></item><item><title>A few thoughts on Plasma/Wayland, KWinFT</title><link>https://blogs.kde.org/2020/10/19/few-thoughts-plasmawayland-kwinft/</link><pubDate>Mon, 19 Oct 2020 00:00:00 +0000</pubDate><author>Eike Hein</author><guid>https://blogs.kde.org/2020/10/19/few-thoughts-plasmawayland-kwinft/</guid><description>&lt;p&gt;There's a lot of intense, opinionated debate on the current state of Plasma's Wayland session these days. This seems to be fueled by mainly two events, Fedora's announcement to flip to Wayland by default for version 34 of their KDE variant, and a a recent fork of KWin and a few other components of Plasma, KWinFT.&lt;/p&gt;
&lt;p&gt;On the first, I think it's a great move. Concerns of a repeat of the &amp;quot;shipped before it's ready&amp;quot; situation of early KDE 4 releases aside (for now; more on this in a moment), it certainly feels like it makes sense for Fedora in particular - it's a bold, technology-focused early adopter move, something I think the Fedora user audience generally appreciates the distro for. Plus other Fedora variants default to Wayland already, so there's an appreciable desire to make the various offerings more consistent.&lt;/p&gt;
&lt;p&gt;Distros should understand the user audiences they're trying to cater to, and if a distro believes there's a market for a particular flavor of desktop, it's certainly fine to challenge upstreams to provide the needed software. I think as far as Plasma on Wayland is concerned, the challenge is thoughtfully timed - it's coming after the KDE community &lt;a href="https://community.kde.org/Goals/Wayland"&gt;voted to declare good Wayland support a community-wide goal&lt;/a&gt;, after all. I think there's every reason to believe this decision will lead to good things if the two (and overlapping) communities collaborate to make a good showing. Nice.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;It's 2020, for crying out loud! Why is this taking so long?&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;A lot of us have some things in common. For example, if you're reading this, chances are you are the sort of person who is not indifferent to technological progress, even easily excited by it. Many of us also are also drawn to competition.&lt;/p&gt;
&lt;p&gt;So people really care about how far down the road to Wayland adoption every of the competing projects is, and theories abound on what the comparison says about them. This is set against a backdrop of Wayland also still maturing as an upstream technology, driven forward by the same competing projects working together.&lt;/p&gt;
&lt;p&gt;One particular claim that's been popping into the conversation lately is that Plasma not having the Wayland conversion safely in it's rear-view mirror yet is evidence of a project that's somehow fundamentally flawed, and unable to focus on what matters and make good long-term plans and roadmaps. If you didn't encounter this in one of the heated debates on social media yet it probably sounds a bit breathless to you, or maybe not really worth acknowledging - but it's actually my main reason to write this blog post, because it's an interesting excuse to talk about recent Plasma history!&lt;/p&gt;
&lt;p&gt;Plasma 5.0 was the second large-scale rewrite of KDE's desktop environment offering in a row, meaning both 4.0 and 5.0 had debuted with a lot of new and young lines of code inside them. Both rewrites were motivated by lifting the desktop shell to a newer set of its base technologies - for example major versions of Qt, OpenGL-based UI rendering and so on. Younger code tends to have higher defect rates. At the time, the standard criticisms in online discussions about Plasma went something like this:&lt;/p&gt;
&lt;p&gt;&lt;i&gt;&amp;quot;It looks great, but it's really buggy&amp;quot;&lt;/i&gt;
&lt;i&gt;&amp;quot;I like a lot of the features, but it's missing those last 5% to fit my needs fully&amp;quot;&lt;/i&gt;
&lt;i&gt;&amp;quot;It's resource-heavy and doesn't perform smoothly enough on my machine&amp;quot;&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;And a less concrete one, but nearly as often repeated:&lt;/p&gt;
&lt;p&gt;&lt;i&gt;&amp;quot;It's really coming together now, but I'm already worried about the next major version being another rewrite and making it shaky&amp;quot;&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;The Plasma project paid attention, and made a number of very strategic decisions to set its focus on a set of goals:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;Improve quality across the board by prioritizing bugs and bringing defect rates down&lt;/li&gt;
&lt;li&gt;Go the distance with features, drive them to completion and make them easier and more consistent to use&lt;/li&gt;
&lt;li&gt;Lower the resource needs and scale down to much lower-powered hardware, including ARM SBCs&lt;/li&gt;
&lt;li&gt;If we do additional rewrites of fundamental code (and we ended up replacing major pieces in 5.x point releases, e.g. the entire taskbar, menu and notification systems - each of those quietly addressed dozens of bugs, but went mostly noticed for a few new features), there needs to be a noticeably positive impact on the above metrics&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;This remains the spirit of the Plasma project today, with many activities spanning multiple quarters of a year of work at the service of those goals. Recent examples include the &lt;a href="https://phabricator.kde.org/T10891"&gt;Breeze visual refresh&lt;/a&gt; undertaken by the Visual Design Group, the &lt;a href="http://blog.davidedmundson.co.uk/blog/plasma-and-the-systemd-startup/"&gt;revamp of session init&lt;/a&gt; with optional use of systemd, and the new &lt;a href="https://conf.kde.org/en/akademy2020/public/events/219"&gt;cgroups-loving way of running apps&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;For Plasma on Wayland, this meant: While we strongly believing in the tech, we would take our time to get it right, and not declare the offering ready before it isn't up to par. It also wasn't always the highest-priority development activity going on, with many other steps being simultaneously taken to reach our goals. Reasonable people can (and do) have diverging opinions on the relative prioritization of work, of course, but the path we walked was most definitely a consciously strategic one - one that has lead to the gradual disappearance of those earlier quotes from user feedback we receive, speaking to its execution. Work continues!&lt;/p&gt;
&lt;p&gt;&lt;b&gt;KwinFT&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;One source of these concerns is the &lt;a href="https://gitlab.com/kwinft/kwinft"&gt;KWinFT&lt;/a&gt; project, a recent fork of the compositor service in a Plasma system along with a few choice pieces of support code (e.g. the screen config subsystem).&lt;/p&gt;
&lt;p&gt;KWinFT is a project by &lt;a href="https://subdiff.org/"&gt;Roman Gilg&lt;/a&gt;, a contributor to KWin and KDE in general. Roman will not be shocked by reading this, as we had this discussion a couple of months before he announced the project, as well as recently, but I don't think the fork was necessary, or is a very good idea overall. I think his technical ideas for KWin are interesting, and think there were better options to deliver their value to users and have a bigger impact in the end, e.g. by making more aggressive use of feature/staging branches to prove out subsystem rewrites before merging them up. This is a suggestion I made at the time, too, and I haven't seen anything to change my mind since. We certainly keep talking.&lt;/p&gt;
&lt;p&gt;This is a very personal opinion and speaks to my own style to open source involvement more than anything, which is shaped by the vibe of the KDE community and the KDE mentors and role models I received my education from. I believe in prioritizing user value, and in leadership by aligning diverse talents towards common goals, by being inviting, communicative and persuasive. I really don't believe these options were fully exhausted in this matter, and while I understand that starting a new project can make it easier to try out e.g. some different organizational ideas (and my impression of the fork is that it's really more about those than any actual tech disagreements) without having to do the work of getting others on board, I don't think this ultimately succeeds in bringing improvements to the max number of people who might benefit from them.&lt;/p&gt;
&lt;p&gt;On the tech side, though, it's important to keep the focus of the conversation on Plasma on Wayland as a whole. KWin is an important component of that system, but owing to its &lt;a href="https://blogs.kde.org/2018/08/02/engineering-plasma-extensions-and-stability-%E2%80%94-present-and-future"&gt;multi-process architecture&lt;/a&gt;, it's only one of a fairly large and varied set of codebases that need to complete their porting efforts. Many use cases additionally require coordinated activity across several components (for example: the taskbar, System Settings, ...), and it's also still not too difficult to identify &lt;a href="https://blogs.kde.org/2020/10/11/linux-desktop-shell-ipc-wayland-vs-d-bus-and-lack-agreement-when-use-them"&gt;needed upstream improvements in Wayland&lt;/a&gt; to get over the finish line, some of which the Plasma team is currently &lt;a href="https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/50"&gt;driving forward&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;And no, this isn't stacking features on shaky foundations - most of this work is technically orthogonal (easy to see for the ones that aren't in the same codebase or even project!), and in any case, the more pleasant Plasma's Wayland session becomes to consume, the higher the set of potential contributors exposed to the remaining tasks. Those attention dynamics of open source are fairly reliable :-). In any case, this is perhaps actually my main beef with the technical criticisms coming from the debates surrounding KWinFT - they are myopically focused on KWin and derive from this grander projections, ignoring the full picture of the system and a lot of other heavy-hitting technical activity all throughout it (including some of the projects linked throughout this post). The resulting signal-to-noise ratio is not very engaging overall. &lt;i&gt;KWin != Plasma&lt;/i&gt; is an important constraint to add to them.&lt;/p&gt;</description></item><item><title>Engineering Plasma: Extensions and stability — Present and future</title><link>https://blogs.kde.org/2018/08/02/engineering-plasma-extensions-and-stability--present-and-future/</link><pubDate>Thu, 02 Aug 2018 00:00:00 +0000</pubDate><author>Eike Hein</author><guid>https://blogs.kde.org/2018/08/02/engineering-plasma-extensions-and-stability--present-and-future/</guid><description>&lt;p&gt;This week, we have received a number of inquiries into how Plasma extensions, particularly those found on the &lt;a href="https://store.kde.org/"&gt;KDE Store&lt;/a&gt;, relate to the stability and safety of a Plasma system. With an engineering focus, this blog hopes to provide answers.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Crash Resilience By Process Isolation&lt;/b&gt;&lt;/p&gt;
&lt;center&gt;&lt;img width="500" src="https://i.imgur.com/1k0s5IMr.png" alt="Present-day Plasma process architecture diagram" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;small&gt;&lt;i&gt;Present-day process architecture: Compositor and shell UI are isolated from each other&lt;/i&gt;&lt;/small&gt;&lt;br /&gt;&lt;br /&gt;&lt;/center&gt;
&lt;p&gt;In Plasma, the shell UI and the compositor are isolated into seperate processes (&lt;code&gt;plasmashell&lt;/code&gt; and &lt;code&gt;kwin&lt;/code&gt;, respectively). The two exchange information regulated by IPC mechanisms such as the windowing system (Wayland or X11) and DBus, using standard protocols where suitable and custom-created ones where needed.&lt;/p&gt;
&lt;p&gt;In a Wayland session, it's kwin that plays host to your application clients and puts them on screen (on X11, both KWin and app are clients to the X Server, providing a further isolation - KWin can crash and restart without impacting apps). Shell UI extension live in the seperate plasmashell process.&lt;/p&gt;
&lt;p&gt;In the event that a shell extension crashes the shell, this allows it to be restarted without impacting KWin and therefore without impacting your applications. They continue to run undeterred while the shell takes steps to right itself.&lt;/p&gt;
&lt;p&gt;Beyond crash resilience, putting limits on untrusted code run in the compositor process also has a security dimension. Particularly on Wayland, where one of the design goals is not to allow untrusted code to introspect the windowing system globally.&lt;/p&gt;
&lt;p&gt;Meanwhile, to make KWin ready to taking over for the X Server in a Wayland session, we significantly upgraded our engineering story - requiring and dramatically raising unit test coverage for KWin and related library code, for one.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Process Isolation: Next Steps&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;The architecture discussed above shields applications and the compositor from shell UI extensions, but it doesn't shield the shell. We want to fix that next.&lt;/p&gt;
&lt;center&gt;&lt;img width="500" src="https://i.imgur.com/OgFZWjT.png" alt="Future R&amp;D Plasma process architecture diagram" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;small&gt;&lt;i&gt;Next: Isolate shell UI and extensions, too — individual or batch processes for extensions&lt;/i&gt;&lt;/small&gt;&lt;br /&gt;&lt;br /&gt;&lt;/center&gt;
&lt;p&gt;The always-stunning David Edmundson has been spearheading several engineering efforts to make the shell itself have a multi-process architecture. Some of this has already quietly been shipping in the &lt;a href="https://www.kde.org/announcements/plasma-5.12.0.php"&gt;Plasma 5.12&lt;/a&gt; LTS release: &lt;code&gt;KRunner&lt;/code&gt; plugins, which provide search results in our menus/launchers, can now opt into running out-of-process. We've used this to isolate some of the crash chart-topping plugins, preventing them from taking down the shell when performing a search query.&lt;/p&gt;
&lt;p&gt;Likewise, for shell UI extensions, he has been working on top off the library stack we initially built for the Wayland transition to allow them to be run out of process and then get composited into the shell UI. In addition to making the shell far more resilient to extension crashes, this would also create additional security domains for untrusted extension code - we can build on this to sandbox and drop privileges for them.&lt;/p&gt;
&lt;p&gt;All of this is broadly similar to application architecture improvements pioneered by multi-process web browsers in past years, albeit built squarely to leverage the shared free desktop stack (particularly Wayland and DBus). Unlike what took place in Firefox' project &lt;a href="https://wiki.mozilla.org/Electrolysis"&gt;Electrolysis&lt;/a&gt;, however, we don't see a need to break extension compatibility in our case. For Plasma's extension API scope, we've always taken a conservative demand-based approach instead of allowing extensions free access to all data and code by default. This is paying dividends now, allowing us new shell architecture options while preserving the known, stable API contract it has with its extensions.&lt;/p&gt;
&lt;p&gt;David is set to show off the R&amp;amp;D proof of concept we have working now in &lt;a href="https://conf.kde.org/en/Akademy2018/public/events/66"&gt;his talk&lt;/a&gt; at this year's &lt;a href="https://akademy.kde.org/"&gt;Akademy&lt;/a&gt; conference, which I can't wait to attend. Be sure to also keep your eyes peeled on his &lt;a href="https://blog.davidedmundson.co.uk/"&gt;blog&lt;/a&gt;, where he will dive deeper into the details of this project after the conference excitement.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;In Summary&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Plasma today is architected to prevent shell UI extensions from being able to crash your session and interfere with your apps. We are working to expand on this and prevent extensions from interfering with the shell.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;In Context&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;One of the broad goals of Plasma 5 has been raising &lt;b&gt;quality&lt;/b&gt;. This is a user-driven process. Converting feedback we got during the first generation of Plasma into software, we worked hard to bring Plasma users tangible improvements to speed, resource usage and UI polish (this is by no means over, either). We also already implemented a LTS release process to improve our support story.&lt;/p&gt;
&lt;p&gt;Dove-tailing with the &lt;a href="https://dot.kde.org/2017/11/30/kdes-goals-2018-and-beyond"&gt;KDE community's Goals&lt;/a&gt;, climbing higher on the ladder of safety and security is one of our immediate next ones. Increasing process isolation in Plasma and achieving state of the art crash resilience and sandboxing, a likely first on the desktop, is a concrete engineering expression of this aim.&lt;/p&gt;
&lt;p&gt;Sounds interesting? If you want to be part of a team and a community that keeps pushing the desktop (and &lt;a href="https://www.plasma-mobile.org"&gt;not just the desktop&lt;/a&gt;) forward in the days to come, &lt;a href="https://community.kde.org/Get_Involved"&gt;join us&lt;/a&gt; in one of our &lt;a a href="https://userbase.kde.org/IRC_Channels"&gt;channels&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Of course:&lt;/p&gt;
&lt;center&gt;&lt;img src="https://akademy.kde.org/sites/akademy.kde.org/files/2018/going_to_akademy_banner.jpg" alt="I'm going to Akademy promo picture" /&gt;&lt;/a&gt;&lt;/center&gt;</description></item></channel></rss>