I've got a python script that uses selenium to control a chromium browser window and I'd like to have it run on a schedule on a dedicated VM. The problem I have is that if I use cron to do this I'd have to add something like:
export DISPLAY=:0 && /path/to/command
but this only works if the user is logged in and I'd really like it to run without the user being logged in. Since it's a dedicated VM I suppose I could just run it with a user set to automatically log in but I'd like to at least have looked at doing it some other way.
I've been reading about using xinitrc but this seems a little heavy handed.
Any suggestions for another way of doing this?
(ubuntu 16.04)