The suggested patch seems to add an additional setting that could be managed from somewhere else (supposedly from gsettings
?)
Anyhow, since the unlockDialog.js
file needs modifying anyways, I opted for a more direct approach: simply disabling the blur effect directly in this file.
The modified file — relying on gnome-shell's gresource overlays feature — can be kept in one's home directory, available for convenient subsequent edits at any time.
Steps to achieve the modification
- extract the
unlockDialog.js
file from the libgnome-shell.so
binary library,
- establish it as a "gresource overlay", so that gnome-shell will use it in this extracted form,
- and then modify the extracted copy a little.
The first two steps are explained in detail here: Where are gnome-shell's UI javascript files on Ubuntu 20.04? (It seems to be a lot to take in, but the actual changes carried out are not very much.)
For the third step, modifying the unlockDialog.js
copy, there exist a few different approaches.
The challenge with applying suggested code changes
Now what complicates things is that this file keeps getting changed over time, and depending on which exact version you have, it might get difficult to figure out how to apply any change suggestions.
This is how unlockDialog.js looks now in the gnome-3-36
branch at the time of writing (at commit 6b20eb8e
).
The suggested patch however references an older state, since which the file has undergone this and this change; both modify the part about the blur.
With that in mind, I try to suggest the simplest possible changes that seem to have a chance to remain relevant even after some updates.
Ideas for modifying unlockDialog.js
Idea 1:
The simplest solution is changing the BLUR_SIGMA
variable's value:
// Old:
// const BLUR_BRIGHTNESS = 0.55;
// const BLUR_SIGMA = 60;
// New:
const BLUR_BRIGHTNESS = 1;
const BLUR_SIGMA = 0;
This will already result in a clear background image that is unaltered and identical to how it looks on the normal desktop after logging in.
(Note that as soon as BLUR_SIGMA
is set to 0
, BLUR_BRIGHTNESS
, even if it's less than 1
, will not take effect either; actually, as long as SIGMA is 0
, editing BLUR_BRIGHTNESS
seems to be probably unnecessary.)
Idea 2:
If you are concerned about performance, you could go for preventing the graphical effect from being applied at all. Seeing however how BLUR_SIGMA = 0
seems to nullify the entirety of the effect, I reckon there is already not much overhead.
// Find this part:
_updateBackgroundEffects() {
const themeContext = St.ThemeContext.get_for_stage(global.stage);
// And modify it like this:
_updateBackgroundEffects() {
return true;
const themeContext = St.ThemeContext.get_for_stage(global.stage);
Placing return true;
in the _updateBackgroundEffects()
method (as the first line, unless you see a reason not to) allows for bypassing code in that method that comes after the return
statement.
Before you do this, however, review the contents of the code block, and try to determine whether this method is doing something that later, some other, external methods may try to rely on. If you spot something like that, try to add the return
statement after such a declaration. (At the time of writing this, the return
statement in the first line (as in the example above) worked without an issue.)
(By the way, you could simply comment out just the effect.set({ ... });
code block as well.)
A note on Idea 2:
I was thinking: "Couldn't we even spare defining the effect in the first place?" So I had my eyes on this line:
let widget = new St.Widget({
// ...
effect: new Shell.BlurEffect({ name: 'blur' }),
});
But reading the commit message here reveals that removing it could potentially cause bugs; so it seems better to play it safe and leave this line in place.
Also, I'm extremely happy now, because I was incredibly frustrated by the darkened nature of the lock screen background, ever since I installed 20.04.
Now however it's solved for me too.