I did a lot of learning and now I understand everything… ![]()
TL;DR
So as you said @TLATER, nothing wrong with screenshot. It works in graphical environments and I assumed that, because I copied some config from the nixos test for sway and my screenshots were blank, screenshot (which uses screendump under the hood) only could get the output from text ttys or something, because the man page for screendump says “dump the contents of a virtual console to stdout” and I assumed “virtual console” meant “not graphical session”.
Details
In fact the issue I was facing when using the config from the nixos test for sway was that I was using this bit of config
virtualisation.qemu.options = [
"-vga none"
"-device virtio-gpu-pci"
];
but I was missing
environment.variables."WLR_RENDERER" = "pixman"
this config was necessary, as the non-interactive tests use a version of qemu (qemu_test) that does not have graphics drivers (more or less… I think).
This also explains why I could not use this config I found here
virtualisation.qemu.options = [
"-vga none"
"-device virtio-vga-gl"
"-display gtk,gl=on"
];
with the non-interactive test. And that’s because virgl and the gtk display are not available to qemu_test. Also that config would work in the interactive tests because it would use the “normal” qemu package, which had virgl and gtk support.
Questions
This leaves me with a few questions.
- Why is
qemu_testused for the non-interactive tests (or why does it disable graphical support on a few levels) - Also why does
screenshotseem to when I use it in interactive mode withvirgl(error below)?
pnmtopng: Unable to open file '/home/rosario/Documents/NixOS-Config/deps/system-configs/foo.png.ppm' for reading. fopen() returns errno 2 (No such file or directory)