adi1090x / dynamic-wallpaper

A simple bash script to set wallpapers according to current time, using cron job scheduler.
GNU General Public License v3.0
1.88k stars 115 forks source link

Wallpaper not changing #45

Closed Sagyam closed 3 years ago

Sagyam commented 3 years ago

Output of echo $DESKTOP_SESSION
/usr/share/xsessions/plasma

Extra Info

OS: Debian GNU/Linux 10 (buster) x86_64 Kernel: 4.19.0-13-amd64 Shell: zsh 5.7.1 DE: KDE WM: KWin

Problem

Wallpaper changes when done manually but returns pywal not installed exiting when done by cron job.

adi1090x commented 3 years ago

Does that not work? 0 * * * * env DISPLAY=:0 DESKTOP_SESSION="/usr/share/xsessions/plasma" DBUS_SESSION_BUS_ADDRESS="YOUR_VALUE /usr/bin/dwall -s home

adi1090x commented 3 years ago

If not, Try this one as well -

0 * * * * env SHELL="YOUR_SHELL" DISPLAY="YOUR_DISPLAY" DESKTOP_SESSION="YOUR_SESSION" DBUS_SESSION_BUS_ADDRESS="YOUR_VALUE" XDG_RUNTIME_DIR="YOUR_VALUE" XDG_DATA_DIRS"YOUR_VALUE" /usr/bin/dwall -s firewatch
Sagyam commented 3 years ago

Okay like you said I tried

0 * * * * env SHELL="bin/zsh" DISPLAY=":0" DESKTOP_SESSION="/usr/share/xsessions/plasma" DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/1000/bus" XDG_RUNTIME_DIR="/run/user/1000" XDG_DATA_DIRS"/usr/share:/usr/share:/usr/local/share" /usr/bin/dwall -s firewatch

and I got this in email

Cron Variables

X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env:

[*] Using style : firewatch
tput: No value for $TERM and no -T specified
tput: No value for $TERM and no -T specified
[!] pywal is not installed on your system, exiting...
tput: No value for $TERM and no -T specified
tput: No value for $TERM and no -T specified
Sagyam commented 3 years ago

Apparently its still using shell event though I have told to use zsh

Sagyam commented 3 years ago

Alright I have SOLVED this issue!! Here is my cron file

MAILTO="sagyamthapa32@gmail.com"

#All mentioned env variables
SHELL=/bin/zsh
DESKTOP_SESSION=/usr/share/xsessions/plasma
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
DESKTOP_SESSION=/usr/share/xsessions/plasma
DISPLAY=:0
XDG_DATA_DIRS=/usr/share:/usr/share:/usr/local/share
XDG_RUNTIME_DIR=/run/user/1000

#Extra Variables
TERM=xterm-256color
USER=sagyam
LOGNAME=sagyam
PATH=/home/sagyam/anaconda3/condabin:/usr/local/bin:/usr/bin:/bin:/usr/games

0 * * * * /usr/bin/dwall -s earth

I think it needed also needed the PATH variable for pywal dependency.