-
-
Save docop/4301b9b5cea8577a55083301a8705bad to your computer and use it in GitHub Desktop.
screenshot linux automation , xdotool , xwininfo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import subprocess | |
subprocess.call(["sh","./screenshot.sh","11","www.canvera.com"]) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#Start a xserver using vncserver | |
#vncserver :$1 -geometry 1024x768 -SecurityTypes None | |
#xserver is running at $1 | |
#Start firefox in the $1 vncserver window | |
#firefox --display=:$1 & | |
DISPLAY=:$1 #Connect to the another xserver | |
#xdotool search "Mozilla Firefox" windowactivate --sync | |
WID=`xdotool search --name "Mozilla Firefox" | head -1` | |
xdotool windowactivate $WID | |
echo $WID | |
xdotool key ctrl+l | |
xdotool type $2 | |
xdotool key Return | |
sleep 5 | |
#xdotool key Page_Down # To handle floating footer . May need to send some more Page_Down | |
#sleep 1 | |
xdotool key shift+F2 | |
#Following command will take full page including the part which is not right now displayed | |
#xdotool type "screenshot /home/yuva/hobby/$2.img --fullpage" | |
#Take only what is shown in the page | |
xdotool type "screenshot /home/yuva/hobby/$2.img" | |
echo "done screenshot" | |
xdotool key Return | |
xdotool key shift+F2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment