Celeb Glow
general | March 24, 2026

how to identify DISPLAY value of multiple hdmi ports of machine for cronjob

my current cronjob is this:

 * * * * * DISPLAY=:0 python3 "/home/ubuntu/test.pyc"

This cronjob works fine with monitor connected on HDMI port 1 but when I change DISPLAY=:1 then it does not display output on second HDMI port connected screen.

I want to redirect output of cronjob to second HDMI port connected screen but I dont know how to get the value or number of second HDMI port.

1 Answer

Display numbers does not necessary relate to HDMI port numbers. Please, read documentation here: Section "Display Names" first.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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