Bug 389962 - Lock screen does not show Picture of the Day because image is not cached locally
Summary: Lock screen does not show Picture of the Day because image is not cached locally
Status: RESOLVED FIXED
Alias: None
Product: kdeplasma-addons
Classification: Plasma
Component: Picture of the Day (show other bugs)
Version: unspecified
Platform: Neon Linux
: HI normal
Target Milestone: ---
Assignee: Guo Yunhe
URL:
Keywords:
: 390685 418394 419436 423667 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-02-06 18:02 UTC by Andrew Crouthamel
Modified: 2020-06-30 02:45 UTC (History)
21 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.20


Attachments
Workaround script, for astronomy picture of the day (457 bytes, application/x-shellscript)
2018-02-18 20:24 UTC, Shmerl
Details
Workaround script, for astronomy picture of the day (427 bytes, application/x-shellscript)
2018-02-18 23:40 UTC, Shmerl
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Crouthamel 2018-02-06 18:02:24 UTC
If Picture of the Day is chosen (any type) in the Screen Locking > Appearance area, the picture does not show when the screen is locked. Picture of the Day works correctly for wallpaper, under the Desktop Settings > Wallpaper configuration.

This is on KDE Neon User Edition, KDE Plasma 5.12.0.
Comment 1 Martin Flöser 2018-02-06 18:07:28 UTC
Picture of the Day is not really supported. The lock screen disallows Internet access, thus the picture of the Day cannot be downloaded. If you also use Picture of the Day on Plasma desktop it should work.
Comment 2 Andrew Crouthamel 2018-02-06 18:09:35 UTC
(In reply to Martin Flöser from comment #1)
> Picture of the Day is not really supported. The lock screen disallows
> Internet access, thus the picture of the Day cannot be downloaded. If you
> also use Picture of the Day on Plasma desktop it should work.

Ok, this option should be removed then.
Comment 3 Martin Flöser 2018-02-18 16:16:57 UTC
*** Bug 390685 has been marked as a duplicate of this bug. ***
Comment 4 Shmerl 2018-02-18 18:31:17 UTC
(In reply to Martin Flöser from comment #1)
> Picture of the Day is not really supported. The lock screen disallows
> Internet access, thus the picture of the Day cannot be downloaded. If you
> also use Picture of the Day on Plasma desktop it should work.

I just enabled Astronomy picture of the day for the desktop wallpaper. It worked, but lock screen is still not picking it up.
Comment 5 Shmerl 2018-02-18 20:24:14 UTC
Created attachment 110794 [details]
Workaround script, for astronomy picture of the day

I made myself a workaround script. It downloads an image and saves it in:

${HOME}/pictures/picture_of_the_day.jpg

Change accordingly to your preferred location. You can set some scheduler to run this script periodically.

Then just set your lock screen to static image with that path.

Required tools:
pcregrep, identify (ImageMagick), to verify image type identity.
Comment 6 Shmerl 2018-02-18 23:40:44 UTC
Created attachment 110795 [details]
Workaround script, for astronomy picture of the day

Improved version
Comment 7 Shmerl 2018-02-19 23:17:15 UTC
And I suppose since lock screen has no network access, in order to enable something like picture of the day, there should be an explicit KDE service / scheduled job "picture of the day" that user can enable, and lock screen can rely on that service to update the image appropriately.
Comment 8 Rog131 2018-02-20 07:11:20 UTC
(In reply to Shmerl from comment #7)
> And I suppose since lock screen has no network access, in order to enable
> something like picture of the day, there should be an explicit KDE service /
> scheduled job "picture of the day" that user can enable, and lock screen can
> rely on that service to update the image appropriately.

There could be a 'POTD' widget. : https://forum.kde.org/viewtopic.php?f=289&t=142331
Comment 9 David Greengas 2018-03-14 14:22:28 UTC
I have another workaround. I setup my main desktop background to use the Bing POTD. You can modify it for other POTD providers.

The desktop POTD stores the wallpaper in ~/.cache/plasmashell/plasma_engine_potd/ based on the provider. For example, bing uses a file called bing. I created a simlink from bing to background.png and chose background.png in the screen locker configuration. Each time the POTD updates, it updates the file called bing. Since background.png points to bing, the screen locker shows the correct POTD.
Comment 10 Niklas Sombert 2018-04-07 18:46:59 UTC
I've created a simple Python script to download the current apod image: https://gist.github.com/YtvwlD/4a12bb90cfaeea2195790d1a0a44f408
(It needs just bowshock as a dependency.)

It places the image at ~/.cache/kscreenlocker_greet/plasma_engine_potd/apod by default - where it gets picked up by the lockscreen, if it is still set to the apod provider.
Comment 11 John Pocock 2018-08-16 12:16:53 UTC
I am also experiencing this. Definitely unexpected and not user friendly behavior. The picture should be downloaded (perhaps twice daily or whatever fetching is used if the picture of the day is the desktop background) while the user is logged in so that the lock screen can display the image of the day. It appears that if you select picture of the day for lock screen but not desktop wallpaper then the picture is never downloaded because the image is only requested after locking and lock screen doen't have the network access required.
Comment 12 Nate Graham 2018-08-16 21:51:12 UTC
This isn't really the lock screen's fault; it's entirely appropriate for security reasons that internet access is prohibited. Rather, these plugins should probably be updated to locally cache the images somewhere so no network access is required. Moving to a different product to track the fix properly.
Comment 13 John Pocock 2018-08-24 22:47:20 UTC
I have since tried having the same picture of the day settings for my wallpaper and as the lock screen image The image of the day loads fine and display for the wallpaper but is still a black lock screen.
Comment 14 Nils 2019-04-01 13:34:40 UTC
It would really be great to have this feature working. I don't ever see my desktop as I have a lot of things always opened. The only moment where I would enjoy to see something new is when I lock my computer. 
If this is related to the internet access, I suppose the images could be fetched in advance when the user has still not locked his session. The images would never change until he open up again his session and it's a new day.
Comment 15 Michal Hlavac 2019-12-18 07:53:34 UTC
Would be great to have option: "Same as desktop". Then e.g. picture of the day will be taken from desktop.
Comment 16 Guo Yunhe 2020-01-02 10:35:04 UTC
I can force POTD providers to use cached picture when network is not available. But this only works when your desktop wallpaper and lock screen wallpaper are the same POTD provider. If they are different, lock screen POTD will never be cached and it remains black.

Shmerl's suggestion is the best approach overall. 

(In reply to Shmerl from comment #7)
> And I suppose since lock screen has no network access, in order to enable
> something like picture of the day, there should be an explicit KDE service /
> scheduled job "picture of the day" that user can enable, and lock screen can
> rely on that service to update the image appropriately.
Comment 17 Shmerl 2020-02-21 04:31:53 UTC
Updated my workaround script that downloads astronomy picture of the day:

https://gist.github.com/shmerl/7465989937cddeb9539db3803ba3feb8

Pair it with local user systemd timer or crontab entry that calls that script a few times a day, and set the lock background to the saved image.
Comment 18 Patrick Silva 2020-03-13 19:02:09 UTC
*** Bug 418394 has been marked as a duplicate of this bug. ***
Comment 19 Patrick Silva 2020-03-31 17:08:05 UTC
*** Bug 419436 has been marked as a duplicate of this bug. ***
Comment 20 Guo Yunhe 2020-04-23 19:40:53 UTC
Partly resolved by https://phabricator.kde.org/D29140 when desktop wallpaper and lockscreen wallpaper use the same POTD provider.
Comment 21 Nate Graham 2020-05-13 18:56:43 UTC
There's a patch to fix this!

https://phabricator.kde.org/D29140
Comment 22 Nate Graham 2020-06-18 22:11:24 UTC
Git commit d5f9e6af9f9cda210b15d5c10b370006c86bd7ad by Nate Graham, on behalf of Guo Yunhe.
Committed on 18/06/2020 at 22:09.
Pushed by ngraham into branch 'master'.

Fix POTD in lock screen

Summary:
1. POTD was cached in `~/.cache/`. But lock screen seems not a process
of current user, so it won't find the cache in user's home dir. So I
changed cache location to `/tmp` and it starts to work.
2. Flickr and APOD(NASA) providers cannot cache pictures in `PNG` but
`JPEG` works. So I simply changed the cache format to `JPEG`. Most POTD
are photos. JPEG saves more spaces.
3. Added a KDED module to cache lockscreen POTD, because lockscreen
program doesn't have internet access.

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D29140

Merge Request: https://invent.kde.org/plasma/kdeplasma-addons/-/merge_requests/3

FIXED-IN: 5.20

M  +2    -0    CMakeLists.txt
M  +1    -0    dataengines/potd/PoTD-list.txt
M  +7    -7    dataengines/potd/cachedprovider.cpp
A  +1    -0    kdeds/CMakeLists.txt
A  +16   -0    kdeds/potd/CMakeLists.txt
A  +8    -0    kdeds/potd/README.md
A  +61   -0    kdeds/potd/kded_potd.cpp  *
A  +8    -0    kdeds/potd/kded_potd.desktop
A  +35   -0    kdeds/potd/kded_potd.h  *

The files marked with a * at the end have a non valid license. Please read: https://community.kde.org/Policies/Licensing_Policy and use the headers which are listed at that page.


https://invent.kde.org/plasma/kdeplasma-addons/commit/d5f9e6af9f9cda210b15d5c10b370006c86bd7ad
Comment 23 Patrick Silva 2020-06-30 02:45:28 UTC
*** Bug 423667 has been marked as a duplicate of this bug. ***