Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

9
  • Have you checked your environment? The $DISPLAY could be :0.0. Commented Feb 28, 2017 at 12:22
  • @KenSharp, I have. Also, the same command works if I enter it from another tty. Commented Feb 28, 2017 at 12:24
  • As what user does this cronjob run? I do believe that root is by default not allowed to use an x-session from a cronjob Commented Feb 28, 2017 at 12:38
  • @Pelle, running as same user that is logged in to x. Commented Feb 28, 2017 at 12:39
  • 1
    I should add that I solved this simply by putting DBUS_SESSION_BUS_ADDRESS=<...> at the top of my cron file. Works after reboot too on my system. Commented Feb 28, 2017 at 15:43