Yat*_*wal 11 display xorg tty screenshot display-manager
我尝试使用DISPLAY=:0 import -window root "$HOME/Pictures/screenshot.png"(import是 ImageMagick 套件的一部分),但它只显示黑屏。
我想这样做是因为我想自动打开一个应用程序并用不同的语言截取它的屏幕截图,并且要更改语言,我需要重新启动 lightdm。因此,在 tty 上运行,以便您的脚本继续运行...
Nik*_*las 11
除了现有答案之外,要在终端中以 ASCII 格式显示屏幕截图:
xwd -root -display :0 | convert - jpg:- | jp2a - --colorsRun Code Online (Sandbox Code Playgroud)
(需要x11-apps为xwd,imagemagick为convert和jp2a。)
小智 7
这是使用 的解决方案xwd,几乎在所有 Xorg 安装中都可用:
xwd -root -out screenshot.xwd
Run Code Online (Sandbox Code Playgroud)
该screenshot.xwd文件可以用 GIMP 打开:
有关更多信息,请参阅http://www.x.org/wiki/UserDocumentation/GettingStarted/。
尝试使用快门
DISPLAY=:0 shutter -f -e -n -o "$HOME/Pictures/screenshot.png"
Run Code Online (Sandbox Code Playgroud)
导入不起作用,因为根窗口未在使用中。合成“绕过”它(每个窗口都在自己的缓冲区中呈现,然后多路复用到显示器,而不是旧的方式,它们都在“根”窗口上呈现)。
此外,您需要在截取屏幕截图之前确保 VTY 处于活动状态。例如,
#!/bin/bash
X :1 &
export DISPLAY=:1
sleep 10 # give time for X to start
gedit &
sleep 10 # give time for app to do something
chvt 8 # ensure the X display is active
shutter -f -e -n -o "$HOME/Pictures/screenshot.png" # screenshot
killall xorg # terminate X
Run Code Online (Sandbox Code Playgroud)
这对我有用。
chvt 7
DISPLAY=:0 import -window root "$HOME/Pictures/screenshot.png
chvt 1
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
29229 次 |
| 最近记录: |