Skip to content

Wednesday, 29 December 2021

Some new CSS classes are coming to icons courtesy Janet Blackquill, and I’m excited to cover what exactly this will let icon artists do in 2022! This post is part tutorial and part news. For those looking for a quick TLDR; icons are going to get even better. I’m also going to clear up some inaccuracies in existing documentation (which I plan on updating at some point later)

CSS?

For those unfamiliar, vector icons in KDE can have a stylesheet which embeds several useful colours which update along with the system palette. If you want to make icons that adapt in some way you use the colours in these sheets. If you open an SVG icon from Breeze in a standard text editor you might come across something vaguely like this:

<style id="current-color-scheme" type="text/css">
    .ColorScheme-Text { color:#4d4d4d; }
    .ColorScheme-Background { color:#eff0f1; }
    .ColorScheme-Highlight { color:#3daee9; }
    .ColorScheme-ViewText { color:#31363b; }
    .ColorScheme-ViewBackground { color:#fcfcfc; }
    .ColorScheme-ViewHover { color:#93cee9; }
    .ColorScheme-ViewFocus{ color:#3daee9; }
    .ColorScheme-ButtonText { color:#31363b; }
    .ColorScheme-ButtonBackground { color:#eff0f1; }
    .ColorScheme-ButtonHover { color:#93cee9; }
    .ColorScheme-ButtonFocus{ color:#3daee9; }
</style>

Note that the <style> tag has an id of “current-color-scheme”. This is how we identify which <style> tag contains our adaptive colours.

When using Inkscape you can use the “Selectors and CSS” dialog available under the Object menu to see these special styles:

When you have a something selected you can set the fill or stroke to “currentColor” and use the “+” button to add a CSS class. Things that apply to the selected element are on the left, and a list of all classes found in the image are on the right. Here’s the important part: the classes in this list are a lie! First and foremost, some icons have extra CSS classes listed that don’t actually work when used as an icon, and of course, some new ones are missing. You can’t “preview” how an icon will look with Inkscape alone, so to see what actually works there’s applications like Cuttlefish or Ikona which can provide an accurate view of your work. In terms of quickly making sure you have the correct palette in an icon, I recommend using a text editor and replacing the style with the “id” of “current-color-scheme” with the style below:

<style id="current-color-scheme" type="text/css">
    .ColorScheme-Text         { color: #232629; }
    .ColorScheme-Background   { color: #eff0f1; }
    .ColorScheme-Highlight    { color: #7ec9f0; }
    .ColorScheme-PositiveText { color: #27ae60; }
    .ColorScheme-NeutralText  { color: #f67400; }
    .ColorScheme-NegativeText { color: #da4453; }
    .ColorScheme-ActiveText   { color: #3daee9; }
    .ColorScheme-Complement   { color: #ffffff; }
    .ColorScheme-Contrast     { color: #000000; }
</style>

You may notice several colours are very different. Let’s start with what’s missing; ColorScheme-ViewText, ColorScheme-ViewBackground, ColorScheme-ViewHover, ColorScheme-ViewFocus, ColorScheme-ButtonText, ColorScheme-ButtonBackground, and ColorScheme-ButtonHover are gone. I don’t know much about why these are used as often as they are, if they ever worked, or what, but they’re no longer active and when I was double checking to ensure I don’t feed anyone misinformation I found some bugs where they were meant to be used but… don’t work. So, for now, we’ll ignore what doesn’t actually exist.

In terms of what does exist, here’s a list of the available colours from the above style code and what you can expect behaviourally, along with my own observations:

  • ColorScheme-Text; it’s the same colour as text on a standard window. This usually means it’s near-white or near-black, but expect some colour schemes to add some saturation, such as a red theme making text pink. The opposing colour to Text is Background. For modern use it’s a good contrast colour, and works really well for monochrome icons paired with text.
  • ColorScheme-Background; Same as the background colour of a standard window. Background has fewer use-cases, and generally it’s recommended you use transparency instead of this.
  • ColorScheme-Highlight; This was the first method of using the increasingly popular accent colour in icons, but colour schemes generally mix the accent colour with the background colour dulling the result to a degree. If you want the exact accent colour read on to ActiveText. Highlight is still great when you want to use the accent colour but you don’t want it to be overly strong.
  • ColorScheme-PositiveText/ColorScheme-NeutralText/ColorScheme-NegativeText; Generally these are green, orange, and red respectively. Some schemes do change these a bit so if you want “guaranteed” colours such as green, these are not appropriate. Instead use them as their labels imply, as positive to negatively associated colours. These are used often in monochrome icons. If working on full-colour icons and you’re representing a common system component or generic things these can be used as well for light flavour, such as debris in a trash can, but it’s recommended use be kept to a minimum.
  • ColorScheme-ActiveText; this is one of the 3 newly added colours to icons, and is the new recommended way of using accent colours in icons if you want the exact colour. Unlike Highlight, ActiveText is an unmodified accent colour directly set by the user. It can be just about anything from sky blue to hot pink to grey.
  • ColorScheme-Complement and ColorScheme-Contrast; These are the other two new colours, and are a little bit special. Unlike every other colour set by the scheme, Complement and Contrast are guaranteed to be pure black or pure white. If the colour scheme is dark Compliment will be black and Contrast will be white, and if the scheme is light Compliment will be white and Contrast will be black. There are several use-cases for these, mainly for allowing icons to re-shade themselves for light/dark environments, or for providing outlines. Often icon artists relied on Text and Background for “shading”, but with schemes like Quartz or Afterglow you’d see situations where icons would be “stained” in unwanted ways. Now we have a much more reliable pair of values which won’t create muddy results.

How We’ll Use These New Classes

The new colours added a few possibilities. ColorScheme-ActiveText is pretty straightforward, giving us the user-defined accent. If you have an icon theme and are using accent colours via Highlight, ActiveText will get you the more vibrant and untarnished accent colour. Beyond that Compliment and Contrast are pulling a few duties in the upcoming icon refresh, so I’ll cover them in more detail.

First we’re using ColorScheme-Contrast for bottom shadows/highlights. In dark mode it gives icons a soft under-light, and light mode it’s a standard shadow. Previously we used Text for this, and it worked, but Contrast is just better for this now. Where it’s really nice is helping define the silhouette of the icon.

For folders we’re mixing in a very small amount of Contrast over top the accent colour for just a very tiny amount of “pop” without being obnoxious about it. This also helps guarantee a minimal amount of contrast between the accent colour and the background.

We’re using ColorScheme-Compliment for decals and overlays. We get nice dark-on-dark or light-on-light designs, but we don’t suffer from decals looking “muddy” anymore as we used the Background colour where we now use Compliment.

For comparison here’s the same folder using the new CSS under previously unfavourable circumstances with a red-on-red-on-red scheme, the folder on the left using previously available colours and the folder on the right using the three new colours. Before the new colours I was ready to chalk it up to “don’t use terrible themes” but now everyone can safely use the very worst colour schemes on the planet and still have usable and attractive icons.

Beyond the new colours, work is continuing on the refreshed icons. There’s been a great deal of feedback and many icons are being fine-tuned. The pipeline tools are evolving as well, having had a significant refactor which greatly improved the tool all-around.

Tuesday, 28 December 2021

Unfortunately, the configuration at the and of this post does not work for Wayland Qt applications, like konsole, kate. A colleage from KDE Brazil telegram channel pointed me to a working solution.

Update 28/12/2021: the configuration below works for X11/XWayland applications only.

Going forward with migrating to Wayland. There are several smalls things to fix in my setup, one of them is adding a custom layout to workaround the fact that my child broken the Up key of my laptop's keyboard. I had mapped F9 to Up using $HOME/.Xmodmap, which does not work in Wayland. I have figure out how to that in Wayland [1] [2] and maybe this can help other people.

Create this file to configure XDG_CONFIG_HOME variable:

# /etc/profile.d/xdg.sh
export XDG_CONFIG_HOME=$HOME/.config

Create the $HOME/.config/xkb/rules/evdev.xml

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE xkbConfigRegistry SYSTEM "xkb.dtd">

<xkbConfigRegistry version="1.1">

  <layoutList>

    <layout>

      <configItem>

        <name>lvs</name> <!-- Change to any name you want -->

        <shortDescription>Layout LVS</shortDescription> <!-- Same here -->

        <description>Layout com F8, F9 e F10 remapeadas</description> <!-- Any description you want -->

        <countryList>

          <iso3166Id>US</iso3166Id> <!-- Add your country to this list -->

          <iso3166Id>BR</iso3166Id> <!-- My country: Brazil -->

        </countryList>

        <languageList>

          <iso639Id>eng</iso639Id> <!-- Layout language -->

          <iso639Id>por</iso639Id> <!-- Brazilian Portuguese -->

        </languageList>

      </configItem>

    </layout>

  </layoutList>

</xkbConfigRegistry>


Create a file $HOME/.config/xkb/symbols/lvs (the file name have to match the layout name in evdev.xml) with the actual changes you need. I just copied the file with the symbols I wanted to change to save time:

cp /usr/share/X11/xkb/symbols/srvr_ctrl $HOME/.config/xkb/symbols/lvs

Then I removed all lines that should not be changed. The final file is the following (the actual changes are in bold):

partial function_keys

xkb_symbols "fkey2vt" {

    key <FK08> {

        type="CTRL+ALT",

        symbols[Group1]= [ Prior, F8, F8, F8, XF86_Switch_VT_8 ]

    };

    key <FK09> {

        type="CTRL+ALT",

        symbols[Group1]= [ Up, Prior, F9, F9, XF86_Switch_VT_9 ]

    };

};

Comparing all this to the .Xmodmap it seems way more complicated :-( This is my .Xmodmap:

! 74 = F8 

keycode 74 = Prior                                            

! 75 = F9                                  
keycode 75 = Up Prior

You need to restart startplasma-wayland so the changes take affect. The best part is that it also works with X11, so I removed my .Xmodmap.

PS: the Up key does not work in konsole to show the previous command when running in wayland, even with an external keyboard with a physical Up key. That works in X11.

Monday, 27 December 2021

This year konsole kept the momentum it gained in 2020, and implemented quite a lot of userful new features. We Finally implemented Reflow, thanks to the combined effort of me and Carlos Alves - that was one of the most requested features of konsole for the entire history of the project.

Ahmad Samir fixed tons of issues in konsole, all around the codebase, he's the person with most commits on konsole this year, praise to him.

Sunday, 26 December 2021

A common papercut in a Wayland session is entries in the task manager showing a generic Wayland icon instead of the proper application icon. Here’s a KWallet window having a generic icon in the task manager (on the right):

Task manager with generic Wayland icon on the right

This is due to the shell not being able to properly map a window to an application. This breaks more things than just icons, but those are often the first thing that is noticed. Fortunately this is usually very easy to fix, particularly for Qt/KDE apps. I fixed a couple of those over the holidays and now I am writing down what needs to be done so you know what to do the next time you encounter such a case.

Window to application mapping is based on the desktop entry name. That is the filename of the application’s .desktop file in /usr/share/applications/ (without the .desktop extension). For KWallet that would be org.kde.kwalletd5. Make sure your application actually has such a .desktop file installed to /usr/share/applications/. Most graphical apps have one, otherwise you wouldn’t be able to lauch it from the application launcher. However things that are not traditional applications, like services (e.g. KWallet) or helper applications (e.g. the Gwenview importer) don’t always have one yet. To avoid those showing up in the application laucher include NoDisplay=true in the .desktop file.

Now all we need to do is make sure that the window correctly reports the name of the .desktop file to the compositor. For Qt applications that boils down to making sure that QGuiApplication::desktopFileName() is correct. This can be as easy as calling QGuiApplication::setDesktopFileName("org.kde.kwalletd5"). For applications using KAboutData it can even be easier. If you have a KAboutData data("kwalletd5", ...) then QGuiApplication::desktopFileName() will automatically be set to org.kde.kwalletd5. The underlying heuristic can go wrong at times, in which case you need to override it using QGuiApplication::setDesktopFileName(). With those two things fixed KWallet shows a proper taskbar icon now:

Task manager with proper icon on the right

See my next post for more detail on why mapping windows to desktop files is important.

Happy fixing!

Saturday, 25 December 2021

I have given a try on wayland and it works in my notebook (Gigabyte p34v5) when using only the Intel gpu (/dev/dri/card0) and mesa. Now I have been trying to make it work with the Nvidia gpu (GeForce GTX 970M, /dev/dri/card1) using proprietary driver. The thing about that gpu is that is uses optimus and thus need the following command to work with X11:

# /usr/share/sddm/scripts/Xsetup file
xrandr --setprovideroutputsource modesetting NVIDIA-0

There is just a blank screen on sddm whithout that command (the Nvidia gpu is not physically connected to the display, it needs the Intel gpu to send image to any display, the command above connects the Nvidia gpu to the Intel one). Since xrandr does not work with wayland I am kind of stuck trying figure out the equivalent of that command for wayland. I have tried the following environment variable to no avail:

WLR_DRM_DEVICES=card1:card0

My current startwayland.sh script is:

# card0: intel
# card1: nvidia
export WLR_DRM_DEVICES=card1:card0
export KWIN_DRM_DEVICES=/dev/dri/card1:/dev/dri/card0
export XDG_RUNTIME_DIR=/tmp/1001
export XDG_SESSION_TYPE=wayland
export QT_QPA_PLATFORM=wayland
export GBM_BACKEND=nvidia-drm
export __EGL_VENDOR_LIBRARY_FILENAMES=/usr/share/glvnd/egl_vendor.d/10_nvidia.json:/usr/share/glvnd/egl_vendor.d/50_mesa.json
export EGL_PLATFORM=wayland
export EGL_LOG_LEVEL=debug
export QT_LOGGING_RULES="kwin*=true"
export KWIN_GL_DEBUG=1
export WAYLAND_DEBUG=1
unset DISPLAY
mkdir -m 0700 -p $XDG_RUNTIME_DIR

if [ -n "$DBUS_SESSION_BUS_ADDRESS" ]; then
    export $(dbus-launch)
    sleep 1
fi


kwin_wayland --xwayland --exit-with-session=konsole 2>&1 | tee -a kwin_wayland_log.txt

I am using kwin_wayland instead of plasma-wayland so less programs are started during my tests.

EGL is correctly initialized on both gpu by what can be seen on kwin_wayland_log.txt, though nvidia-drivers uses version 1.5 and mesa uses version 1.4.

The first relevant error is "kwin_wayland_drm: swapping buffers failed on output KWin::DrmOutput(0x559b35fd8d30, name="eDP-1", geometry=QRect(0,0 1920x1080), scale=1)". eDP-1 is my laptop's LCD and W2486 is an external monitor.

There is no screen update after I launch kwin_wayland similar to what happens with X11 without the xrandr command. I need to log through ssh to 'chvt' to a different virtual terminal or kill kwin_wayland to use laptop again. I guess I just need to instruct kwin_wayland to connect the output of nvidia gpu to intel's one to make everything work. I just do not know how to do that.

My environment:

x11-drivers/nvidia-drivers-495.46-r10:0/495 to use Nvidia's new GBM support instead of EGLStream
gui-libs/egl-wayland-1.1.9:0
gui-libs/eglexternalplatform-1.1:0
media-libs/mesa-21.3.2:0
dev-qt/qtwayland-5.15.2-r16:5/5.15.2 with patch Don't block in QWaylandDisplay::flushRequests
kde-plasma/kwin-9999:5 this is a git build of commit 445946382379b65701259bc1f75c92227348db31 from Dec 15 2021 so I can use platforms/drm: use gbm with NVidia driver 495+.

Have someone successfully run plasma-wayland with nvidia's optimus and gbm instead of EGLStream?
I know it has been a while since our last update, but I can assure you that we have not been twiddling our thumbs! For the holiday season, we are happy to bring a new release of Kalendar, which we have worked hard on to bring new features, better performance, and a bunch of bugfixes … Continue reading "Happy holidays! Kalendar v0.4.0 is our gift, and it brings new views, improved performance, and many many bugfixes – Kalendar devlog 24"

Friday, 24 December 2021

Let’s go for my web review for the week 2021-51.


The metaverse has a groping problem already

Tags: tech, facebook, metaverse, ethics

Well… that didn’t last long before such disgusting behaviors appeared there. Now will companies seriously tackle the issues? Or will it be the same joke as content moderation on Facebook?

https://www.technologyreview.com/2021/12/16/1042516/the-metaverse-has-a-groping-problem/


Google’s Manifest V3 Still Hurts Privacy, Security, and Innovation

Tags: tech, web, browser, google, mozilla

Or why browser monoculture is bound to become more and more of an issue. Sad to see Mozilla’s weak response to this move. Can’t bite the hand that feeds I guess.

https://www.eff.org/deeplinks/2021/12/googles-manifest-v3-still-hurts-privacy-security-innovation


MS Teams: 1 feature, 4 vulnerabilities | Positive Security

Tags: tech, microsoft, security

Well… I already didn’t trust it much before, now this is getting really concerning.

https://positive.security/blog/ms-teams-1-feature-4-vulns


Linux Has Grown Into A Viable PC Gaming Platform And The Steam Stats Prove It

Tags: tech, valve, linux, gaming

It’s just amazing how much Valve has accomplished for the gaming ecosystem on Linux.

https://hothardware.com/news/linux-a-viable-pc-gaming-platform-steam-stats-prove-it


Introducing fuite: a tool for finding memory leaks in web apps

Tags: tech, web, frontend, memory, debugging

Since the tooling is still far from great for web frontend memory analysis, it’s nice to see some effort there.

https://nolanlawson.com/2021/12/17/introducing-fuite-a-tool-for-finding-memory-leaks-in-web-apps/


A Whole Website in a Single HTML File

Tags: tech, web, frontend, css, html

Now this is indeed a very clever CSS trick!

https://css-tricks.com/a-whole-website-in-a-single-html-file/


My productivity app is a single .txt file

Tags: productivity, low-tech

Interesting, simple productivity system.

https://jeffhuang.com/productivity_text_file/


Planning for Momentum - Increment

Tags: tech, project-management, estimates, planning

This is a good piece. Killing all planning is indeed not a good thing. Setting plans in stone wasn’t a good thing either, it’s no reason to go to the other extreme.

https://increment.com/planning/planning-for-momentum/



Bye for now!

Monday, 20 December 2021


https://phabricator.kde.org/source/latte-dock/

Hello everyone,

As the title implies from now on Plasma LookNFeel packages can contain and apply Latte Layouts. What that means is that distros and designers can include their latte layouts inside their own Plasma LookNFeel package and Plasma will auto adjust everything in order to load or unload the latte layout. The relevant approved merged reguest can be found here.
 
 
Requirements
 
For this to work you need:
  • Latte Dock >= 0.10.6
  • Plasma Desktop >= 5.24.0
 
 
Users
 
From users point of view only thing needed is:
  • Go to Plasma SystemSettings → Appearance → Global Theme
  • Install your Plasma LookNFeel package
  • Check option "Use desktop layout from theme"
  • Apply it in your system.
 
What will happen is that Latte will automatically switch to the provided layout. In case the looknfeel package does not contain any latte layout then we can guess that Latte is not needed and for that reason is closed. You can of course restart Latte afterwards if you want to.

The Latte approach is pretty safe concerning your data and your layouts. When you apply a new layout through LookNFeel packages then your current latte layout is not removed or touched at all, it just remains inactive with the same name and you can reenable it whenever you want to from Latte Layouts Editor.



Designers / Distros
 
To include your latte layout file in your looknfeel package you can do the following:
  • Export your latte layout through: Right click Dock → Layouts Edit Layouts... Choose your favorite layout Export Export As Template...
  • Rename the exported layout file to : looknfeel.layout.latte
  • Include your looknfeel.layout.latte file inside the layouts folder of your looknfeel package
  • you are ready...
 
If you want to autodownload Latte Indicators through you LookNFeel packages like you do for your qml applets, icon themes etc. you can do so but you will need at least Latte 0.11.0 for this to work properly. You can reference your custom online latte indicators with:
  •  X-KPackage-Dependencies=kns://latte-indicators.knsrc/api.kde-look.org/1297196
    [unity latte indicator case]
 
 
Donations

You can find Latte at Liberapay,     Donate using Liberapay


or you can split your donation between my active projects in kde store.
-----
 
* archive has been signed with gpg key: 325E 97C3 2E60 1F5D 4EAD CF3A 5599 9050 A2D9 110E

 

Saturday, 18 December 2021

qml-lsp

I worked on fancying up qml-lsp's underlying infrastructure and added some new features. One of the more noticeable things is that attached properties can complete now:

screenshot of completing an attached property

There's also some lints:

screenshot of linting warning about an unused import

Currently there's some lints warning against usage of language features that negatively impair readability, (with statements, alias, etc.), warning about using anchors in a Layout, and unused imports.

Shades

Shades is a small utility app I made that lets you grab shades of a colour.

screenshot of shades

It uses the OKLAB colour space to generate shades, which means it produces really good variations on a colour that only differ in visual brightness instead of going “off-brand” like other colour spaces would have.

Tok

Yeah, Tok just has the “saved messages” room display as such instead of using your account's name and avatar. Not much, which is why it's getting lumped in here instead of in its own blog post.

Tags: #libre

Wayland, the future after X11
#

Since years Wayland based compositors are promoted as the successors to the venerable X.org X11 display server.

In the embedded space it seems Wayland already has made a lot of progress and some distributions start to use it per default, too.

My experience of the past years
#

I tried Wayland over the last few years multiple times, but I most often needed to go back to X11 due to random crashes/displaying issues/… (independent of the compositor, I tried a few). I just had always bad luck with the drivers and Wayland. On top of that came issues in the remaining stack, too.

Unfortunately, as long as my setup didn’t run Wayland at all in any stable way, I didn’t really spend a lot of time to actually debug/fix issues even in Kate or KTextEditor. It’s just easier to scratch your own itch then to invest time in stuff you not use yourself at all.

My experience end of 2021
#

Two months ago, I tried Wayland once more on my Arch Linux machine after some short journey to FreeBSD ;)

And great, it worked out of the box. Not random crashing of the compositor, no strange fractals on my second screen, all fine.

Now that I can use KDE Plasma & Kate on my normal machine on Wayland every day, I started to get more drive to take a look at remaining Wayland issues.

Aleix Pol Gonzalez & David Edmundson did a fantastic job to help out with remaining issues.

Naturally, not all is perfect for Kate on Wayland, e.g. you still get with each start some

qt.qpa.wayland: Wayland does not support QWindow::requestActivate()

indicating not all kinds of window activation work as intended at the moment.

But the 21.12 release of Kate should at least have the most obvious issues fixed.

I use now the KDE Plasma Wayland session as my daily driver since two months without any large issues. I not once had a compositor crash nor any strange displaying issues.

As mentioned above, still small issues remain to be fixed for Kate (and for sure for other applications, too).

But beside Chromium & Wine (even sandboxed as extra user) that still run via XWayland all other parts run native.

Thanks to all people that worked on this to make it happen. I really was impressed after I gave Wayland a try again how well all parts nowadays work together. Let’s continue to improve that in the next years even more!

My current KDE Plasma on Wayland session ;=)
#

Even Wine based gaming in parallel to coding is possible, awesome!

Try it out!
#

I can encourage all to give Wayland a try, if you are on some up-to-date distribution like Arch Linux. At least on my mid-class AMD graphics card Wayland works flawless with the open-source driver. Naturally the experience can differ for other setups, like it did for me in the past.

Help out!
#

If you encounter issues, please report them as bug reports to the respective upstream projects. And naturally, any help in fixing them would be welcome, too. For Kate/KTextEditor I might be able to at least reproduce and try to fix them now myself, given I use it now daily, thought other projects might rely more on external contributors to get the rough edges fledged out.

Feedback
#

You can provide feedback on the matching Reddit post.