xrandr Command Error "Can't open display"
#1
I asked about this error before on another thread because I didn't know what the real problem was.

So here it is:
No matter what I do, I cannot get xrandr to work correctly and it appears as if I have no display when, in fact, one is plugged in and working!
I have a simple add-on to check display settings under kodi as such:
Code:
import subprocess as sp
import xbmcaddon
import xbmcgui
 
addon       = xbmcaddon.Addon()
addonname   = addon.getAddonInfo('name')

# Set a string variable to use
line1 = sp.getoutput('/usr/bin/xrandr | tee error.txt')
# line1 = "Hello World!\nWe can write anything we want here using Python"
# Launch a dialog box in kodi showing the string variable 'line1' as the contents
xbmcgui.Dialog().ok(addonname, line1)
I expected to see display settings but I only get "Can't open display" instead.
fbset provides more information but still fails to list available displays:
Code:
import subprocess as sp
import xbmcaddon
import xbmcgui
 
addon       = xbmcaddon.Addon()
addonname   = addon.getAddonInfo('name')

# Set a string variable to use
line1 = sp.getoutput('/usr/bin/fbset | tee error.txt')
# line1 = "Hello World!\nWe can write anything we want here using Python"
# Launch a dialog box in kodi showing the string variable 'line1' as the contents
xbmcgui.Dialog().ok(addonname, line1)

I am running the latest 64 bit verion of Raspberry Pi OS:
Code:
$ uname -a 
Linux pi-tv 5.15.61-v8+ #1579 SMP PREEMPT Fri Aug 26 11:16:44 BST 2022 aarch64 GNU/Linux

Outside of kodi, when starting GUI using startx, everything works correctly and xrandr opens display as HDMI-1.

Does anyone know what name kodi uses for the active display?
Any help is greatly appreciated.
Reply

Logout Mark Read Team Forum Stats Members Help
xrandr Command Error "Can't open display"0