Open DvdGiessen opened 8 months ago
I think that makes a lot of sense and (imo) makes the behavior more intuitive. Even the naming of the actions (Exec.Cmd) suggest any "valid" command should work.
I've implemented a first version of it using the mentioned package in the parse-cmd branch (diff). ~It still needs some cleaning up (abstracting reused code into separate functions for readability)~, and I ran into an issue in shellwords causing it to not parse things correctly, which would be nice to resolve before merging this here.
EDIT: Cleaned up the code a bit (diff), so now all that's left is integrating the fixes that have been happening in shellwords as well.
To make it easier to execute a command line given as a string without first having to split the string in the calling application, we could add a method that parses a string into a command, arguments, and perhaps even environment variables, similar to how the shell would parse such a command line.
The shellwords package seems to be perfect for this.
This will also help work around the issue noted in #2, namely that there's no easy way to call a DBus method with a StringList argument in the KWin JS API.