![是否有执行 XFCE 菜单项以重新启动或关闭电源的命令?](https://linux22.com/image/225200/%E6%98%AF%E5%90%A6%E6%9C%89%E6%89%A7%E8%A1%8C%20XFCE%20%E8%8F%9C%E5%8D%95%E9%A1%B9%E4%BB%A5%E9%87%8D%E6%96%B0%E5%90%AF%E5%8A%A8%E6%88%96%E5%85%B3%E9%97%AD%E7%94%B5%E6%BA%90%E7%9A%84%E5%91%BD%E4%BB%A4%EF%BC%9F.png)
有Herunterfahren
(DE)/Shut Down
和Neustarten
(DE)/ Reboot
:
是否可以从命令行执行这些 GUI 条目?如果是这样,命令到底是什么?
我已经查过了XFCE 电源管理器的文档页面,但据我了解,这些命令没有在那里列出。
答案1
从https://askubuntu.com/a/771187/158442:
我认为你想要的是 xfce4-session-logout (在线联机帮助页)。
手册页摘录(重新格式化、过滤):
The xfce4-session-logout command allows you to programmatically logout
from your Xfce session. It requests the session manager to display the
logout confirmation screen, or, if given one of the command-line
options below, causes the session manager to take the requested action
immediately.
OPTIONS:
--logout Log out without displaying the logout dialog.
--halt Halt without displaing the logout dialog.
--reboot Reboot without displaying the logout dialog.
--suspend Suspend without displaying the logout dialog.
--hibernate Hibernate without displaying the logout dialog.
--fast Do a fast shutdown. This instructs the session manager not to
save the session, but instead to quit everything quickly.
所以要关闭:
xfce4-session-logout --halt
重新启动:
xfce4-session-logout --reboot
要获得可以手动选择操作的对话,请在不带参数的情况下运行它:
xfce4-session-logout