In Linux on my Chromebook, I am trying to take a screenshot using the command line, but nothing seems to be working. I have tried ImageMagick
...
sudo apt-get install imagemagick
import -window root filename.png
# "unable to read X window image 'root'"
import filename.png
# "unable to grab mouse '': No such file or directory"
And I have also tried scrot
...
sudo apt-get install scrot
scrot -u filename.png
#"BadDrawable (invalid Pixmap or Window parameter)"
I tried several python methods, but the only one that I could successfully install and get to run without errors was pyscreeze
(which uses scrot), and it produced nothing but a blank, black image, which is useless to me.
In terms of other python methods, I tried pyautogui
which failed to install, telling me "Failed building wheel for Pillow." I tried pyscreenshot
, which installed and ran but told me "All backends failed." I also tried ImageGrab
, which told me "ImageGrab is MacOS and Windows only."
Does anyone know of a way to make this work?
Thanks in advance!
Javascript solution
Here is a way to take a screenshot of any part of the chromebook's screen, a chrome window, or a chrome tab.
Paste this into your browser console to take a screenshot.