
问题描述
在 Fedora 30 中,Gnome Desktop 默认是没有桌面图标的,只会显示背景,然而这样并不是很方便,我们可以根据需要手动开启桌面图标。
解决办法
1. 安装 nemo
> dnf info nemo
Available Packages
Name : nemo
Version : 4.0.6
Release : 2.fc30
Architecture : i686
Size : 1.5 M
Source : nemo-4.0.6-2.fc30.src.rpm
Repository : fedora
Summary : File manager for Cinnamon
URL : https://github.com/linuxmint/nemo
License : GPLv2+ and LGPLv2+
Description : Nemo is the file manager and graphical shell for the Cinnamon desktop
: that makes it easy to manage your files and the rest of your system.
: It allows to browse directories on local and remote filesystems, preview
: files and launch applications associated with them.
: It is also responsible for handling the icons on the Cinnamon desktop.
> dnf install nemo
2. 创建自启动文件
创建~/.config/autostart/nemo-autostart-with-gnome.desktop
,并在文件中保存以下内容:
> vim ~/.config/autostart/nemo-autostart-with-gnome.desktop
[Desktop Entry]
Type=Application
Name=Nemo
Comment=Start Nemo desktop at log in
Exec=nemo-desktop
OnlyShowIn=GNOME;
AutostartCondition=GSettings org.nemo.desktop show-desktop-icons
X-GNOME-AutoRestart=true
NoDisplay=true
3. 注销后重新登录
此时已经配置完成,这时只需要注销后重新登录,或者直接按Alt+F2
,并输入nemo-desktop
,就可以看到熟悉的图标出现在桌面上:

4. 解决桌面图标无法移动
这时虽然桌面已经出现了图标,但是无法进行拖拽移动等操作,需要在终端内输入如下命令:
> gsettings set org.nemo.desktop use-desktop-grid false
5. Gtk-WARNING **: cannot open display: :0.0
例如以abelsu
用户的身份登录系统,之后在终端执行sudo su
切换至root
用户后,在终端启动应用会报该错误。
切换回abelsu
用户,执行如下命令即可解决:
> xhost +
access control disabled, clients can connect from any host
- sudo gedit 错误:Gtk-WARNING **: cannot open display: :0.0 | Linux 公社
- 完美解决xhost +报错: unable to open display “” | 漏洞人生
- DISPLAY 变量和 xhost | ITeye