使用不同的主目录启动 gnome-shell

使用不同的主目录启动 gnome-shell

在我工作的公司,我们的主目录是通过网络文件系统挂载的。与所有网络一样,我们的局域网有时会很慢或不稳定。我的大多数系统都处理这种情况,但 gnome 完全冻结,即使网络恢复,也需要很长时间才能恢复。

理想的解决方案是找到一种方法来运行具有正确 $HOME 概念但使用系统本地(以及它使用的任何目录)的 gnome~/.local会话~/.cache

我的发行版是 ubuntu 但我希望有一个与发行版无关的解决方案。

编辑:

 $ fuser ~            
/homes/cperivol:      1988c  2040c  2063c  2075c  2197c  2198c  2235c  2298c  2299c  2328c  2378c  2385c  2402c  2543c  2582c  2662c
 $ ps aux | grep gnome   
cperivol  1977  0.0  0.0 369492  3980 ?        Sl   16:53   0:00 /usr/bin/gnome-keyring-daemon --daemonize --login
cperivol  1988  0.0  0.2 391104 10396 ?        Ssl  16:53   0:00 gnome-session --session=gnome
cperivol  2023  0.0  0.0  12572   324 ?        Ss   16:53   0:00 /usr/bin/ssh-agent /usr/bin/dbus-launch --exit-with-session gnome-session --session=gnome
cperivol  2026  0.0  0.0  24480   540 ?        S    16:53   0:00 /usr/bin/dbus-launch --exit-with-session gnome-session --session=gnome
cperivol  2040  0.1  0.5 783104 23132 ?        Sl   16:53   0:01 /usr/lib/gnome-settings-daemon/gnome-settings-daemon
cperivol  2063  0.0  0.1 369692  4700 ?        Sl   16:53   0:00 /usr/lib/gnome-settings-daemon/gsd-printer
cperivol  2075  1.6  3.0 1793504 123240 ?      Sl   16:53   0:15 /usr/bin/gnome-shell
cperivol  2235  0.0  0.2 421908 10676 ?        Sl   16:53   0:00 /usr/lib/gnome-shell/gnome-shell-calendar-server
cperivol  2246  0.0  0.3 398160 13772 ?        Sl   16:53   0:00 /usr/lib/gnome-online-accounts/goa-daemon
cperivol  2298  0.0  0.2 306376  9448 ?        Sl   16:53   0:00 gnome-screensaver
cperivol  2543  0.2  0.4 592516 19312 ?        Sl   16:55   0:02 gnome-terminal
cperivol  2548  0.0  0.0  12708   888 ?        S    16:55   0:00 gnome-pty-helper
cperivol  2916  0.0  0.0  13592   928 pts/1    S+   17:09   0:00 grep gnome

在我拔掉并重新插入以太网后

 $ tail ~/.xsession-errors
Window manager warning: Buggy client sent a _NET_ACTIVE_WINDOW message with a timestamp of 0 for 0x1e00003 (Messaging )
Window manager warning: meta_window_activate called by a pager with a 0 timestamp; the pager needs to be fixed.
Window manager warning: Buggy client sent a _NET_ACTIVE_WINDOW message with a timestamp of 0 for 0x1e00003 (Messaging )
Window manager warning: meta_window_activate called by a pager with a 0 timestamp; the pager needs to be fixed.

(gnome-settings-daemon:2040): GLib-CRITICAL **: g_variant_get_int32: assertion `g_variant_is_of_type (value, G_VARIANT_TYPE_INT32)' failed
GConf Error: Configuration server couldn't be contacted: D-BUS error: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
WARNING:root:timeout reached, exiting
Window manager warning: Got a request to focus 0x240008b (Gmail - An) with a timestamp of 0.  This shouldn't happen!
Window manager warning: Got a request to focus 0x240008b (XDG Base D) with a timestamp of 0.  This shouldn't happen!

答案1

可以使用在XDG 基础目录规范

与您相关的变量是$XDG_DATA_HOME$XDG_CONFIG_HOME$XDG_CACHE_HOME

通常的默认值是:

XDG_CONFIG_HOME~/.config

XDG_DATA_HOME~/.local/share

XDG_CACHE_HOME~/.cache

不确定哪里是设置它们的最佳位置,但.profile我想到了。确保也导出变量。

相关内容