From 04b75b90c10c3f9907cdb331ad0f391896db8b42 Mon Sep 17 00:00:00 2001 From: hanhsuan Date: Mon, 28 Oct 2024 22:04:43 +0800 Subject: [PATCH] add one more parameter for action acllback function --- checkbox-support/checkbox_support/dbus/gnome_monitor.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/checkbox-support/checkbox_support/dbus/gnome_monitor.py b/checkbox-support/checkbox_support/dbus/gnome_monitor.py index f94f8f73cf..b0222a5c3e 100644 --- a/checkbox-support/checkbox_support/dbus/gnome_monitor.py +++ b/checkbox-support/checkbox_support/dbus/gnome_monitor.py @@ -113,8 +113,9 @@ def cycler( res: bool = True, max_res_amount: int = 5, trans: bool = False, + extra_str: str = "", log: Callable[str] = None, - action: Callable[str] = None, + action: Callable[str, str] = None, ): """ Cycling change the monitors configurations automatically @@ -127,6 +128,9 @@ def cycler( trans: Cycling the transform or not. + extra_str: The extra string you would like to pass + to action callback. + log: For logging, the string is constructed by [monitor name]_[resolution]_[transform]_. @@ -178,7 +182,7 @@ def cycler( if log: log(uni_string) if action: - action(uni_string) + action(extra_str, uni_string) if not res: break # change back to preferred monitor configuration