rr- / screeninfo

Fetch location and size of physical screens.
Other
208 stars 36 forks source link

Exception: Xinerama is not active #65

Open StevenMacias opened 2 years ago

StevenMacias commented 2 years ago

Hi, this is a really special request since I am working with a production server that runs Debian Jeesie, python 3.4 and screeninfo 0.2.2. I am not allowed to update packages in there so I know this is going to be challenging.

Basically, we have a GUI that should run on a physical screen. This specific system does not have a physical screen connected, however X11 is running and I can take screenshots graphical programs like xterm.

However, when I run the app in this headless server I get the following error:

Traceback (most recent call last): 
 File "/usr/lib/python3.4/runpy.py", line 170, in _run_module_as_main
   "__main__", mod_spec)
 File "/usr/lib/python3.4/runpy.py", line 85, in _run_code
   exec(code, run_globals)
 File "tools/start_webview.py", line 50, in <module>
 File "tools/start_webview.py", line 27, in run
 File "/usr/local/lib/python3.4/dist-packages/screeninfo/screeninfo.py", line 192, in get_monitors
   return chosen.get_monitors()
 File "/usr/local/lib/python3.4/dist-packages/screeninfo/screeninfo.py", line 144, in get_monitors
   raise Exception('Xinerama is not active')
Exception: Xinerama is not active

I have tried to enable Xinerama on xorg.conf:

Section "ServerLayout" 
       Identifier     "X.org Configured"
       Screen      0  "Screen0" 0 0
       InputDevice    "Mouse0" "CorePointer"
       InputDevice    "Keyboard0" "CoreKeyboard"
       Option "Xinerama" "1"
EndSection 

And then systemctl restart display-manager. It is using slim. I even restarted the whole server since the issue persisted.

When I run just scrot, I get the following message giblib error: Can't open X display. It *is* running, yeah?but by googling a little bit I managed to make it work by setting the display environment variable for the command like this: DISPLAY=:0 scrot.

Any help to figure out what is going on with this error is more than welcome. I am quite new with trying to launch virtual displays on headless servers.

rr- commented 2 years ago

I'm not sure how to help you if you cannot update the packages. Does supplying DISPLAY help?

StevenMacias commented 2 years ago

Hi! Thanks for your reply. Supplying DISPLAY does not help. I know it is a complicated situation...

StevenMacias commented 2 years ago

We are setting up a test server to see what breaks if we update that package only. I will keep you updated. Are the versions backward compatible?