Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invoke CmdArgs with multiple arguments #1

Closed
r0skar opened this issue Apr 6, 2024 · 2 comments
Closed

Invoke CmdArgs with multiple arguments #1

r0skar opened this issue Apr 6, 2024 · 2 comments

Comments

@r0skar
Copy link

r0skar commented Apr 6, 2024

I am experimenting with this and was wondering how to invoke a command with multiple arguments? I hope this fake shell session helps to illustrate my current issue.

# Works as expected
❯ ydotool mousemove -x 100 -y 100

❯ qdbus nl.dvdgiessen.dbusapplauncher /nl/dvdgiessen/DBusAppLauncher nl.dvdgiessen.dbusapplauncher.Exec.CmdArgs "ydotool" "mousemove" "x" "100" "y" "100"
Invalid number of parameters

❯ qdbus nl.dvdgiessen.dbusapplauncher /nl/dvdgiessen/DBusAppLauncher nl.dvdgiessen.dbusapplauncher.Exec.CmdArgs "ydotool" "mousemove -x 100 -y 100"

❯ journalctl -b | grep dbus
Apr 06 14:28:35 incitatus systemd[4137]: Started dbus-:1.2-nl.dvdgiessen.dbusapplauncher@156.service.
Apr 06 14:29:20 incitatus dbus-app-launcher[1431494]: ydotool: Unknown command: mousemove -x 100 -y 100

Multiple args do not work and if I try to use multiple arguments as the final param, they get interpreted as a string and not individual args?

@DvdGiessen
Copy link
Owner

The args parameter takes a list of strings, but the syntax qdbus to create such a list (instead of interpreting them as separate arguments) isn't immediately obvious:

qdbus nl.dvdgiessen.dbusapplauncher /nl/dvdgiessen/DBusAppLauncher nl.dvdgiessen.dbusapplauncher.Exec.CmdArgs ydotool "(" mousemove -x 100 -y 100 ")"

Arguments enclosed between "(" and ")" are interpreted as a list.

@r0skar
Copy link
Author

r0skar commented Apr 6, 2024

Thanks for the quick reply! I have actually started to experiment with different syntaxes. Started with brackets first - it would have taken me a little while to reach quoted parenthesis :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants