There are probably better ways, but if the command:returns a number, you're running X and scrot will work. If it returns no output, you're not running X and it won't
Code:
pgrep Xorg
Statistics: Posted by scruss — Sat Aug 24, 2024 4:47 pm