Pcmanfm set wallpaper fails on Raspbian stretch in cron

后端 未结 1 1358
有刺的猬
有刺的猬 2020-12-11 10:00

I am running a nearly fresh image of Raspbian Stretch 4.9 with a desktop and have a program which creates a new image for the computer background every few minutes.

相关标签:
1条回答
  • 2020-12-11 10:21

    I had exactly the same issue, except I am running Lubuntu 17.04. It appeared lately after a recent update, though cannot pinpoint when. After lot's of research I became suspicious that one of the XDG enviromental variables must be exported too. Following some trial and error, I found that exporting XDG_RUNTIME_DIR solved the problem for me. You may want to give it a try.

    To figure out the value run: echo $XDG_RUNTIME_DIR

    The working wallpaper changer running from cron for me now looks like:

    #!/bin/bash
    ...
    export DISPLAY=:0
    export XAUTHORITY=/home/krisz/.Xauthority
    export XDG_RUNTIME_DIR=/run/user/1000
    pcmanfm --set-wallpaper=${dir}/${file} --wallpaper-mode=crop
    ...
    
    0 讨论(0)
提交回复
热议问题