Screenshot : write in file mandatory by maim 5.6.3

master
Quentin Duchemin 2020-05-04 18:17:32 +02:00
parent 7586f3c64e
commit 17738f5827
Signed by: Chosto
GPG Key ID: 0547178FEEDE7D6B
1 changed files with 4 additions and 2 deletions

View File

@ -52,8 +52,10 @@ def read_args(argv):
return (upload, save, path)
def screenshot(img_format):
proc = subprocess.run(['maim', '-sl', '--color=0.6,0.4,0.2,0.2', '-f', img_format, '-u', '-m', '9', '-b', '5'], capture_output=True, check=True)
return proc.stdout
output = '/tmp/screenshot'
proc = subprocess.run(['maim', '-sl', '--color=0.6,0.4,0.2,0.2', '-f', img_format, '-u', '-m', '9', '-b', '5', output], check=True)
with open(output) as f:
return f.read()
def save_img(path, img, img_format):
# Create directory if needed