CentOS7桌面版系统使用的一些小技巧

1、 清空~/.kde/ 文件下的文件,登陆后不显示桌面的解决方法

在使用CentOS7 桌面系统时,有时候打开文件会很卡。这时我们需要清空当前用户下的 .kde 文件下的所有文件。

再重新登陆该用户时,会发现桌面上的图标都不显示了。

首先查看一下系统语言hao@test01: $ cat ~/.config/user-dirs.locale 
zh_CN       ##发现是中文的

然后我们需要查看~/.config/user-dirs.dirs 配置文件是否正常

hao@test01: $ cat ~/.config/user-dirs.dirs 

# This file is written by xdg-user-dirs-update
# If you want to change or add directories, just edit the line you're
# interested in. All local changes will be retained on the next run
# Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped
# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an
# absolute path. No other format is supported.
# 
XDG_DESKTOP_DIR="$HOME/桌面"
XDG_DOWNLOAD_DIR="$HOME/下载"
XDG_TEMPLATES_DIR="$HOME/模板"
XDG_PUBLICSHARE_DIR="$HOME/公共"
XDG_DOCUMENTS_DIR="$HOME/文档"
XDG_MUSIC_DIR="$HOME/音乐"
XDG_PICTURES_DIR="$HOME/图片"
XDG_VIDEOS_DIR="$HOME/视频"


不显示的原因是
XDG_DESKTOP_DIR="$HOME/"
……

在$HOME/ 添加桌面的 目录就行了。
如果是英文 就是"$HOME/DeskTop"

vim  ~zhousc/.config/user-dirs.dirs  



2、在桌面上添加图标

cat /usr/local/bin/desktop-shotcut.bash 

source ~/.config/user-dirs.dirs

ln -s /usr/share/applications/firefox.desktop $XDG_DESKTOP_DIR/firefox.desktop
ln -s /usr/share/applications/mozilla-thunderbird.desktop $XDG_DESKTOP_DIR/mozilla-thunderbird.desktop
ln -s /usr/share/applications/pidgin.desktop $XDG_DESKTOP_DIR/pidgin.desktop
ln -s /usr/share/applications/spark.desktop $XDG_DESKTOP_DIR/spark.desktop
ln -s /usr/share/applications/shotgun.desktop $XDG_DESKTOP_DIR/shotgun.desktop

#指定用户添加不同的桌面图标
if [[ $USER == lisi ]]|| [[ $USER == zhaoliu ]]
 then
    ln -s /usr/share/applications/recorder.desktop $XDG_DESKTOP_DIR/recorder.desktop
fi

  

 

posted @ 2018-03-19 16:32  hjfjesse  阅读(657)  评论(0编辑  收藏  举报