From ffc4c32baccbd53276aaef4dd067080f700dbf1d Mon Sep 17 00:00:00 2001 From: David Chang Date: Wed, 17 Jan 2024 17:27:08 +0800 Subject: [PATCH] ver Jan17th updated the existing task configs --- desktop_env/controllers/setup.py | 23 +++- desktop_env/server/main.py | 113 +++++++++++++++--- .../0cecd4f3-74de-457b-ba94-29ad6b5dafb6.json | 25 ++++ .../1334ca3e-f9e3-4db8-9ca7-b4c653be7d17.json | 25 ++++ .../21df9241-f8d7-4509-b7f1-37e501a823f7.json | 25 ++++ .../2bd59342-0664-4ccb-ba87-79379096cc08.json | 25 ++++ .../347ef137-7eeb-4c80-a3bb-0951f26a8aff.json | 25 ++++ .../4188d3a4-077d-46b7-9c86-23e1a036f6c1.json | 25 ++++ .../4f07fbe9-70de-4927-a4d5-bb28bc12c52c.json | 25 ++++ .../a01fbce3-2793-461f-ab86-43680ccbae25.json | 25 ++++ .../aa3a8974-2e85-438b-b29e-a64df44deb4b.json | 4 +- .../f9584479-3d0d-4c79-affa-9ad7afdd8850.json | 25 ++++ .../030eeff7-b492-4218-b312-701ec99ee0cc.json | 15 ++- .../35253b65-1c19-4304-8aa4-6884b8218fc0.json | 14 ++- .../3d1682a7-0fb0-49ae-a4dc-a73afd2d06d5.json | 19 +-- ...7-0fb0-49ae-a4dc-a73afd2d06d5.json.nosetup | 19 +-- .../480bcfea-d68f-4aaa-a0a9-2589ef319381.json | 15 ++- .../6766f2b8-8a72-417f-a9e5-56fcaa735837.json | 15 ++- ...8-8a72-417f-a9e5-56fcaa735837.json.nosetup | 15 ++- .../94760984-3ff5-41ee-8347-cf1af709fea0.json | 15 ++- .../c9e7eaf2-b1a1-4efc-a982-721972fa9f02.json | 15 ++- .../e1e75309-3ddb-4d09-92ec-de869c928143.json | 14 ++- ...9-3ddb-4d09-92ec-de869c928143.json.nosetup | 14 ++- 23 files changed, 449 insertions(+), 86 deletions(-) diff --git a/desktop_env/controllers/setup.py b/desktop_env/controllers/setup.py index 13d4ee8..9c6b559 100644 --- a/desktop_env/controllers/setup.py +++ b/desktop_env/controllers/setup.py @@ -298,11 +298,11 @@ class SetupController: # TODO raise NotImplementedError() - def _activate_window_setup(self, window_name: str): + def _activate_window_setup(self, window_name: str, strict: bool = False, by_class: bool = False): if not window_name: raise Exception(f"Setup Open - Invalid path ({window_name}).") - payload = json.dumps({"window_name": window_name}) + payload = json.dumps({"window_name": window_name, "strict": strict, "by_class": by_class}) headers = { 'Content-Type': 'application/json' } @@ -317,6 +317,25 @@ class SetupController: except requests.exceptions.RequestException as e: logger.error("An error occurred while trying to send the request: %s", e) + def _close_window_setup(self, window_name: str, strict: bool = False, by_class: bool = False): + if not window_name: + raise Exception(f"Setup Open - Invalid path ({window_name}).") + + payload = json.dumps({"window_name": window_name, "strict": strict, "by_class": by_class}) + headers = { + 'Content-Type': 'application/json' + } + + # send request to server to open file + try: + response = requests.post(self.http_server + "/setup" + "/close_window", headers=headers, data=payload) + if response.status_code == 200: + logger.info("Command executed successfully: %s", response.text) + else: + logger.error(f"Failed to close window {window_name}. Status code: %s", response.text) + except requests.exceptions.RequestException as e: + logger.error("An error occurred while trying to send the request: %s", e) + # Chrome setup def _chrome_open_tabs_setup(self, urls_to_open: List[str]): host = self.vm_ip diff --git a/desktop_env/server/main.py b/desktop_env/server/main.py index f1f11b7..13a5469 100644 --- a/desktop_env/server/main.py +++ b/desktop_env/server/main.py @@ -14,7 +14,7 @@ import pyautogui import requests from PIL import Image from Xlib import display, X -from flask import Flask, request, jsonify, send_file, abort, send_from_directory +from flask import Flask, request, jsonify, send_file, abort #, send_from_directory from lxml.etree import _Element from pyatspi import Accessible, StateType from pyatspi import Action as ATAction @@ -579,39 +579,114 @@ def open_file(): def activate_window(): data = request.json window_name = data.get('window_name', None) + if not window_name: + return "window_name required", 400 + strict: bool = data.get("strict", False) # compare case-sensitively and match the whole string + by_class_name: bool = data.get("by_class", False) os_name = platform.system() if os_name == 'Windows': import pygetwindow as gw - try: - # Find the VS Code window - vscode_window = gw.getWindowsWithTitle(window_name)[0] - # Activate the window, bringing it to the front - vscode_window.activate() - except IndexError: - return "VS Code window not found.", 404 + if by_class_name: + return "Get window by class name is not supported on Windows currently.", 500 + windows: List[gw.Window] = gw.getWindowsWithTitle(window_name) + + window: Optional[gw.Window] = None + if len(windows)==0: + return "Window {:} not found (empty results)".format(window_name), 404 + elif strict: + for wnd in windows: + if wnd.title==wnd: + window = wnd + if window is None: + return "Window {:} not found (strict mode).".format(window_name), 404 + else: + window = windows[0] + window.activate() elif os_name == 'Darwin': import pygetwindow as gw - try: - # Find the VS Code window - vscode_window = gw.getWindowsWithTitle(window_name)[0] - # Un-minimize the window and then bring it to the front - vscode_window.unminimize() - vscode_window.activate() - except IndexError: - return "VS Code window not found.", 404 + if by_class_name: + return "Get window by class name is not supported on macOS currently.", 500 + # Find the VS Code window + windows = gw.getWindowsWithTitle(window_name) + + window: Optional[gw.Window] = None + if len(windows)==0: + return "Window {:} not found (empty results)".format(window_name), 404 + elif strict: + for wnd in windows: + if wnd.title==wnd: + window = wnd + if window is None: + return "Window {:} not found (strict mode).".format(window_name), 404 + else: + window = windows[0] + + # Un-minimize the window and then bring it to the front + window.unminimize() + window.activate() elif os_name == 'Linux': # Attempt to activate VS Code window using wmctrl - subprocess.Popen(["wmctrl", "-a", window_name]) + subprocess.run( [ "wmctrl" + , "-{:}{:}a".format( "x" if by_class_name else "" + , "F" if strict else "" + ) + , window_name + ] + ) else: return f"Operating system {os_name} not supported.", 400 - return "File opened successfully", 200 + return "Window activated successfully", 200 +@app.route("/setup/close_window", methods=["POST"]) +def close_window(): + data = request.json + if "window_name" not in data: + return "window_name required", 400 + window_name: str = data["window_name"] + strict: bool = data.get("strict", False) # compare case-sensitively and match the whole string + by_class_name: bool = data.get("by_class", False) + + os_name: str = platform.system() + if os_name == "Windows": + import pygetwindow as gw + + if by_class_name: + return "Get window by class name is not supported on Windows currently.", 500 + windows: List[gw.Window] = gw.getWindowsWithTitle(window_name) + + window: Optional[gw.Window] = None + if len(windows)==0: + return "Window {:} not found (empty results)".format(window_name), 404 + elif strict: + for wnd in windows: + if wnd.title==wnd: + window = wnd + if window is None: + return "Window {:} not found (strict mode).".format(window_name), 404 + else: + window = windows[0] + window.close() + elif os_name == "Linux": + subprocess.run( [ "wmctrl" + , "-{:}{:}c".format( "x" if by_class_name else "" + , "F" if strict else "" + ) + , window_name + ] + ) + elif os_name=="Darwin": + import pygetwindow as gw + return "Currently not supported on macOS.", 500 + else: + return "Not supported platform {:}".format(os_name), 500 + + return "Window closed successfully.", 200 @app.route('/start_recording', methods=['POST']) def start_recording(): @@ -639,7 +714,7 @@ def end_recording(): recording_process.terminate() recording_process.wait() - return_code = recording_process.returncode + #return_code = recording_process.returncode output, error = recording_process.communicate() recording_process = None diff --git a/evaluation_examples/examples/libreoffice_calc/0cecd4f3-74de-457b-ba94-29ad6b5dafb6.json b/evaluation_examples/examples/libreoffice_calc/0cecd4f3-74de-457b-ba94-29ad6b5dafb6.json index a37eeb3..89203e0 100644 --- a/evaluation_examples/examples/libreoffice_calc/0cecd4f3-74de-457b-ba94-29ad6b5dafb6.json +++ b/evaluation_examples/examples/libreoffice_calc/0cecd4f3-74de-457b-ba94-29ad6b5dafb6.json @@ -27,6 +27,31 @@ "libreoffice_calc" ], "evaluator": { + "postconfig": [ + { + "type": "activate_window", + "parameters": { + "window_name": "copy_sheet_insert.xlsx - LibreOffice Calc", + "strict": true + } + }, + { + "type": "sleep", + "parameters": { + "seconds": 0.5 + } + }, + { + "type": "execute", + "parameters": { + "command": [ + "python", + "-c", + "import pyautogui; pyautogui.press([\"ctrl\", \"s\"]);" + ] + } + } + ], "func": "check_sheet_list", "result": { "type": "vm_file", diff --git a/evaluation_examples/examples/libreoffice_calc/1334ca3e-f9e3-4db8-9ca7-b4c653be7d17.json b/evaluation_examples/examples/libreoffice_calc/1334ca3e-f9e3-4db8-9ca7-b4c653be7d17.json index 5ed7c1a..76a1018 100644 --- a/evaluation_examples/examples/libreoffice_calc/1334ca3e-f9e3-4db8-9ca7-b4c653be7d17.json +++ b/evaluation_examples/examples/libreoffice_calc/1334ca3e-f9e3-4db8-9ca7-b4c653be7d17.json @@ -27,6 +27,31 @@ "libreoffice_calc" ], "evaluator": { + "postconfig": [ + { + "type": "activate_window", + "parameters": { + "window_name": "Zoom_Out_Oversized_Cells.xlsx - LibreOffice Calc", + "strict": true + } + }, + { + "type": "sleep", + "parameters": { + "seconds": 0.5 + } + }, + { + "type": "execute", + "parameters": { + "command": [ + "python", + "-c", + "import pyautogui; pyautogui.press([\"ctrl\", \"s\"]);" + ] + } + } + ], "func": "check_xlsx_zoom", "result": { "type": "vm_file", diff --git a/evaluation_examples/examples/libreoffice_calc/21df9241-f8d7-4509-b7f1-37e501a823f7.json b/evaluation_examples/examples/libreoffice_calc/21df9241-f8d7-4509-b7f1-37e501a823f7.json index cd545b0..302eef0 100644 --- a/evaluation_examples/examples/libreoffice_calc/21df9241-f8d7-4509-b7f1-37e501a823f7.json +++ b/evaluation_examples/examples/libreoffice_calc/21df9241-f8d7-4509-b7f1-37e501a823f7.json @@ -27,6 +27,31 @@ "libreoffice_calc" ], "evaluator": { + "postconfig": [ + { + "type": "activate_window", + "parameters": { + "window_name": "Represent_in_millions_billions.xlsx - LibreOffice Calc", + "strict": true + } + }, + { + "type": "sleep", + "parameters": { + "seconds": 0.5 + } + }, + { + "type": "execute", + "parameters": { + "command": [ + "python", + "-c", + "import pyautogui; pyautogui.press([\"ctrl\", \"s\"]);" + ] + } + } + ], "func": "compare_table", "result": { "type": "vm_file", diff --git a/evaluation_examples/examples/libreoffice_calc/2bd59342-0664-4ccb-ba87-79379096cc08.json b/evaluation_examples/examples/libreoffice_calc/2bd59342-0664-4ccb-ba87-79379096cc08.json index cf37625..acde630 100644 --- a/evaluation_examples/examples/libreoffice_calc/2bd59342-0664-4ccb-ba87-79379096cc08.json +++ b/evaluation_examples/examples/libreoffice_calc/2bd59342-0664-4ccb-ba87-79379096cc08.json @@ -26,6 +26,31 @@ "libreoffice calc" ], "evaluator": { + "postconfig": [ + { + "type": "activate_window", + "parameters": { + "window_name": "OrderId_Month_Chart.xlsx - LibreOffice Calc", + "strict": true + } + }, + { + "type": "sleep", + "parameters": { + "seconds": 0.5 + } + }, + { + "type": "execute", + "parameters": { + "command": [ + "python", + "-c", + "import pyautogui; pyautogui.press([\"ctrl\", \"s\"]);" + ] + } + } + ], "func": "compare_table", "expected": { "type": "cloud_file", diff --git a/evaluation_examples/examples/libreoffice_calc/347ef137-7eeb-4c80-a3bb-0951f26a8aff.json b/evaluation_examples/examples/libreoffice_calc/347ef137-7eeb-4c80-a3bb-0951f26a8aff.json index e8ba626..71e6bf3 100644 --- a/evaluation_examples/examples/libreoffice_calc/347ef137-7eeb-4c80-a3bb-0951f26a8aff.json +++ b/evaluation_examples/examples/libreoffice_calc/347ef137-7eeb-4c80-a3bb-0951f26a8aff.json @@ -27,6 +27,31 @@ "libreoffice_calc" ], "evaluator": { + "postconfig": [ + { + "type": "activate_window", + "parameters": { + "window_name": "Create_column_charts_using_statistics.xlsx - LibreOffice Calc", + "strict": true + } + }, + { + "type": "sleep", + "parameters": { + "seconds": 0.5 + } + }, + { + "type": "execute", + "parameters": { + "command": [ + "python", + "-c", + "import pyautogui; pyautogui.press([\"ctrl\", \"s\"]);" + ] + } + } + ], "func": "compare_table", "result": { "type": "vm_file", diff --git a/evaluation_examples/examples/libreoffice_calc/4188d3a4-077d-46b7-9c86-23e1a036f6c1.json b/evaluation_examples/examples/libreoffice_calc/4188d3a4-077d-46b7-9c86-23e1a036f6c1.json index 6a9d412..a4faba9 100644 --- a/evaluation_examples/examples/libreoffice_calc/4188d3a4-077d-46b7-9c86-23e1a036f6c1.json +++ b/evaluation_examples/examples/libreoffice_calc/4188d3a4-077d-46b7-9c86-23e1a036f6c1.json @@ -27,6 +27,31 @@ "libreoffice_calc" ], "evaluators": { + "postconfig": [ + { + "type": "activate_window", + "parameters": { + "window_name": "Freeze_row_column.xlsx - LibreOffice Calc", + "strict": true + } + }, + { + "type": "sleep", + "parameters": { + "seconds": 0.5 + } + }, + { + "type": "execute", + "parameters": { + "command": [ + "python", + "-c", + "import pyautogui; pyautogui.press([\"ctrl\", \"s\"]);" + ] + } + } + ], "func": "check_xlsx_freeze", "result": { "type": "vm_file", diff --git a/evaluation_examples/examples/libreoffice_calc/4f07fbe9-70de-4927-a4d5-bb28bc12c52c.json b/evaluation_examples/examples/libreoffice_calc/4f07fbe9-70de-4927-a4d5-bb28bc12c52c.json index f45c50c..94ca26f 100644 --- a/evaluation_examples/examples/libreoffice_calc/4f07fbe9-70de-4927-a4d5-bb28bc12c52c.json +++ b/evaluation_examples/examples/libreoffice_calc/4f07fbe9-70de-4927-a4d5-bb28bc12c52c.json @@ -27,6 +27,31 @@ "libreoffice_calc" ], "evaluator": { + "postconfig": [ + { + "type": "activate_window", + "parameters": { + "window_name": "OrderId_Month_Chart.xlsx - LibreOffice Calc", + "strict": true + } + }, + { + "type": "sleep", + "parameters": { + "seconds": 0.5 + } + }, + { + "type": "execute", + "parameters": { + "command": [ + "python", + "-c", + "import pyautogui; pyautogui.press([\"ctrl\", \"s\"]);" + ] + } + } + ], "func": "compare_table", "result": { "type": "vm_file", diff --git a/evaluation_examples/examples/libreoffice_calc/a01fbce3-2793-461f-ab86-43680ccbae25.json b/evaluation_examples/examples/libreoffice_calc/a01fbce3-2793-461f-ab86-43680ccbae25.json index 6ed124f..113e491 100644 --- a/evaluation_examples/examples/libreoffice_calc/a01fbce3-2793-461f-ab86-43680ccbae25.json +++ b/evaluation_examples/examples/libreoffice_calc/a01fbce3-2793-461f-ab86-43680ccbae25.json @@ -21,6 +21,31 @@ "libreoffice_calc" ], "evaluator": { + "postconfig": [ + { + "type": "activate_window", + "parameters": { + "window_name": "Set_Decimal_Separator_Dot.xlsx - LibreOffice Calc", + "strict": true + } + }, + { + "type": "sleep", + "parameters": { + "seconds": 0.5 + } + }, + { + "type": "execute", + "parameters": { + "command": [ + "python", + "-c", + "import pyautogui; pyautogui.press([\"ctrl\", \"s\"]);" + ] + } + } + ], "func": "check_libre_locale", "result": { "type": "vm_file", diff --git a/evaluation_examples/examples/libreoffice_calc/aa3a8974-2e85-438b-b29e-a64df44deb4b.json b/evaluation_examples/examples/libreoffice_calc/aa3a8974-2e85-438b-b29e-a64df44deb4b.json index 3704a7b..c8812c2 100644 --- a/evaluation_examples/examples/libreoffice_calc/aa3a8974-2e85-438b-b29e-a64df44deb4b.json +++ b/evaluation_examples/examples/libreoffice_calc/aa3a8974-2e85-438b-b29e-a64df44deb4b.json @@ -30,8 +30,8 @@ "func": "check_pdf_pages", "result": { "type": "vm_file", - "path": "/home/user/Resize_Cells_Fit_Page.xlsx", - "dest": "Resize_Cells_Fit_Page.xlsx" + "path": "/home/user/Resize_Cells_Fit_Page.pdf", + "dest": "Resize_Cells_Fit_Page.pdf" }, "expected": { "type": "rule", diff --git a/evaluation_examples/examples/libreoffice_calc/f9584479-3d0d-4c79-affa-9ad7afdd8850.json b/evaluation_examples/examples/libreoffice_calc/f9584479-3d0d-4c79-affa-9ad7afdd8850.json index 8d96854..02e2a48 100644 --- a/evaluation_examples/examples/libreoffice_calc/f9584479-3d0d-4c79-affa-9ad7afdd8850.json +++ b/evaluation_examples/examples/libreoffice_calc/f9584479-3d0d-4c79-affa-9ad7afdd8850.json @@ -27,6 +27,31 @@ "libreoffice calc" ], "evaluator": { + "postconfig": [ + { + "type": "activate_window", + "parameters": { + "window_name": "Quarterly_Product_Sales_by_Zone.xlsx - LibreOffice Calc", + "strict": true + } + }, + { + "type": "sleep", + "parameters": { + "seconds": 0.5 + } + }, + { + "type": "execute", + "parameters": { + "command": [ + "python", + "-c", + "import pyautogui; pyautogui.press([\"ctrl\", \"s\"]);" + ] + } + } + ], "func": "compare_table", "expected": { "type": "cloud_file", diff --git a/evaluation_examples/examples/thunderbird/030eeff7-b492-4218-b312-701ec99ee0cc.json b/evaluation_examples/examples/thunderbird/030eeff7-b492-4218-b312-701ec99ee0cc.json index 600ffef..a419f69 100644 --- a/evaluation_examples/examples/thunderbird/030eeff7-b492-4218-b312-701ec99ee0cc.json +++ b/evaluation_examples/examples/thunderbird/030eeff7-b492-4218-b312-701ec99ee0cc.json @@ -45,12 +45,17 @@ "evaluator": { "postconfig": [ { - "type": "command", + "type": "close_window", "parameters": { - "command": ["wmctrl", "-xFc", "Mail.thunderbird"], - "until": { - "returncode": 1 - } + "window_name": "Mail.thunderbird", + "strict": true, + "by_class": true + } + }, + { + "type": "sleep", + "parameters": { + "seconds": 0.5 } } ], diff --git a/evaluation_examples/examples/thunderbird/35253b65-1c19-4304-8aa4-6884b8218fc0.json b/evaluation_examples/examples/thunderbird/35253b65-1c19-4304-8aa4-6884b8218fc0.json index a1c3154..0f9c709 100644 --- a/evaluation_examples/examples/thunderbird/35253b65-1c19-4304-8aa4-6884b8218fc0.json +++ b/evaluation_examples/examples/thunderbird/35253b65-1c19-4304-8aa4-6884b8218fc0.json @@ -45,12 +45,16 @@ "evaluator": { "postconfig": [ { - "type": "command", + "type": "close_window", "parameters": { - "command": ["wmctrl", "-Fc", "Message Filters"], - "until": { - "returncode": 1 - } + "window_name": "Message Filters", + "strict": true + } + }, + { + "type": "sleep", + "parameters": { + "seconds": 0.5 } } ], diff --git a/evaluation_examples/examples/thunderbird/3d1682a7-0fb0-49ae-a4dc-a73afd2d06d5.json b/evaluation_examples/examples/thunderbird/3d1682a7-0fb0-49ae-a4dc-a73afd2d06d5.json index 4f688d6..f8d675b 100644 --- a/evaluation_examples/examples/thunderbird/3d1682a7-0fb0-49ae-a4dc-a73afd2d06d5.json +++ b/evaluation_examples/examples/thunderbird/3d1682a7-0fb0-49ae-a4dc-a73afd2d06d5.json @@ -45,16 +45,17 @@ "evaluator": { "postconfig": [ { - "type": "execute", + "type": "close_window", "parameters": { - "command": [ - "wmctrl", - "-xFc", - "Mail.thunderbird" - ], - "until": { - "returncode": 1 - } + "window_name": "Mail.thunderbird", + "strict": true, + "by_class": true + } + }, + { + "type": "sleep", + "parameters": { + "seconds": 0.5 } } ], diff --git a/evaluation_examples/examples/thunderbird/3d1682a7-0fb0-49ae-a4dc-a73afd2d06d5.json.nosetup b/evaluation_examples/examples/thunderbird/3d1682a7-0fb0-49ae-a4dc-a73afd2d06d5.json.nosetup index 7c1e728..46794f9 100644 --- a/evaluation_examples/examples/thunderbird/3d1682a7-0fb0-49ae-a4dc-a73afd2d06d5.json.nosetup +++ b/evaluation_examples/examples/thunderbird/3d1682a7-0fb0-49ae-a4dc-a73afd2d06d5.json.nosetup @@ -23,16 +23,17 @@ "evaluator": { "postconfig": [ { - "type": "execute", + "type": "close_window", "parameters": { - "command": [ - "wmctrl", - "-xFc", - "Mail.thunderbird" - ], - "until": { - "returncode": 1 - } + "window_name": "Mail.thunderbird", + "strict": true, + "by_class": true + } + }, + { + "type": "sleep", + "parameters": { + "seconds": 0.5 } } ], diff --git a/evaluation_examples/examples/thunderbird/480bcfea-d68f-4aaa-a0a9-2589ef319381.json b/evaluation_examples/examples/thunderbird/480bcfea-d68f-4aaa-a0a9-2589ef319381.json index 7e95acb..8268fc8 100644 --- a/evaluation_examples/examples/thunderbird/480bcfea-d68f-4aaa-a0a9-2589ef319381.json +++ b/evaluation_examples/examples/thunderbird/480bcfea-d68f-4aaa-a0a9-2589ef319381.json @@ -45,12 +45,17 @@ "evaluator": { "postconfig": [ { - "type": "command", + "type": "close_window", "parameters": { - "command": ["wmctrl", "-xFc", "Mail.thunderbird"], - "until": { - "returncode": 1 - } + "window_name": "Mail.thunderbird", + "strict": true, + "by_class": true + } + }, + { + "type": "sleep", + "parameters": { + "seconds": 0.5 } } ], diff --git a/evaluation_examples/examples/thunderbird/6766f2b8-8a72-417f-a9e5-56fcaa735837.json b/evaluation_examples/examples/thunderbird/6766f2b8-8a72-417f-a9e5-56fcaa735837.json index 4e01ff5..369e8e7 100644 --- a/evaluation_examples/examples/thunderbird/6766f2b8-8a72-417f-a9e5-56fcaa735837.json +++ b/evaluation_examples/examples/thunderbird/6766f2b8-8a72-417f-a9e5-56fcaa735837.json @@ -45,12 +45,17 @@ "evaluator": { "postconfig": [ { - "type": "command", + "type": "close_window", "parameters": { - "command": ["wmctrl", "-xFc", "Mail.thunderbird"], - "until": { - "returncode": 1 - } + "window_name": "Mail.thunderbird", + "strict": true, + "by_class": true + } + }, + { + "type": "sleep", + "parameters": { + "seconds": 0.5 } } ], diff --git a/evaluation_examples/examples/thunderbird/6766f2b8-8a72-417f-a9e5-56fcaa735837.json.nosetup b/evaluation_examples/examples/thunderbird/6766f2b8-8a72-417f-a9e5-56fcaa735837.json.nosetup index f0a416a..4b6feef 100644 --- a/evaluation_examples/examples/thunderbird/6766f2b8-8a72-417f-a9e5-56fcaa735837.json.nosetup +++ b/evaluation_examples/examples/thunderbird/6766f2b8-8a72-417f-a9e5-56fcaa735837.json.nosetup @@ -23,12 +23,17 @@ "evaluator": { "postconfig": [ { - "type": "command", + "type": "close_window", "parameters": { - "command": ["wmctrl", "-xFc", "Mail.thunderbird"], - "until": { - "returncode": 1 - } + "window_name": "Mail.thunderbird", + "strict": true, + "by_class": true + } + }, + { + "type": "sleep", + "parameters": { + "seconds": 0.5 } } ], diff --git a/evaluation_examples/examples/thunderbird/94760984-3ff5-41ee-8347-cf1af709fea0.json b/evaluation_examples/examples/thunderbird/94760984-3ff5-41ee-8347-cf1af709fea0.json index 813b3f4..2d48f96 100644 --- a/evaluation_examples/examples/thunderbird/94760984-3ff5-41ee-8347-cf1af709fea0.json +++ b/evaluation_examples/examples/thunderbird/94760984-3ff5-41ee-8347-cf1af709fea0.json @@ -45,12 +45,17 @@ "evaluator": { "postconfig": [ { - "type": "command", + "type": "close_window", "parameters": { - "command": ["wmctrl", "-xFc", "Mail.thunderbird"], - "until": { - "returncode": 1 - } + "window_name": "Mail.thunderbird", + "strict": true, + "by_class": true + } + }, + { + "type": "sleep", + "parameters": { + "seconds": 0.5 } } ], diff --git a/evaluation_examples/examples/thunderbird/c9e7eaf2-b1a1-4efc-a982-721972fa9f02.json b/evaluation_examples/examples/thunderbird/c9e7eaf2-b1a1-4efc-a982-721972fa9f02.json index d5bef4e..7e805d9 100644 --- a/evaluation_examples/examples/thunderbird/c9e7eaf2-b1a1-4efc-a982-721972fa9f02.json +++ b/evaluation_examples/examples/thunderbird/c9e7eaf2-b1a1-4efc-a982-721972fa9f02.json @@ -45,12 +45,17 @@ "evaluator": { "postconfig": [ { - "type": "command", + "type": "close_window", "parameters": { - "command": ["wmctrl", "-xFc", "Mail.thunderbird"], - "until": { - "returncode": 1 - } + "window_name": "Mail.thunderbird", + "strict": true, + "by_class": true + } + }, + { + "type": "sleep", + "parameters": { + "seconds": 0.5 } } ], diff --git a/evaluation_examples/examples/thunderbird/e1e75309-3ddb-4d09-92ec-de869c928143.json b/evaluation_examples/examples/thunderbird/e1e75309-3ddb-4d09-92ec-de869c928143.json index 3dd986a..2a47a8c 100644 --- a/evaluation_examples/examples/thunderbird/e1e75309-3ddb-4d09-92ec-de869c928143.json +++ b/evaluation_examples/examples/thunderbird/e1e75309-3ddb-4d09-92ec-de869c928143.json @@ -45,12 +45,16 @@ "evaluator": { "postconfig": [ { - "type": "command", + "type": "close_window", "parameters": { - "command": ["wmctrl", "-Fc", "Message Filters"], - "until": { - "returncode": 1 - } + "window_name": "Message Filters", + "strict": true + } + }, + { + "type": "sleep", + "parameters": { + "seconds": 0.5 } } ], diff --git a/evaluation_examples/examples/thunderbird/e1e75309-3ddb-4d09-92ec-de869c928143.json.nosetup b/evaluation_examples/examples/thunderbird/e1e75309-3ddb-4d09-92ec-de869c928143.json.nosetup index 66af75d..b801b7a 100644 --- a/evaluation_examples/examples/thunderbird/e1e75309-3ddb-4d09-92ec-de869c928143.json.nosetup +++ b/evaluation_examples/examples/thunderbird/e1e75309-3ddb-4d09-92ec-de869c928143.json.nosetup @@ -23,12 +23,16 @@ "evaluator": { "postconfig": [ { - "type": "command", + "type": "close_window", "parameters": { - "command": ["wmctrl", "-Fc", "Message Filters"], - "until": { - "returncode": 1 - } + "window_name": "Message Filters", + "strict": true + } + }, + { + "type": "sleep", + "parameters": { + "seconds": 0.5 } } ],