Friday, May 3, 2024
 Popular · Latest · Hot · Upcoming
7
rated 0 times [  7] [ 0]  / answers: 1 / hits: 34697  / 2 Years ago, sat, october 29, 2022, 5:20:32

I tried using DISPLAY=:0 import -window root "$HOME/Pictures/screenshot.png" (import is part of the ImageMagick suite), but that just displays a black screen.



I want to do this as I wanted to automate opening an app and taking screenshots of it in different languages, and to change languages, I need to restart lightdm. therefore, run on a tty so your script continues running...


More From » xorg

 Answers
7

Here's what worked for me.



chvt 7
DISPLAY=:0 import -window root "$HOME/Pictures/screenshot.png
chvt 1

[#33799] Sunday, October 30, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
antoccasiona

Total Points: 430
Total Questions: 127
Total Answers: 131

Location: Netherlands
Member since Sat, Jun 26, 2021
3 Years ago
;