-
Notifications
You must be signed in to change notification settings - Fork 239
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
Image not showing up in Ubuntu 16.04 #83
Comments
yup, this is true. the background image did not change automatically with crontab configuration, but only worked with manual run on terminal. why? |
cron only has access to a very restricted set of environment variables - the python script here makes use of one that is not available in that case. see SO answer here: |
Hey, I tried and experienced the problem myself as well, although I didn't encounter it before (not sure if they changed the behaviour of services [if not, then how did it work for so long?]). Anyway, not only the script makes use of environment variables but also |
i have managed to fix this issue as a walk-around approach. basically, the link that @ngrande shared above helped a lot. that is, i have created a separate shell script as the below, and added in my crontab with the same period as the himawaripy executable file. this seemed to work very well so far. #!/bin/bash
# http://bit.ly/2ines3u
# Wallpaper's directory.
dir="${HOME}/.cache/himawaripy/"
# export DBUS_SESSION_BUS_ADDRESS environment variable
PID=$(pgrep gnome-session)
export DBUS_SESSION_BUS_ADDRESS=$(grep -z DBUS_SESSION_BUS_ADDRESS /proc/$PID/environ | cut -d= -f2-)
# Random wallpaper.
wallpaper=`find "${dir}" -type f | shuf -n1`
# Change wallpaper.
# http://bit.ly/HYEU9H
gsettings set org.gnome.desktop.background picture-options "spanned"
gsettings set org.gnome.desktop.background picture-uri "file://${wallpaper}" |
above approach by @soohyunc is totally working. One suggestion is to change the "spanned" to "scaled" in order to center the image. Thanks! |
@soohyunc answer should be in |
Fixed! You should now be able to use it as described in the README without any additional scripts. Let me know if you have any further questions. =) |
OR PID=$(pgrep gnome-session | head -n1) |
I followed every step as described in the installation process, but nothing happened. The is installed, I have looked into the directory, but the desktop background didn't change.
The text was updated successfully, but these errors were encountered: