Open calexandru2018 opened 5 years ago
I had an similar problem and solved it using this
echo "My button | bash='pkexec sh -c \"command-a && command-b\"' terminal=false"
pkexec
runs an sudo prompt (in an dialog).sh -c "..."
runs an shell command. I use this to run multiple commands with only one sudo.\"
to escape the quotes inside the bash paramterminal=false
makes the command not spawn an terminalSo i think i may have a decent template for these kind of complex task where you actually want to build a bash function and run it. I have documented it in the wiki here.
TLDR: If no argument is supplied, the script echo the menu. The bash values actually just call the argos script itself with a function name. When run with a function name + argument, the script skip echoing out the menu but simply call the function with its argument.
I am running Manjaro 18. The Argos script runs well won simple files/programs, but it gets a bit querky when sudo is needed or a script needs additional arguments.
I am configuring to run "sudo /opt/lampp/lampp start" but this get truncated at "sudo", if I type in the bash value to be "/opt/lampp/lampp start" then the value gets truncated at "/opt/lampp/lampp" so, no command is run. It seems that the script truncates all whitespaces, even if they are in quotes and/or double quotes.