I have a script that kills the biggest lxpanel task on my Raspberry Pi, but occasionally it kills both tasks, which kills the menu system on the GUI.

I am using VNC to view the desktop and I have putty to create remote shells. I intend to make my script a crontab job, but that means that it does not have a "display:", so "lxpanelctl restart" will not work (cannot open display:).

So, how do I restart the GUI from a crontab job which is like doing it from a remote putty shell?


Your cron doesn't have its DISPLAY variable set, so it simply doesn't know which display it is to restart lxpanel in.

Simplest solution:

# lxpanel restarts every day at 03:00
00 3 * * * export DISPLAY=":0.0" && lxpanelctl restart
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.