Skip to content

Commit

Permalink
add one more parameter for action acllback function
Browse files Browse the repository at this point in the history
  • Loading branch information
hanhsuan committed Oct 28, 2024
1 parent 7adf2f8 commit 04b75b9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions checkbox-support/checkbox_support/dbus/gnome_monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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]_.
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 04b75b9

Please sign in to comment.