怎样通过 SSH 正确重启 GNOME Shell?


总有 gnome-shell 卡死的时候, 只好通过 SSH 或 tty2 进入, 或者 tty2 都进不去,,

可如果我直接杀掉进程想起动, 每次都会提示无法打开:


 #➤➤ kill -9 2136
#➤➤ eval `gnome-shell --replace`
Window manager error: Unable to open X display
#➤➤ gnome-shell
Window manager error: Unable to open X display
#➤➤ gnome-shell --replace
Window manager error: Unable to open X display

如果重启整个 Window Manager 的话, 桌面上已经开启的应用是不会保存的, 单独重启 gnome-shell 倒是可以, 课我怎样才能单独重启 gnome-shell 呢?

Linux gnome ssh

小夜°ゝ音ㄚ 12 years, 5 months ago

你需要指定 X 服务器的位置,也就是 DISPLAY 环境变量。通常,本地的在 :0 上:


 DISPLAY=:0 gnome-shell --replace

wakano answered 12 years, 5 months ago

Your Answer