I’ve been a long-time Xfce user as I’ve bounced around any manner of window manager and desktop environment since the turn of the century. I always found 3D effects like viewing all window spaces, and exposé-type features to be useful to productivity and the eyes.
Compiz is also not really actively developed anymore so I wanted to stick with something more progressive (yes, Xfce is actively developed) Below you’ll see how to use KWin as your desktop compositor/manager alongside the rock solid, lightening-fast Xfce desktop.
This process is easy, takes only a few dozen KDE/QT packages and is not too invasive to the simplistic, lightening-fast Xfce experience we all know and love. This is aimed towards a Fedora Linux installation but the approach some work for any distribution that ships KDE and Xfce.
I’m told that Ubuntu users can use the Kubuntu plasma-desktop PPA to get the right packages installed below.
(older distributions, F21 and below)
dnf install kwin-gles-libs kwin-gles kde-style-skulpture
Fedora 22+ or newer Distributions with Plasma 5: Do this instead
dnf install qt5-qtscript qt5-qtsvg qt5-qtbase-gui libxkbcommon-x11 \ qt5-qtdeclarative kwin kwin-libs kf5-kwindowsystem kde-cli-tools
Edit Xfce Session to use KWin
cp /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml \ $HOME/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml sed -i 's/xfwm4/kwin'/ $HOME/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml
Logout/In to X11 or Reboot.
To access window decorations, plugins, effects and other settings right click on any application title bar and go to more actions -> window manager settings
NOTE: Make a session and startup entry in Xfce to launch kwin –replace if the xfce4-session.xml setting above doesn’t start everything automatically.
Go to Session and Startup –> Application Autostart and click Add. The command for the startup used above is:
kwin --replace ; killall xfce4-panel ; xfce4-panel & ; killall -9 xfdesktop ; xfdesktop & ; kwin --replace
NOTE: Non-KDE terminals like xfce4-terminal, urxvt, etc. may look funny on the borders when full screen in kwin, to fix this: right click on the window border –> more actions –>special application settings –> size and position
CHECK obey geometry restrictions, select force, check NO
NOTE: If you run into graphics weirdness you can non-disruptively “reset” everything via the following command (use the alt + f2 keys in Xfce for a quick run dialog):
You can do the same via ssh remotely:
DISPLAY=:0 kwin --replace
I also use the plank dock and a very minimal, hidden Xfce panel for my setup
Panel settings: Automatically hide the panel: Intelligently
Plank settings: Behaviour: Hide Dock, On, Dodge maximized window
You might also find the font visual improvement guide useful afterwards.
Set Focus Prevention Settings
For things like Whisker Menu (plugin ships with XFCE 4.12 now) you’ll want the following settings so that your focus isn’t stolen via KWin. Right click on any window –> More Actions –> Window Manager settings and then go to Focus. From there set focus stealing prevention to none.
Window Decorations and Theme
You now have access to all the KDE window decorations or you can obtain more through the Window Manager settings interface. I’m using the Dark-Translucent window decoration but try them all and see what you like best.
Install and Hotkey Whisker Menu
Whisker menu is an improved application menu for Xfce, it supports typing partial program names or metadata and quickly accessing programs and settings. Many Xfce programs feature a –popup flag or separate binary which is very useful.
dnf install xfce4-whiskermenu-plugin -y
Go to Keyboard Settings –> Application Shortcuts and click New.
Enter xfce-popup-whiskermenu as the command and choose your hotkey, I use meta + o.
Now you can quickly open whisker menu and type commands like you would with a Windows Start Menu. You should have also set the focus prevention settings above prior to this in KWin settings.
Switch Users Option
Whiskermenu many have the Switch Users action greyed out.
To enable switch users functionality within Whisker menu change the command for Switch Users to dm-tool switch-to-greeter.
Switch Users and Screen Lock
There’s currently a bug (feature?) around lightdm user switching that it doesn’t lock your desktop prior to running it so it’s best to call xcreensaver-command -lock beforehand. Let’s make a script for that.
(run as root)
cat > /usr/bin/lock-xfce << EOF #!/usr/bin/bash xscreensaver-command -lock ; dm-tool switch-to-greeter EOF
chmod 755 /usr/bin/lock-xfce
You can now use the new script lock-xfce for both your lockscreen and to better secure multi-user session support within Lightdm. Some people also complain that xscreensaver is ugly so this spruces things up a bit.
Lightdm supports themes and customization, install the following package to dig deeper and experiment with different looks.
dnf install lightdm-gtk-greeter-settings -y
My Laptop Screenshot
When all is said and done, this is generally what my desktop looks like. Plank keeps running applications and windows nicely segregated/collapsed within their own plank dock entries without the need for taskbar clutter. Common applications like xfce4-terminal, Thunar (file browser) Firefox, and Whisker Menu are all hotkeyed.
Issues with HDMI External Display
Like all software, KWin isn’t perfect and does have bugs. Occasionally I’ve had problems with exporting my Lenovo x240 display to large TV/monitors via HDMI. In cases like this, or if KWin is slow I will sometimes temporarily revert back to xfwm4 via hitting control + f2 (Xfce run dialog) and running the following:
You can revert back to using KWin at any time by running the reverse:
No Desktop Background
If your desktop background doesn’t load for some reason try reloading xfdesktop with alt+f2 run dialog or terminal.
killall -9 xfdesktop ; xfdesktop &
Issues with Intel Chipsets
There are some known issues with some Intel chipsets that can be circumvented by switching to UXA acceleration instead of the newer SNA. This is a bug in the Intel driver that is triggered by some features of KWin/Plasma and not KWin. To work around this you can do the following, but only do this if you have issues:
cat > /etc/X11/xorg.conf.d/20-intel.conf << EOF Section "Device" Identifier "Intel Graphics" Driver "intel" Option "AccelMethod" "uxa" EndSection EOF
Now, restart X11 or reboot. Note that most of these issues are fixed with Linux kernel 4.2.6 and above so you probably don’t need this unless you are on an older distribution/release.
Lastly, there is an enormous amount of useful desktop effects similiar to what’s offered by Compiz within KWin. You can access these via right clicking on any open window and selecting more actions -> window manager settings.
I won’t go through them all here, but one very useful effect (found under screen edges) displays all open windows easily by dragging your mouse to a pre-defined screen corner as seen below.
I also hotkey this to f11 for quick access, your mileage may vary.