How do I restart /shutdown from a terminal?
In gdm I could use
os.system("gdm-control --reboot && openbox --exit")
In a Python script.
What would the command be for lightdm?
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
I looked through the manpages and couldn't find anything in lightdm that would allow you to shtudown the computer. You could use dbus.
Which is explained here
You can just do it from terminal by
Or you can use