You are not logged in.
I do have a bot that do interact with my company software, sending keys and moving and clicking the cursor and taking screenshots.
it does work as expected but since there is no way to send a click to an application on xorg without actually moving the cursor, it makes the desktop unusable while the bot is running.
As alternative I'm trying to use it on a different xorg session:
Ctrl Alt F1 - GDM
Ctrl Alt F2 - User1
Ctrl Alt F3 - User2
but there is a caveat: when I switch to the other session (ctrl alt F3) the screenshots taken become black only.
I tried to use software like "import", "scrot" or "xwd", with or without the "DISPLAY=" stuff, and it just work while I'm in the current xorg session.
Is it even possible to be accomplished? if not, alternatives are welcome, except virtualization which is not an option.
Thanks
Last edited by hlechner (2022-06-06 16:40:33)
Offline
If not, alternatives are welcome, except virtualization which is not an option.
What do you mean by "virtualization"? YOu could use a nested server (xephyr) or VNC. The VESA driver *might* render regardless (at limited performance/features) and quite possibly a screenshot feature built into a compositor could work.
Online
I just mentioned virtualization to avoid someone suggesting to avoid dealing with xorg sessions and just create a virtualbox and run the bot inside it.
the xephyr seems a great deal, I never used it but gonna test it right now.
About the VNC that you mentioned, is it to use with xephyr? maybe I didn't get how to use for it in this case.
I'll update this topic when I reach the solution, meanwhile thanks for the help
Offline
No, running a vnc server would be an alternative to the nested (xephyr) one.
https://wiki.archlinux.org/title/TigerVNC
Online
I changed the title to reflect [SOLVED] as I see the xephyr can be the definitive answer for my question, after I solve some small issues (and enable virtualgl) and see the whole performance of it I will give a try on TigerVNC as well to see which one fits me best.
After a day of tests on xephyr, I can say it does work well, and it's pretty simple.
Thanks again Seth
---
Some notes that can be useful for someone searching for it:
all the examples below uses DISPLAY :5 change it for your need
---
Start Xephyr (in this example 1920x1080 will be the resolution):
Xephyr -br -ac -noreset -screen 1920x1080 :5 &Gnome can be called using the command:
* there is a argument "--nested" but in my case it does make the performance goes really bad
DISPLAY=:5 dbus-run-session -- gnome-shell &Gnome sometimes seems to use a wrong resolution, so you can run a xrandr to fix it:
xrandr -d :5 -s 1920x1080If you lack graphics acceleration there are two options, glamor (2D) and virtualgl (3D):
- glamor can be used by adding a "-glamor" to the xephyr command:
Xephyr -br -ac -noreset -glamor -screen 1920x1080 :5 &- virtualgl after install virtualgl, run "vglserver_config", add your user and gdm (if you use gdm ofc) to "vglusers" group, restart your system. now you will be able to use virtualgl with syntax:
vglrun application_name* if you face any problems with virtualgl saying it didn't find ":0" display you can just use "-d" to define which display it will run ontop, try :1 if in doubt
* if the application complains about libs, probably is related to viariables the virtualgl create, you can compare your host session with your nested one by using "env", in my case I had to deal with LD_LIBRARY_PATH, just setting it empty was enough:
vglrun -d :1 env LD_LIBRARY_PATH="" application_namefor some unknown reason python-libxdo seems to report num lock as modifier when on my host xorg session it doesn't, so be aware if you using it
Last edited by hlechner (2022-06-07 17:25:15)
Offline