Blur Any Window in KDE Plasma
The newest KDE plasma natively support blur, but it has many limitations, for example I can’t blur vim status line and firefox. This article tries to find a way to blur any window in plasma, like this:
There is a much more elegant method to achieve this, see the comment for more information.
To begin with, make sure you have already enabled blur effect via Kvantum and some themes that support blur, for example Sweet
I wrote a simple script that can launch application and blur the window automatically:
The first argument is the command to launch the application, the second argument is the class of the application window, and the third argument is the transparency level. The higher the transparency level, the more blurred the window will be.
For example, you want to launch vscode with blurred effect enabled, the first argument should be
'code'. To get the second argument, open vscode window and execute
xprop WM_CLASS in your terminal emulator, then you’ll get something like this:
The first string is the instance name and the second string is the class name, so the second argument should be
For the third argument, don’t set it too high, otherwise the window will look very bad. Also, I’d recommend to use this script with a high contrast color scheme.
Let’s say we set the transparency level to
3, then the complete command is as follows:
Here is the final result:
Now let’s create a
.desktop file to launch blurred vscode.
Then modify the
Open application launcher and launch this application, you’ll get a blurred vscode.
Honestly this hack is very dirty, the first while loop will last for 3 seconds, then decrease the opacity of current window, which means this script won’t work if the startup time last more than 3 seconds or you switch to another window in this 3 seconds.
Glad if someone else can help me improve this script.
License CC BY-NC-ND 4.0