Skip to content

Commit

Permalink
Basic
Browse files Browse the repository at this point in the history
  • Loading branch information
satyendra pandey committed Feb 6, 2018
0 parents commit aa297f0
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#Virtual Screen

**1) You have to run Server.py and keep Test.sh in server.
**2) And to see interface You have to run Interface.py on your user desktop.
7 changes: 7 additions & 0 deletions Server.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import os

# use following command to kill the bash process
# kill `ps -ef | grep bash Test.sh | awk '{ print $2 }'`

os.system('nohup bash Test.sh &')

5 changes: 5 additions & 0 deletions Test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
while true;
do
gnome-screenshot -p -f '/var/www/html/1.png';
sleep 2;
done
23 changes: 23 additions & 0 deletions interface.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import cv2, urllib, time, os
import numpy as np

print "Connecting..."

ip = "Put IP of that computer Here"

try:
req = urllib.urlopen('http://' + ip + '/1.png')
print "Connected"

while True:
req = urllib.urlopen('http://' + ip + '/1.png')
arr = np.asarray(bytearray(req.read()), dtype=np.uint8)
img = cv2.imdecode(arr,-1)
cv2.imshow('Desktop-2',img)
k = cv2.waitKey(10)
if k == 27:
break
time.sleep(2)

except:
print "Can't Connect NOW"

0 comments on commit aa297f0

Please sign in to comment.