Skip to content
This repository was archived by the owner on Feb 7, 2025. It is now read-only.
This repository was archived by the owner on Feb 7, 2025. It is now read-only.

Works from terminal, but no image from cron job #123

@ihtruelsen

Description

@ihtruelsen

I can run it from terminal with the following output:

ian@ian-MS-7C84:~$ /home/ian/.local/bin/himawaripy --auto-offset
himawaripy 2.2.0
Updating...
Latest version: 2021/11/17 22:20:00 GMT.
Detected offset: UTC-08:00
Offset version: 2021/11/17 04:20:00 GMT.
Downloading tiles...
Downloading tiles: 1/16 completed...
Downloading tiles: 2/16 completed...
Downloading tiles: 3/16 completed...
Downloading tiles: 4/16 completed...
Downloading tiles: 5/16 completed...
Downloading tiles: 6/16 completed...
Downloading tiles: 7/16 completed...
Downloading tiles: 8/16 completed...
Downloading tiles: 9/16 completed...
Downloading tiles: 10/16 completed...
Downloading tiles: 11/16 completed...
Downloading tiles: 12/16 completed...
Downloading tiles: 13/16 completed...
Downloading tiles: 14/16 completed...
Downloading tiles: 15/16 completed...
Downloading tiles: completed.
Saving to '/home/ian/.cache/himawaripy/himawari-20211117T042000.png'...
No such key “draw-background”
No such key “draw-background”
Exception in thread himawaripy-main-thread:
Traceback (most recent call last):
File "/usr/lib/python3.9/threading.py", line 973, in _bootstrap_inner
self.run()
File "/usr/lib/python3.9/threading.py", line 910, in run
self._target(*self._args, **self._kwargs)
File "/home/ian/.local/lib/python3.9/site-packages/himawaripy/main.py", line 214, in thread_main
r = set_background(output_file)
File "/home/ian/.local/lib/python3.9/site-packages/himawaripy/utils.py", line 36, in set_background
assert os.system('bash -c "gsettings set org.gnome.desktop.background draw-background true"') == 0
AssertionError

This produces an image as expected.

This is my crontab line:
5 * * * * /home/ian/.local/bin/himawaripy --auto-offset >> /home/ian/log/cron.log 2>&1

This is the output of my cron.log:

himawaripy 2.2.0
Updating...
Latest version: 2021/11/17 21:40:00 GMT.
Detected offset: UTC-08:00
Offset version: 2021/11/17 03:40:00 GMT.
Downloading tiles...
Downloading tiles: 1/16 completed...
Downloading tiles: 2/16 completed...
Downloading tiles: 3/16 completed...
Downloading tiles: 4/16 completed...
Downloading tiles: 5/16 completed...
Downloading tiles: 6/16 completed...
Downloading tiles: 7/16 completed...
Downloading tiles: 8/16 completed...
Downloading tiles: 9/16 completed...
Downloading tiles: 10/16 completed...
Downloading tiles: 11/16 completed...
Downloading tiles: 12/16 completed...
Downloading tiles: 13/16 completed...
Downloading tiles: 14/16 completed...
Downloading tiles: 15/16 completed...
Downloading tiles: completed.
Saving to '/home/ian/.cache/himawaripy/himawari-20211117T034000.png'...
Could NOT retrieve env. var. DESKTOP_SESSION
Could NOT retrieve env. var. KDE_FULL_SESSION
Could NOT retrieve env. var. GNOME_DESKTOP_SESSION_ID
Could NOT retrieve env. var. XDG_CURRENT_DESKTOP
Fetched env. var. DBUS_SESSION_BUS_ADDRESS as unix:path=/run/user/1000/bus
Could NOT retrieve env. var. DISPLAY
Could NOT retrieve env. var. DESKTOP_SESSION
Could NOT retrieve env. var. KDE_FULL_SESSION
Could NOT retrieve env. var. GNOME_DESKTOP_SESSION_ID
Could NOT retrieve env. var. XDG_CURRENT_DESKTOP

And the background is black.

I am running Ubuntu 21.10 with gnome-shell version 40.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions