Can Lock Screen background be other than current desktop BG? [SOLVED]

Style your desktop
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
lazarus

Can Lock Screen background be other than current desktop BG? [SOLVED]

Post by lazarus »

LM18.3 Cinnamon
LightDm

As the title says, is it possible to get the Lock Screen background to display other than the current desktop?

Ideally I'd like to run a cron script to change the displayed Lock Screen BG depending on time of day, which is simple enough IF I can get the Lock Screen to load from a specified file.

Looking in /etc/lightdm/slick-greeter.conf there is a line:

Code: Select all

[Greeter]
background=/usr/share/backgrounds/mybackground.jpg
...that appears to hold the target file, at least for the initial login screen. It's never displayed, it's also not the one displayed by the Lock Screen, which is always the current backdrop. (I have my BG in slideshow mode, changing every 15mins.)

PS. Even the initial login background after a reboot is the last session backdrop that was used. WTH?

/etc/lightdm/lightdm-gtk-greeter.conf.d contains:

Code: Select all

[greeter]
background=/usr/share/backgrounds/linuxmint/default_background.jpg
...which at a glance appears to be the right line to edit except that this background isn't the one being displayed either! :| That's the default one from a vanilla install and hasn't been displayed in weeks.

Looking at logs, /var/log/lightdm/seat0-greeter.log contains:

Code: Select all

[+0.00s] DEBUG: settings.vala:155: Overriding dconf setting for background with /usr/share/backgrounds/mybackground.jpg
---8<---
[+5.20s] DEBUG: background.vala:68: Making background /mnt/RAID_Store/Media/Pictures/Backdrops/BG_47.jpg at 1366x768
[+5.47s] DEBUG: background.vala:121: Render of background /mnt/RAID_Store/Media/Pictures/Backdrops/BG_47.jpg complete
...which appears to be linked to the Slideshow changes. However, as I said above re /etc/lightdm/slick-greeter.conf, /usr/share/backgrounds/mybackground.jpg is never shown.

Am I just chasing my own tail here? Ummm... Help?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 3 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
smurphos
Level 18
Level 18
Posts: 8501
Joined: Fri Sep 05, 2014 12:18 am
Location: Irish Brit in Portugal
Contact:

Re: Can Lock Screen background be other than current desktop BG?

Post by smurphos »

cinnamon-screensaver manages the lock screen in Cinnamon not lightdm.

Off the top of my head I'm not aware of an easy way to achieve what you want. Will have a think....
For custom Nemo actions, useful scripts for the Cinnamon desktop, and Cinnamox themes visit my Github pages.
lazarus

Re: Can Lock Screen background be other than current desktop BG?

Post by lazarus »

Ahhh... thank you.

On a side note, I've just realised that the reason I was never seeing the file defined for the Login window (ie. as set in slick-greeter.conf) is because by default it uses the background of the currently selected user. Naturally, on my system it defaults to my account.

Switching to Guest or another account and it does display correctly. :oops:
User avatar
smurphos
Level 18
Level 18
Posts: 8501
Joined: Fri Sep 05, 2014 12:18 am
Location: Irish Brit in Portugal
Contact:

Re: Can Lock Screen background be other than current desktop BG?

Post by smurphos »

Thinking done - :wink:

You could write a bash script, which runs at startup with a continuous loop to check the output of cinnamon-screensaver-command -q

If the screensaver is active it should return the string The screensaver is active, in which the script will use gsettings to change the background e.g. gsettings set org.cinnamon.desktop.background picture-uri "file://path/to/background".

The script would then switch to checking for the string The screensaver is inactive to switch back to the users desired normal desktop background.

Not a particularly straightforward bit of scripting. I might have a bash (pun intended) at putting it together. If I can get a working solution I'll post back. if you manage to do it first please share... :)
For custom Nemo actions, useful scripts for the Cinnamon desktop, and Cinnamox themes visit my Github pages.
lazarus

Re: Can Lock Screen background be other than current desktop BG?

Post by lazarus »

Considering that I'm new to Mint (cinnamon in particular) and cinnamon-screensaver-command -q is a new cmd to me, I expect that you'll beat me to the punch on this one if you decide to accept this particular challenge.

Thank you kindly Sirrah, for pointing me in the right direction. :)

Huh. What I thought was basically a walk in the park has become an adventure into the great unknown! Let's hope I don't encounter a grue...

(As the answer is "no, not simply" I'll tag this thread as solved.)
User avatar
smurphos
Level 18
Level 18
Posts: 8501
Joined: Fri Sep 05, 2014 12:18 am
Location: Irish Brit in Portugal
Contact:

Re: Can Lock Screen background be other than current desktop BG?

Post by smurphos »

lazarus wrote: Sat Aug 04, 2018 11:21 pm if you decide to accept this particular challenge.
Accepted and done. Save the script somewhere sensible make sure its executable and add a custom command in Startup Applications to run it. It will run continuously in the background. Optionally increase the value of the sleep command if you don't mind a short delay in the background changing and want to reduce the cpu use of running cinnamon-screensaver-command -q every second.

EDIT

See - viewtopic.php?f=208&t=290333 for getting current versions of the scripts that were posted here.
Last edited by smurphos on Sat Apr 20, 2019 7:49 am, edited 2 times in total.
For custom Nemo actions, useful scripts for the Cinnamon desktop, and Cinnamox themes visit my Github pages.
lazarus

Re: Can Lock Screen background be other than current desktop BG? [SOLVED]

Post by lazarus »

Woohoo! Thank you kindly, sirrah!

With a few minor modifications - selecting the Lock Screen BG depending on time of day - I think your scripts'll be just the ticket. :)

I'm uncertain whether the fact that the backdrop is changed after the Lock Screen is triggered - even if only by 0.1s - will display the appropriate BG or not. Nor whether the BG is static under Lockscreen or will be changed by the desktop slideshow, I don't think so, but there's only one way to be sure.
User avatar
jimallyn
Level 19
Level 19
Posts: 9075
Joined: Thu Jun 05, 2014 7:34 pm
Location: Wenatchee, WA USA

Re: Can Lock Screen background be other than current desktop BG?

Post by jimallyn »

smurphos wrote: Sun Aug 05, 2018 4:08 amAccepted and done.
This is the sort of thing that I just love about Linux and open source: Not only will there be somebody who knows how to do it, or can figure out how to do it, they will provide you with a script so you can do it. Where else can you get that kind of support? No place that I know of!
“If the government were coming for your TVs and cars, then you'd be upset. But, as it is, they're only coming for your sons.” - Daniel Berrigan
User avatar
smurphos
Level 18
Level 18
Posts: 8501
Joined: Fri Sep 05, 2014 12:18 am
Location: Irish Brit in Portugal
Contact:

Re: Can Lock Screen background be other than current desktop BG? [SOLVED]

Post by smurphos »

lazarus wrote: Mon Aug 06, 2018 1:48 am Woohoo! Thank you kindly, sirrah!

With a few minor modifications - selecting the Lock Screen BG depending on time of day - I think your scripts'll be just the ticket. :)

I'm uncertain whether the fact that the backdrop is changed after the Lock Screen is triggered - even if only by 0.1s - will display the appropriate BG or not. Nor whether the BG is static under Lockscreen or will be changed by the desktop slideshow, I don't think so, but there's only one way to be sure.
You are welcome. I've got the second version running on my system now and it works great. With the script running after doing Ctrl-Alt-L the screensaver comes up with the current background and then transitions into the new one within a few seconds. Same in reverse on unlock. It's working fine with lock on suspend, timed lock etc as-well.

If you do have desktop slideshow set on it will continue to cycle through the backgrounds on the lock screen. You should be able to work around this by adding lines to the script to toggle the slideshow pause when locked/unlocked.

gsettings set org.cinnamon.desktop.background.slideshow slideshow-paused false
gsettings set org.cinnamon.desktop.background.slideshow slideshow-paused true
For custom Nemo actions, useful scripts for the Cinnamon desktop, and Cinnamox themes visit my Github pages.
User avatar
smurphos
Level 18
Level 18
Posts: 8501
Joined: Fri Sep 05, 2014 12:18 am
Location: Irish Brit in Portugal
Contact:

Re: Can Lock Screen background be other than current desktop BG?

Post by smurphos »

jimallyn wrote: Mon Aug 06, 2018 2:05 am
smurphos wrote: Sun Aug 05, 2018 4:08 amAccepted and done.
Where else can you get that kind of support? No place that I know of!
:D
For custom Nemo actions, useful scripts for the Cinnamon desktop, and Cinnamox themes visit my Github pages.
lazarus

Re: Can Lock Screen background be other than current desktop BG? [SOLVED]

Post by lazarus »

smurphos wrote: Mon Aug 06, 2018 2:30 am You are welcome. I've got the second version running on my system now and it works great. With the script running after doing Ctrl-Alt-L the screensaver comes up with the current background and then transitions into the new one within a few seconds. Same in reverse on unlock. It's working fine with lock on suspend, timed lock etc as-well.
I'm now running a variant of the first version and am more than satisfied with the result; it does exactly what I was trying to accomplish.
gsettings set org.cinnamon.desktop.background.slideshow slideshow-paused false
gsettings set org.cinnamon.desktop.background.slideshow slideshow-paused true
Kudos to you, sir. Answered my question before I'd even posed it in my head! I am now a very happy chappy. :D

Just for practice, to ensure I understand the relevant code I'm looking at setting two different BG folders, one for Lock Screen and one for Desktop, so I can hopefully have different slideshows in each mode. Not looking for help on this one... it takes all the fun out of it when someone else fills in all the crossword puzzle! ;)
Hultan
Level 3
Level 3
Posts: 178
Joined: Mon Aug 27, 2018 10:58 am

Re: Can Lock Screen background be other than current desktop BG? [SOLVED]

Post by Hultan »

Thank you Smurphos, you are awesome!

I have been looking for a solution to this for weeks, on and off, and finally I found a solution that works perfectly for a Linux-newb like me. I went with script number 1. I personally think that this is a bit of a privacy flaw in Mint, MY desktop should not be shared with other users. What if my fetish is shaved donkeys on roller blades with huge silicon t*ts? That would definitely be something that I would like to keep to myself, so why is Cinnamon/Mint sharing that with other users? My desktop background is MY desktop background, let me be alone with my desktop donkeys...:-)

/Per
Hultan
Level 3
Level 3
Posts: 178
Joined: Mon Aug 27, 2018 10:58 am

Re: Can Lock Screen background be other than current desktop BG? [SOLVED]

Post by Hultan »

Turns out, I spoke to soon, now the login screen is showing my desktop instead. Why is this so hard? Why isn't there just three different settings:

* Desktop background
* Lock screen background
* Login screen background

I guess the last two could be the same background, and I would be ok with that.

Anyway, I give up, I just feel that an OS that prides itself of being secure and private, should not share one users desktops with other users. /per
User avatar
smurphos
Level 18
Level 18
Posts: 8501
Joined: Fri Sep 05, 2014 12:18 am
Location: Irish Brit in Portugal
Contact:

Re: Can Lock Screen background be other than current desktop BG? [SOLVED]

Post by smurphos »

Hultan wrote: Wed Aug 29, 2018 10:31 am Turns out, I spoke to soon, now the login screen is showing my desktop instead.
The Login-screen background is handled by LightDM/Slickgreeter. Settings for it are accessed via the GUI App Login Window. In the Login Window app you can check whether or not to use User backgrounds. If you choose not to you can set a system wide login-screen background here as-well.

The lock-screen is handled by Cinnamon Screensaver which defaults to the logged in users background. The scripts here are a workaround to toggle that user background on screensaver activation. Agreed it would be a nice feature for cinnamon-screensaver to offer the ability to set a user-specific lock-screen background - maybe a candidate feature request
For custom Nemo actions, useful scripts for the Cinnamon desktop, and Cinnamox themes visit my Github pages.
User avatar
janise
Level 2
Level 2
Posts: 56
Joined: Sat Nov 23, 2013 10:38 am

Re: Can Lock Screen background be other than current desktop BG? [SOLVED]

Post by janise »

The output of cinnamon-screensaver-command -q is locale-specific. Does it have a way to output the status as some kind of a number/constant instead?
User avatar
smurphos
Level 18
Level 18
Posts: 8501
Joined: Fri Sep 05, 2014 12:18 am
Location: Irish Brit in Portugal
Contact:

Re: Can Lock Screen background be other than current desktop BG? [SOLVED]

Post by smurphos »

Don't think so, but I think there might be a better way to detect screensaver / lockscreen activation in any case. Will do a bit of experimenting tomorrow.
For custom Nemo actions, useful scripts for the Cinnamon desktop, and Cinnamox themes visit my Github pages.
User avatar
smurphos
Level 18
Level 18
Posts: 8501
Joined: Fri Sep 05, 2014 12:18 am
Location: Irish Brit in Portugal
Contact:

Re: Can Lock Screen background be other than current desktop BG? [SOLVED]

Post by smurphos »

janise wrote: Sat Mar 16, 2019 10:03 am The output of cinnamon-screensaver-command -q is locale-specific. Does it have a way to output the status as some kind of a number/constant instead?
smurphos wrote: Sat Mar 16, 2019 1:14 pm Don't think so, but I think there might be a better way to detect screensaver / lockscreen activation in any case. Will do a bit of experimenting tomorrow.
A revised version of the scripts originally posted in this thread can be found at viewtopic.php?f=208&t=290333

@janise - the new versions don't use cinnamon-screensaver-command -q anymore so that shouldn't be an issue.
For custom Nemo actions, useful scripts for the Cinnamon desktop, and Cinnamox themes visit my Github pages.
User avatar
janise
Level 2
Level 2
Posts: 56
Joined: Sat Nov 23, 2013 10:38 am

Re: Can Lock Screen background be other than current desktop BG? [SOLVED]

Post by janise »

Thank you, smurphos!
Locked

Return to “Themes, Icons & Wallpaper”