jszczerbinsky / lwp

Multi-platform parallax wallpaper engine
MIT License
872 stars 12 forks source link

Renders above desktop icons in KDE Plasma #67

Closed nasawyer7 closed 5 months ago

nasawyer7 commented 6 months ago

Had to use display manager x11 since wayland does not work (see other issue). But As title said, desktop icons disappear. I found a similar repo that enables live wallpapers, and to fix this they used this command. gsettings set org.gnome.desktop.background show-desktop-icons true || true gsettings set org.nemo.desktop show-desktop-icons true || true

However, I am on x11 kde not using gnome. So, I tried to remake this command for this display manager by asking chatgpt since i know nothing about this section myself lol. Anyways, the command actually seemed to work surprisingly. here it is.

kwriteconfig5 --file ~/.config/plasma-org.kde.plasma.desktop-appletsrc --group Containments --group 1 --group General --group ShortcutsContainment --group ActionPlugins --group 0 --group Shortcuts --group 49 --group Data --key enabled --type bool true || true Anyways, help would be appreciated!

jszczerbinsky commented 5 months ago

Hi, after a long time of investigating this bug I finally found a solution.

Screenshot_20240127_003448

The problem is that KDE renders desktop, widgets and icons on the same window, so it's impossible to render something in-between. The solution is quite ugly, but also tricky. I tested it on KDE plasma 5.27.10 and it works. The key idea is to put Layered WallPaper window behind the plasma desktop and make the desktop background transparent.

The solution:

First of all set the background mode to Plain Color (Right click on plasma desktop -> Configure Desktop and Wallpaper).

Screenshot_20240127_013447

You need to make the background color transparent. Unfortunately the color picker doesn't allow You to do this, but I realized, that You can set the alpha channel manually in the config file. You can use this script:

kwriteconfig5 --file ~/.config/plasma-org.kde.plasma.desktop-appletsrc --group Containments --group 1 --group Wallpaper --group org.kde.color --group General --key Color 0,0,0,0

Next, open the compositor settings (System Settings -> Display and Monitor -> Compositor) and uncheck the Allow applications to block compositing checkbox.

Screenshot_20240127_005516

From now on the plasma desktop window can be managed by the compositor.

The next step is setting the window rules for the compositor (System Settings -> Window Management -> Window Rules). You can unzip this file and import them: window_rules.zip or just set them as in the screenshots:

Screenshot_20240127_012257

Screenshot_20240127_010816

I found it interesting, that even if the background is already set to transparent, the compositor doesn't allow the window to show transparency (it just renders black color), but You can set the rule for window opacity and force it to allow the alpha channel. This rule without setting the background is not a solution, because it makes the icons transparent too, that's why You need to set the transparent background anyway and that's why the rules for opacity are set to 99% - to allow the alpha channel while not making the icons too transparent.

Now everything will work smoothly only if Layered WallPaper is started before the desktop. To achieve it create a startup script:

touch ~/.config/plasma-workspace/env/runLwp.sh
chmod +x ~/.config/plasma-workspace/env/runLwp.sh

and put the following content inside of it:

exec lwp &
sleep 1

After rebooting you system everything should work fine