Skip to content

Instantly share code, notes, and snippets.

@Koushikphy
Last active June 13, 2023 06:13
Show Gist options
  • Save Koushikphy/7524f38e43cd552393a4ee8c60469902 to your computer and use it in GitHub Desktop.
Save Koushikphy/7524f38e43cd552393a4ee8c60469902 to your computer and use it in GitHub Desktop.
Take and show screenshot from remote machine
takes(){ # pass remote machine
case "$1" in
test) DIS_NUM='1' ;;
*) DIS_NUM='0' ;;
esac
ssh $1 "cd ~/Downloads; DISPLAY=:$DIS_NUM scrot screenshot.png"
fName=~/Downloads/.scr/screen_$(date -d "today" +"%Y_%m_%d=%H_%M").png
rsync -q $1:~/Downloads/screenshot.png $fName --remove-source-files
xdg-open $fName
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment