36

I am new to xubuntu, somtimes my xfce desktop crashes, and I can only use tty1 from command line.

I want to know how can I restart my xfce in tty7 from tty1?

I've googled it, but didn't found the solution. Thanks.

zfz
  • 779

4 Answers4

26

For me startxfce4 didn't work, but pkill did.

You could try the following command:

xfwm4 --replace

It restarts the windows manager.

Luís de Sousa
  • 13,227
  • 26
  • 81
  • 128
Stek Turku
  • 261
  • 3
  • 2
  • 1
    Yeah. This is, first try to reload window manager, if don't work try restarting login service, and in the worst of cases, kill your user then start again your work :) – m3nda Oct 23 '15 at 04:20
  • 1
    Exactly. Don't forget to append a &:

    xfwm4 --replace &

    – fatal_error Jan 27 '17 at 02:02
22

pkill worked but seemed a little extreme to me. If I had other stuff going on in other tty sessions, it would kill those too.

Another solution is:

sudo systemctl restart lightdm

A great strength of Linux is that there are always multiple ways to achieve the same task.

Mike
  • 103
15

Try killing user by

pkill -KILL -u yourusername

This will bring you back to login screen though.

linuxk
  • 629
  • Sometimes lose current windows is not a choice :X, u can do same restarting ldm service ( or the login manager you have ). Killing every process of a user it's the last option, because you may be working on tty1 and you will kill it too. Login manager (wich is x based) would not close other sessions. – m3nda Oct 23 '15 at 04:20
10

You can try startxfce4.

As this site says:

Restart XFCE4 : from the command line, you would better use "startxfce4" to bypass stupid distribution X startup scripts that can drive you crazy, really.

green
  • 14,306
  • 3
    That's the start XFCE4, not to to restart it. When I ran startxfce4 I got these messages:

    /usr/bin/startxfce4: X server already running on display :0.0 xfce4-session: Another session manager is already running

    – Obsidian Jackal Jul 04 '15 at 21:43
  • I get "xinit: unable to connect to X server: Connection refused" – kurdtpage May 20 '18 at 10:47
  • 1
    good luck fixing login loop afterwards: https://askubuntu.com/a/223634/308869 – Ufos Apr 04 '19 at 13:15
  • @Enkouyami well, when something crashes Restart = Start. You got the message already running because your xfce4 was not crashed ;)—this is a linguistic issue. Anyway, this answer fits the question. :) – loved.by.Jesus Aug 27 '19 at 10:23