Last active
June 13, 2023 06:13
-
-
Save Koushikphy/7524f38e43cd552393a4ee8c60469902 to your computer and use it in GitHub Desktop.
Take and show screenshot from remote machine
This file contains 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
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