Using Kwin instead of xfwm4

Hi guys, I’m looking into using kwin as the window manager instead of xfwm4 for xfce, to take advantage of it’s unique features while maintaining the lightweight gtk environment xfce offers. I found some guides online, but they are old at this point and I’m sure the situation has changed since then, and was wondering if anyone has any insight how to correctly achieve this feat.

Also I wonder if this hack will work in this setup to improve the framerate of desktop applications…I guess it may for qt apps?

Change KDE frame rate

Hi, I just got a monitor with a refresh rate higher than 60hz. How do I set the target fps of Plasma 5’s compositor? I checked the “show fps” desktop effect and am still maxed out at 60 fps.

[EDIT] Solved: https://invidio.us/watch?v=alkxwwIHiCk

"To get the UI to also match the refresh rate of the monitor, you need to edit these files: /home/[YOUR USERNAME]/.config/kwinrc and add the line:

MaxFPS=[your framerate here]

for example, for a 144 hz display,

MaxFPS=144

To change the frame rate in firefox you use this hack…

Change firefox frame rate (!!!)

about:config → layout.frame_rate

default=-1 , change to native refresh rate…

That hack makes firefox two times faster actually, and should work properly if you have a monitor that can produce greater than 60 frames per second. Still can’t alter video frame rates, those are typically limited by video producers, and website policies such as youtube’s, which will limit your videos to 30/60 fps, but the UI’s frame rate can be increased with that hack which makes using firefox generally twice as fast, and is totally epic…

I know gtk has support for increased frame rates, but I can’t figure out how to actually take advantage of it, as a user, as opposed to a desktop-application developer.

I’m going to eventually take some time and figure out how to get kwin working with xfce, but what’s the proper way to do it? That is going to require reading through documentation to make all our desktop components work nicely with each other.

1 Like

I think this is a good start (and perhaps the only thing you need):

https://wiki.archlinux.org/title/Xfce#Use_a_different_window_manager

1 Like

Perfect… why didn’t I think of that. Great advice I will try to get it working later, and let you guys know what I find out. Thank you.

If I may say so, the ArchWiki should be the first stop for any inquiry about things Arch.

3 Likes

Something fewer and fewer people seem to be doing.

3 Likes

It used to be the case… idk 5-10 years ago? That searching google instantly turned up the exact answers we needed to any and all problems, and now the situation has changed, and google’s software has regressed!

It used to be so simple to quickly find exactly what you needed, and now we have to go up the chain of command to original source documentation to figure things out…

:100:

2 Likes

You could use the following to limit the search results to a specific site, for example:

site:wiki.archlinux.org xfce4

or

site:forum.endeavouros.com dracut

etc.

2 Likes

So this isn’t as simple as it used to be for a nicely functioning desktop environment overall. It used to be the case, that we could install kwin, and it’s dependencies and edit a single file to tell xfce-session to use kwin as the window manager instead of xfwm4, or simply invoke the command kwin --replace at any time in a typical desktop session, or as an automatic command at bootup and we would suddenly be using kwin.

Now plasma has taken the more complicated route, of other software projects - that lead inevitably to their DOOM.

https://blog.davidedmundson.co.uk/blog/plasma-and-the-systemd-startup/

https://wiki.archlinux.org/title/KDE#Use_a_different_window_manager

Since KDE 5.25, Plasma’s systemd based startup is enabled by default.

To replace KWin in this startup, you must first mask the plasma-kwin_x11.service for the current user to prevent it from starting.

So basically, now plasma-kwin uses systemd in order to appropriately accomplish a variety of goals in their vision for it’s development.

So what happens then, if we try the old methods of simply editing a file read by xfce-session to change the default window manager there are all sorts of graphical bugs. Kwin is now intended to be integrated with systemd in order to function appropriately.

The file for xfce-session that describes the users settings is here…

/home/$USER/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml

and we can change it to choose a different window manager. And some window managers are simple, and should easily be able to be switched to editing a single word in that file… and logging in/out or rebooting, but, now kwin is not that simple any more.

You get the basic packages you need to start troubleshooting kwin in xfce like this…

$ sudo pacman -Syu systemsettings kwin

and I had to grab a dependency from aur, which had it’s mirrors knocked down, in git form, which means I had build a ton of packages which took probably an hour, just to get knewstuff…like this

$ yay -S knewstuff-git

Then, the best thing to do at this point is to anticipate graphical errors, and use kde system settings installed from the systemsettings package to disable all desktop effects, leave compositing enabled, maybe turn it off, and turn it back on again later, after some tweaking has been done. Graphical stuff can have really abstract conflicts, that have to be kneaded out through troubleshooting.

Choose the basic adwaita theme in appearance settings, other themes wont work properly with kwin at first.

one persons advice said to use QT_QPA_PLATFORMTHEME=kde

set in /etc/environment

So we need theme dependencies for qt/gtk, there are some graphical bugs to work out, and some things have seriously changed since old guides for accomplishing this have come out.
Anyways I just started playing around with this like a couple hours ago, if I could find other people’s experiences with ti beyond literally two or three old forum posts that would be helpful…

edit: okay so i just figured out that kwin --replace doesn’t work, but, now kwin_x11 --replace does work. so after installing the basic packages to get started, turning off all effects in kde settings, and choosing the adwaita theme from xfce appearance settings we can simply invoke kwin_x11 --replace inside of a typical xfce desktop session and start playing around with kwin on xfce

Edit: so basically everything is broken or aka not working properly. We need to get the expected dependencies for plasma-kwin now, which include systemd integration, so in order to actually get this working, and not in a totally-almost-working-but-totally-not-working state, the best thing to do would be to install the both the kde desktop environment and the xfce desktop environment initially to pull in all the real dependencies that aren’t obvious just looking at the package kwin by itself.

Couldn’t start kglobalaccel from org.kde.kglobalaccel.service:

Is that really considered lightweight? I mean kwin has a lot of dependencies and loads a whole bunch of kde specific libraries. Just look at the list of the 69 dependencies:

https://archlinux.org/packages/extra/x86_64/kwin/

All this on top of xfce is probably more heavy load than you think.

yea what I was refering to was gtk, and the desktop-environment based on it in xfce.

That is lighter-weight than kde, the systembloat with kde/qt balloons even though they occupy the same amount of ram during usage. Itd be much nicer to use the nice features that kde offers, which mainly revolve around kwin, as well as the lighter xfce desktop environment with it.

So now what we have to do to accomplish this neatly, is to take one of two paths, the first path is basically going to give us a broken-ugly system, the second path means we’ll have two desktop environments installed at the same time, which means we would have a ton of stuff that we don’t really need, and is annoying to deal with.

To use kwin to replace xfwm4… we can either…

1) With the xfce base install as few dependencies as possible for kwin, grab the service files it expects for systemd integration/proper functionality, and get the theme dependencies for both qt/gtk apps for uniform themeing, include an exception for kwin in pacman so it doesn’t automatically upgrade whch will introduce more problems

2) Install both the kde and xfce desktop environments pulling in all the dependencies that are required for proper kwin functionality, and trim the excess unwanted packages from there (best solution)

and a third option…

we could also opt to use an older package base with the arch linux archive of packages, in order to get older kde stuff thats easier to work with and integrate into our system. That could also be the best option, just have to find all the dependencies for the older kwin prior to it’s systemd integration, and just use that, prevent pacman from upgrading it or breaking it’s dependencies

This is true. I used to think that xfce is lightweight until I switched to a window manager (i3) and never looked back.

@LinuxGaming312 Is that really surprising? The web has mushroomed over the years; the total number of sites has vastly increased. Having said that, the fact that the official documentations is the most authoritative source of information remains true regardless of search engine behavior.

1 Like

As long as it’s kept up to date