diff --git a/config.cfg-sample b/config.cfg-sample index 8ce0933..871bcec 100644 --- a/config.cfg-sample +++ b/config.cfg-sample @@ -2,3 +2,4 @@ username=myuser password=mypass posturl=http://yourhost.tld/gtkgrab/handler.php +editor=gimp %s diff --git a/screenshot b/screenshot index 98c8efd..923d26f 100755 --- a/screenshot +++ b/screenshot @@ -27,11 +27,15 @@ config.readfp(open(os.path.dirname(sys.argv[0]) + '/config.cfg')) user = config.get('GtkGrab','username') token = config.get('GtkGrab','password') postURL = config.get('GtkGrab','posturl') +editorCmd = config.get('GtkGrab', 'editor') path = '/tmp/ss.png' os.system('scrot --b -s '+path) os.system('convert '+path+' \( +clone -background black -shadow 60x5+10+10 \) +swap -background none -layers merge +repage '+path) +if len(sys.argv) > 1 and sys.argv[1] == '--edit': + os.system(editorCmd % (path)); + # encode the screenshot with base64 data = base64.b64encode(open(path, 'r').read()) diff --git a/screenshot-mac b/screenshot-mac index 2007099..d3bc57c 100755 --- a/screenshot-mac +++ b/screenshot-mac @@ -27,10 +27,14 @@ config.readfp(open(os.path.dirname(sys.argv[0]) + '/config.cfg')) user = config.get('GtkGrab','username') token = config.get('GtkGrab','password') postURL = config.get('GtkGrab','posturl') +editorCmd = config.get('GtkGrab', 'editor') path = '/tmp/ss.png' os.system('screencapture -i '+path) +if len(sys.argv) > 1 and sys.argv[1] == '--edit': + os.system(editorCmd % (path)); + # encode the screenshot with base64 data = base64.b64encode(open(path, 'r').read())