The following command works from the command line (using Linux):
audtool set-volume $(('audtool get-volume' - 5))
I cannot get that to script. I have tried many variants of the following
systemcommand:audtool arg1:"set-volume" arg2:"$(('audtool get-volume' - 5))"
Is there some syntax trick to getting the exact line passed to the OS?
Scripting systemcommand argument passed badly
-
- Posts: 1325
- Joined: Mon Apr 13, 2015 7:05 am
- Location: Bratislava, Slovakia
- Real Name: Jano Svitok
- Contact:
Maybe you need to call bash to do the parameter expansion.
systemcommand:bash arg1: "audtool" arg2:"set-volume" arg3:"$(('audtool get-volume' - 5))"
systemcommand:bash arg1: "audtool" arg2:"set-volume" arg3:"$(('audtool get-volume' - 5))"
-
- Posts: 58
- Joined: Mon Apr 27, 2015 11:27 am
- Real Name: Chris Laurie
Thank you for the response Jano!
Unfortunately that did not work.
Unfortunately that did not work.
- sbenejam
- Posts: 607
- Joined: Sun Apr 12, 2015 6:28 pm
- Real Name: Santiago Benejam Torres
- Contact:
This is a command that calls a python test script that I use: systemcommand:python-script.py arg:dspdfviewer arg:P
Maybe it could help.
Maybe it could help.
-
- Posts: 637
- Joined: Sun Apr 12, 2015 6:30 pm
- Real Name: David
Try this one:
Code: Select all
systemcommand:bash arg1:"-c" arg2:"audtool set-volume $(($(audtool get-volume) - 5))"
- mcallegari
- Posts: 4712
- Joined: Sun Apr 12, 2015 9:09 am
- Location: Italy
- Real Name: Massimo Callegari
- Contact:
I have written an example in the documentation, so where did you guys read arg1, arg2, etc ?
http://www.qlcplus.org/docs/scripteditor.html
most likely this is what you want
By the way, this looks more like a usage question rather than a issue report...
http://www.qlcplus.org/docs/scripteditor.html
Code: Select all
systemcommand:/usr/bin/vlc arg:-f arg:/home/user/video.mp4 // plays my video with VLC in fullscreen
Code: Select all
systemcommand:audtool arg:set-volume arg:"$(('audtool get-volume' - 5))"
-
- Posts: 637
- Joined: Sun Apr 12, 2015 6:30 pm
- Real Name: David
You're right, arg1 arg2 etc is useless.mcallegari wrote:I have written an example in the documentation, so where did you guys read arg1, arg2, etc ?
But it works. You can also replace "arg" with "hi" or "hello", it will work too. Should a github issue be opened for this ?
This does not work, becauseCode: Select all
systemcommand:audtool arg:set-volume arg:"$(('audtool get-volume' - 5))"
Code: Select all
$((`audtool get-volume`))
Code: Select all
audtool get-volume
Maybe.By the way, this looks more like a usage question rather than a issue report...
Please try this one:
Code: Select all
systemcommand:bash arg:-c arg:"audtool set-volume $(($(audtool get-volume) - 5))"
- mcallegari
- Posts: 4712
- Joined: Sun Apr 12, 2015 9:09 am
- Location: Italy
- Real Name: Massimo Callegari
- Contact:
Ugh...yes pleaseBut it works. You can also replace "arg" with "hi" or "hello", it will work too. Should a github issue be opened for this ?
Then have a look at #843 please
Right. I'm wondering if the QProcess class can actually work like a proper shell. I'll check the docs when I have some timeThis does not work, becauseis something that has to be interpreted by bash. QLC+ does not run processes through bash commands. Also, I think the simple quote aroundCode: Select all
$((`audtool get-volume`))
-
- Posts: 637
- Joined: Sun Apr 12, 2015 6:30 pm
- Real Name: David
No it can't. It's not a shell command interpreter. It simply runs a process.mcallegari wrote: Right. I'm wondering if the QProcess class can actually work like a proper shell. I'll check the docs when I have some time
And I think it's fine like this. Users can still use "bash -c" to run shell commands. Or even write the script in an external .sh file.
- mcallegari
- Posts: 4712
- Joined: Sun Apr 12, 2015 9:09 am
- Location: Italy
- Real Name: Massimo Callegari
- Contact:
Actually, you can pass the system environment to it:plugz wrote:No it can't. It's not a shell command interpreter. It simply runs a process.mcallegari wrote: Right. I'm wondering if the QProcess class can actually work like a proper shell. I'll check the docs when I have some time
And I think it's fine like this. Users can still use "bash -c" to run shell commands. Or even write the script in an external .sh file.
http://doc.qt.io/qt-5/qprocess.html#set ... nvironment
In any case I agree regarding a shell script.
I would do something like
Code: Select all
setVolume.sh 5
setVolume.sh -5
-
- Posts: 58
- Joined: Mon Apr 27, 2015 11:27 am
- Real Name: Chris Laurie
That is what I did in the end I created a shell file. I could not get the bash -c to work. This solution probably won't work in Windows.
One thing that would work for this use case is if the scripting allowed for the interim storage of the result of a systemcommand call - some like this
%v = systemcommand:audtool arg1:get-volume
systemcommand:audtool arg1:set-volume arg2:%v - 1
Not sure about how the syntax will work but that would give us the start of the capability to read and set dmx channel values via these variables.
One thing that would work for this use case is if the scripting allowed for the interim storage of the result of a systemcommand call - some like this
%v = systemcommand:audtool arg1:get-volume
systemcommand:audtool arg1:set-volume arg2:%v - 1
Not sure about how the syntax will work but that would give us the start of the capability to read and set dmx channel values via these variables.
-
- Posts: 11
- Joined: Wed Feb 13, 2019 7:31 am
- Real Name: JoelM
systemcommand:/bin/sh arg:/home/pi/PP-QLC-Lights/ShowVoxON.sh // copies show file with vocals to correct location
This is what in a few different versions I use to change audio files used in a show... works great. Attach it to a button and OSC command.
This is what in a few different versions I use to change audio files used in a show... works great. Attach it to a button and OSC command.