You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using a custom version of m1ddc to send switching input commands to my displays when my USB switch is disconnected, and the binary needs to be called for each display.
It would be great to support execution of multiple commands when usb events are fired.
An easy implementation (tested) would be to split the command string on the ; delimiter, and call each command successively.
for subcommand in execute_command.split(";"){let subcommand = subcommand.trim();if !subcommand.is_empty(){try_run_command(subcommand).unwrap_or_else(|err| error!("Error executing external command '{}': {}", subcommand, err));}}
What do you think ?
The text was updated successfully, but these errors were encountered:
bil0u
changed the title
Support multiple command executions using on_usb_<event>_execute
Support multiple command executions with on_usb_<event>_executeNov 20, 2023
I am also using m1ddc to swap multiple monitors at the same time. You can chain commands in this fashion without needing anything additional if you wish:
# Example
on_usb_connect_execute = "sh -c \"m1ddc display 1 set input 1 && m1ddc display 2 set input 1\""
Unsure if escaping the inner quotations is needed here, but this seems to work for me.
Hi there, thanks for your work on this project.
I'm using a custom version of m1ddc to send switching input commands to my displays when my USB switch is disconnected, and the binary needs to be called for each display.
It would be great to support execution of multiple commands when usb events are fired.
An easy implementation (tested) would be to split the command string on the
;
delimiter, and call each command successively.display-switch/src/display_control.rs
Lines 180 to 181 in a5b76e0
would be replaced by
What do you think ?
The text was updated successfully, but these errors were encountered: