lock screen overlay?

Please post suggestions for improvement of Cinnamon here
https://github.com/linuxmint/Cinnamon
Post Reply
appye
Level 1
Level 1
Posts: 29
Joined: Mon Sep 12, 2011 12:22 pm

lock screen overlay?

Post by appye » Sun Mar 31, 2019 4:27 pm

Hello,

Is there a way to eliminate or adjust (what I am assuming is) the overlay that effectively darkens the desktop wallpaper/background in cinnamon screensaver? I want my backgrounds not to display so dark when the machine is locked. This is definitely not a hardware setting of any kind ...

User avatar
smurphos
Level 12
Level 12
Posts: 4373
Joined: Fri Sep 05, 2014 12:18 am
Location: Britisher
Contact:

Re: lock screen overlay?

Post by smurphos » Mon Apr 01, 2019 1:05 pm

Hi,

Your question intrigued me so I did a bit of digging. The wallpaper shade effect is hardcoded in /usr/share/cinnamon-screensaver/monitorView.py

But given it's a python script it's ripe for a little bit of end user hacking.....

I applied these tweaks to the Mint 19.1 version of cinnamon-screensaver

Open the file with with admin privileges.

Code: Select all

xed admin:///usr/share/cinnamon-screensaver/monitorView.py
Navigate to this function.

Code: Select all

    def shade_wallpaper(self, widget, cr):
        """
        This draw callback adds a shade mask over the current
        image.  It is uniform when not Awake, and acquires a
        significant gradient vertically framing the unlock dialog
        when Awake.
        """
        if not status.Awake:
            cr.set_source_rgba(0.0, 0.0, 0.0, 0.7)
            cr.paint()
            return False

        r = widget.get_allocation()

        pattern = cairo.LinearGradient(0, 0, 0, r.height)
        pattern.add_color_stop_rgba (0, 0, 0, 0, .75);
        pattern.add_color_stop_rgba (.35, 0, 0, 0, .9);
        pattern.add_color_stop_rgba (.65, 0, 0, 0, .9);
        pattern.add_color_stop_rgba (1, 0, 0, 0, .75);
        cr.set_source(pattern)
        cr.paint()

        return False
These lines shade the background when the screensaver is active but the password field etc is not being displayed.

Code: Select all

        if not status.Awake:
            cr.set_source_rgba(0.0, 0.0, 0.0, 0.7)
This should show completely unshaded wallpapers.

Code: Select all

        if not status.Awake:
            cr.set_source_rgba(0.0, 0.0, 0.0, 0.0)
These lines shade the background when the password dialog is visible

Code: Select all

        pattern = cairo.LinearGradient(0, 0, 0, r.height)
        pattern.add_color_stop_rgba (0, 0, 0, 0, .75);
        pattern.add_color_stop_rgba (.35, 0, 0, 0, .9);
        pattern.add_color_stop_rgba (.65, 0, 0, 0, .9);
        pattern.add_color_stop_rgba (1, 0, 0, 0, .75);
Again to eliminate all shading. This is probably overkill - it's actually quite hard to see the login dialog.....

Code: Select all

        pattern = cairo.LinearGradient(0, 0, 0, r.height)
        pattern.add_color_stop_rgba (0, 0, 0, 0, 0);
        pattern.add_color_stop_rgba (.35, 0, 0, 0, 0);
        pattern.add_color_stop_rgba (.65, 0, 0, 0, 0);
        pattern.add_color_stop_rgba (1, 0, 0, 0, 0);
So maybe

Code: Select all

        pattern = cairo.LinearGradient(0, 0, 0, r.height)
        pattern.add_color_stop_rgba (0, 0, 0, 0,.2);
        pattern.add_color_stop_rgba (.35, 0, 0, 0, .7);
        pattern.add_color_stop_rgba (.65, 0, 0, 0, .7);
        pattern.add_color_stop_rgba (1, 0, 0, 0, .2);
Finally - to ensure that text can be read no matter what the background color is like we are going to strengthen the text shadows used via a gtk overide.

Run this to open / create this file.

Code: Select all

xed ~/.config/gtk-3.0/gtk.css
Add the lines

Code: Select all

/* Better visibility of screen-saver text on light backgrounds */
.csstage .unlockbox,
.csstage .clock,
.csstage .notificationwidget,
.csstage .powerwidget,
.csstage .trackname,
.csstage .albumartist  {
    color: #fff;
    text-shadow: 0px 0px 2px #000, 1px 1px #000, 1px -1px #000, -1px 1px #000, -1px -1px #000, 1px 0px #000, 0px 1px #000, -1px 0px #000, 0px -1px #000;
}
and save.

Log off and log back in

Edit to amend the instructions for modifying the text shadow to minimise editing of system owned files.
Last edited by smurphos on Wed Apr 17, 2019 1:11 am, edited 1 time in total.
For custom Nemo actions, useful scripts for the Cinnamon desktop, and Cinnamox themes visit my Github pages.

appye
Level 1
Level 1
Posts: 29
Joined: Mon Sep 12, 2011 12:22 pm

Re: lock screen overlay?

Post by appye » Thu Apr 11, 2019 5:45 pm

Fantastic! I figured it was hard coded somewhere ...

I guess I will need to make these changes any time Cinnamon is updated, but that's fine. Thanks again! Now I can enjoy all my wallpapers...

Post Reply

Return to “Cinnamon”