Taking a Screenshot in X11: Difference between revisions

From Leo's Notes
This page was last edited on 17 June 2019, at 15:45.
Created page with "Quick note on taking a screenshot on Linux. == Linux == This method has been used for the remote displays. Ensure {{code|xorg-xwd}} is installed, then run: {{highlight|lang=..."
 
No edit summary
Line 10: Line 10:
}}
}}


The XWD file can then be converted or opened in GIMP.
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)
{{highlight|lang=terminal|code=
## 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 | python ./xwd.py > ~/bob2.png
}}


[[Category:Linux]]
[[Category:Linux]]

Revision as of 15:45, 17 June 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