|
|
|
@ -30,10 +30,11 @@ else:
@@ -30,10 +30,11 @@ else:
|
|
|
|
|
elif sys.argv[1] == '--region': |
|
|
|
|
outputs = run(['swaymsg', '-t', 'get_outputs'], check=True, capture_output=True) |
|
|
|
|
for output in json.loads(outputs.stdout): |
|
|
|
|
if not output.get("focused"): |
|
|
|
|
continue |
|
|
|
|
image = Popen(["grim", "-o", f"{output.get('name')}", '-'], stdout=PIPE) |
|
|
|
|
viewer = Popen(['swayimg', '-f', '-o', f'{output.get("name")}','-'], stdin=image.stdout) |
|
|
|
|
image_viewers.append(viewer) |
|
|
|
|
time.sleep(0.1) |
|
|
|
|
|
|
|
|
|
region = run('slurp', check=True, capture_output=True) |
|
|
|
|
run(["grim", '-g', '-', file_name], check=True, input=region.stdout) |
|
|
|
|