web-dev-qa-db-fra.com

Comment puis-je arrêter Xfce en toute sécurité depuis le terminal?

Je ne cherche pas shutdown ou reboot ou autre. Je veux savoir comment arrêter Xubuntu à partir du terminal, en exécutant une commande qui aurait le même effet que de cliquer sur le bouton "Arrêter" dans un menu.

Similaire à cette question , mais pour Xubuntu/XFCE.

6
Michael Hoffmann

Je pense que ce que vous voulez, c'est xfce4-session-logout ( page de manuel en ligne ).

Extrait de la page de manuel (reformatée, filtrée):

   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.

Donc, pour arrêter, utilisez

xfce4-session-logout --halt

et pour redémarrer, utilisez

xfce4-session-logout --reboot

Si vous voulez juste obtenir le dialogue où vous pouvez choisir une action manuellement, lancez-le sans arguments:

xfce4-session-logout 
10
Byte Commander

Vérifiez cela aussi. Il s’agit d’un script bash simple, indépendant de la distribution, qui dépend uniquement de yad et systemctlhttps://Gist.github.com/harish2704/25857caf89076d5a78e996df3fa6ac56

0
harish2704