Record Desktop Automation

Script that helps recording digital painting with recordmydesktop.

Starts recording - filename is time/date.ogv.

Loops and stops recording every hour.

Painting folder is hostname-paint

currently set to Desktop. Not unique enough.


In [37]:
import os
import arrow
import json
import walkdir
import json
import socket
import getpass

In [ ]:


In [34]:
prinfold = (socket.gethostname() + '-paint')

In [40]:
getusr = getpass.getuser()

In [41]:
getusr


Out[41]:
'wcmckee'

In [ ]:


In [36]:
prinfold


Out[36]:
'zincwhite-paint'

In [ ]:


In [4]:
mytim = arrow.now()

In [5]:
mytim


Out[5]:
<Arrow [2015-04-24T01:08:17.938739+00:00]>

In [6]:
mytimdat = mytim.datetime

In [7]:
mytimdat.minute


Out[7]:
8

In [8]:
timtest  = str(mytimdat.hour) + str(mytimdat.minute) + str(mytimdat.second)

In [9]:
timtest


Out[9]:
'1817'

In [10]:
timdatez = str(mytimdat.year) + str(mytimdat.month) + str(mytimdat.day)

In [ ]:


In [11]:
timdatez


Out[11]:
'2015424'

In [12]:
fulldtiz = str(timtest) + str(timdatez)

In [13]:
fulldtiz


Out[13]:
'18172015424'

In [50]:
getusr


Out[50]:
'wcmckee'

In [51]:
prinfold


Out[51]:
'zincwhite-paint'

In [16]:
#files = file_paths(filtered_walk('/home/wcmckee/Desktop/', depth=100, included_files=['*.mp4']))

In [54]:
rcordcmd = ('recordmydesktop -o /home/' + getusr + '/' + prinfold + '/' + (fulldtiz) + '.ogv --no-sound --on-the-fly-encoding')

In [55]:
rcordcmd


Out[55]:
'recordmydesktop -o /home/wcmckee/zincwhite-paint/18172015424.ogv --no-sound --on-the-fly-encoding'

In [43]:
#Make a meta file that contains file info. 
#

In [19]:
desklis = os.listdir('/home/wcmckee/Desktop')

In [ ]:


In [20]:
opmeta = open('/home/wcmckee/Desktop/' + fulldtiz + '.json', 'w')

In [21]:
recordict = dict()

In [22]:
recordict.update({'videofile': '/home/wcmckee/Desktop/' + fulldtiz + '.ogv', 'date': timdatez, 'time': timtest })

In [23]:
for dlis in desklis:
    if '.xcf' in dlis:
        print dlis
        recordict.update({'xcffile' : dlis})
    #print dlis


template.xcf

In [24]:
mpz = json.dumps(recordict)

In [25]:
mpz


Out[25]:
'{"date": "2015424", "xcffile": "template.xcf", "videofile": "/home/wcmckee/Desktop/18172015424.ogv", "time": "1817"}'

In [26]:
jsdrop = json.loads(mpz)

In [27]:
jsdrop


Out[27]:
{u'date': u'2015424',
 u'time': u'1817',
 u'videofile': u'/home/wcmckee/Desktop/18172015424.ogv',
 u'xcffile': u'template.xcf'}

In [ ]:


In [28]:
recordict

#I want to get the data on the image name/layer name currently open in GIMP. Export off GIMP filename/active layer name 
#and open it up in this folder.


Out[28]:
{'date': '2015424',
 'time': '1817',
 'videofile': '/home/wcmckee/Desktop/18172015424.ogv',
 'xcffile': 'template.xcf'}

In [29]:
rcordcmd


Out[29]:
'recordmydesktop -o /home/wcmckee/Desktop/18172015424.ogv --no-sound --encoding-on-the-fly'

Copyright is a barrier. What is your views on open source licences such as creative commons?


In [30]:
os.system(rcordcmd)


Out[30]:
256

In [ ]: