Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a way to setting new daily wallpaper automatically everyday without restart linux? #47

Open
guirahy opened this issue May 14, 2024 · 8 comments

Comments

@guirahy
Copy link

guirahy commented May 14, 2024

Is there a way to setting new daily wallpaper automatically everyday without restart linux?
I use Ubuntu 24.04.

@hifron
Copy link

hifron commented Jul 24, 2024

00 09 * * 1-7 env XDG_RUNTIME_DIR=/run/user/1000 bing-wall

in crontab -e each day at 9:00 but you need to close it afterwards. maybe need to use /snap/bin/bing-wall

@ivanjx
Copy link

ivanjx commented Aug 24, 2024

@hifron that env does not work for me. i had to copy my entire env into the crontab file to make it work. not sure which one is really making it works.

@keshavbhatt
Copy link
Owner

keshavbhatt commented Aug 24, 2024

00 09 * * 1-7 env XDG_RUNTIME_DIR=/run/user/1000 bing-wall

in crontab -e each day at 9:00 but you need to close it afterwards. maybe need to use /snap/bin/bing-wall

You can use bing-wall --set
This will download and set the wallpaper and close the app automatically.

@ivanjx
Copy link

ivanjx commented Aug 24, 2024

@keshavbhatt do you know exactly which environment variables are required to make it able to run from inside crontab?

@keshavbhatt
Copy link
Owner

@keshavbhatt do you know exactly which environment variables are required to make it able to run from inside crontab?

I dont know why we need env variables. The app executable should be callable directly.
Otherwise try to run using full path like
/snap/bin/bing-wall --set or snap run bing-wall --set

@ivanjx
Copy link

ivanjx commented Aug 24, 2024

@keshavbhatt according to this it is DBUS_SESSION_BUS_ADDRESS that is required by the gsettings program to be able to run properly from crontab.

edit: im using wayland.

@ivanjx
Copy link

ivanjx commented Aug 24, 2024

fix:

#!/bin/bash

export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
export QT_QPA_PLATFORM=offscreen

/snap/bin/bing-wall --set

to test:
env -i thescript.sh

note: env -i resets the environment variable supplied by the gui terminal so it acts like crontab environment instead.

@hifron
Copy link

hifron commented Aug 24, 2024

If there is some script to delete old wallpapers in bash/powershell, it needs non-gui part of user and maybe it won't work, but not tested this way from crontab.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants