Closed Madcliff closed 3 years ago
Hi! Shell commands may be run like this:
result = system("/usr/bin/logger", { "-i", "Message from eruption" })
if result ~= 0 then
error("Command execution failed with result: " .. result)
end
The first parameter to the system
function is the command name, the second parameter is a Lua table (roughly equivalent to an array) that specifies the command line parameters of the program being run.
The program will be executed with the rights of the eruption
process (root by default).
To run the program as a different user you can do the following:
result = system("/usr/bin/sudo", { "DISPLAY=:1", "DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus", "-u", "user", "notify-send", "Message", "A message from eruption" })
if result ~= 0 then
error("Command execution failed with result: " .. result)
end
Please replace "user" and "1000" with the respective user name and ID.
So i recall that it used to be possible to execute a bash command from a macro. What is the correct syntax to do so currently?