Taking a Screenshot in X11: Difference between revisions

From Leo's Notes
This page was last edited on 1 September 2019, at 06:22.
m Text replacement - "Category:Linux" to "Category:Linux{{Navbox Linux}}"
m Text replacement - "Category:Linux{{Navbox Linux}}" to "{{Navbox Linux}}Category:Linux"
Line 18: Line 18:
}}
}}


[[Category:Linux]]{{Navbox Linux}}
{{Navbox Linux}}[[Category:Linux]]

Revision as of 06:22, 1 September 2019

Quick note on taking a screenshot on Linux.

Linux

This method has been used for the remote displays. Ensure xorg-xwd is installed, then run:

# DISPLAY=:0 xwd -silent -root > bob.xwd
# file bob.xwd
bob.xwd: XWD X Window Dump image data, "xwdump", 1824x984x24

The XWD file can then be converted by or opened with opened in GIMP. Alternatively, you can convert the file using the Python script at https://github.com/drj11/xwd2png (mirror at https://git.steamr.com/others/xwd2png)

## Example usage:
$ pip install --user pypng
$ export PYTHONPATH=$(python -c "import site, os; print(os.path.join(site.USER_BASE, 'lib', 'python', 'site-packages'))"):$PYTHONPATH
$ cat ~/bob2.xwd