---
title: "Gnome 笔记"
date: 2019-10-30T11:34:41+08:00
lastmod: 2020-03-14T16:10:00+08:00
tags: ["gnome", "desktop", "桌面"]
categories: ["os"]
---

## 常用设置
```bash
# 关闭左上角热响应
gsettings set org.gnome.desktop.interface enable-hot-corners false

# 缩放系统字体
gsettings set org.gnome.desktop.interface text-scaling-factor 1.5

# monospace 字体
gsettings set org.gnome.desktop.interface monospace-font-name 'YaHei Consolas Hybrid 15'

# gtk 主题
gsettings set org.gnome.desktop.interface gtk-theme 'Vertex-Dark'

# gnome-shell 主题
gsettings set org.gnome.shell.extensions.user-theme name 'Vertex'

# 图标主题
gsettings set org.gnome.desktop.interface icon-theme 'Faenza'

# 调整 gnome3 桌面(包括 gdm )放大级别
# 0 系统自动缩放
# n > 0 放大 n 倍
gsettings set org.gnome.desktop.interface scaling-factor 1

# 启用用户扩展
gsettings set org.gnome.shell disable-user-extensions false
gsettings set org.gnome.shell enabled-extensions "['user-theme@gnome-shell-extensions.gcampax.github.com', 'workspace-indicator@gnome-shell-extensions.gcampax.github.com', 'dash-to-panel@jderose9.github.com']"

# 工作区
gsettings set org.gnome.mutter dynamic-workspaces false
gsettings set org.gnome.desktop.wm.preferences num-workspaces 4
gsettings set org.gnome.desktop.wm.preferences workspace-names "['乾坤', '巽震', '坎离', '艮兑']"

# 窗口按钮
gsettings set org.gnome.desktop.wm.preferences button-layout 'appmenu:minimize,maximize,close'
```

## 在 "活动" 中创建 "文件夹"
```bash
# 创建文件夹
gsettings set org.gnome.desktop.app-folders folder-children "['Office','VirtualBox']"

# 指定文件夹名字
gsettings set org.gnome.desktop.app-folders.folder:/org/gnome/desktop/app-folders/folders/Office/ name "Office"
gsettings set org.gnome.desktop.app-folders.folder:/org/gnome/desktop/app-folders/folders/VirtualBox/ name "VirtualBox"

# 指定文件夹包含的应用类别
gsettings set org.gnome.desktop.app-folders.folder:/org/gnome/desktop/app-folders/folders/Office/ categories "['Office']"
gsettings set org.gnome.desktop.app-folders.folder:/org/gnome/desktop/app-folders/folders/VirtualBox/ categories "['Emulator']"
```

## 快捷键
```bash
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-1 "[]"
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-last "[]"
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-up "['<Super>Up']"
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-down "['<Super>Down']"
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-left "['<Super>Left']"
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-right "['<Super>Right']"

gsettings set org.gnome.desktop.wm.keybindings switch-applications "[]"
gsettings set org.gnome.desktop.wm.keybindings switch-applications-backward "[]"
gsettings set org.gnome.desktop.wm.keybindings switch-windows "['<Alt>Tab']"
gsettings set org.gnome.desktop.wm.keybindings switch-windows-backward "['<Shift><Alt>Tab']"
gsettings set org.gnome.shell.window-switcher current-workspace-only true
gsettings set org.gnome.shell.window-switcher app-icon-mode both

gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-down "['<Alt><Super>Down']"
gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-up "['<Alt><Super>Up']"
gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-last "[]"

gsettings set org.gnome.desktop.wm.keybindings move-to-monitor-up "[]"
gsettings set org.gnome.desktop.wm.keybindings move-to-monitor-right "[]"
gsettings set org.gnome.desktop.wm.keybindings move-to-monitor-left "[]"
gsettings set org.gnome.desktop.wm.keybindings move-to-monitor-down "[]"

gsettings set org.gnome.desktop.wm.keybindings show-desktop "['<Super>d']"
gsettings set org.gnome.desktop.wm.keybindings toggle-maximized "['<Primary><Super>Up']"
gsettings set org.gnome.desktop.wm.keybindings minimize "['<Primary><Super>Down']"
gsettings set org.gnome.desktop.wm.keybindings maximize "[]"
```

## 在 CentOS6 下安装 gnome 桌面
```bash
yum groupinstall 'X Window System'
yum groupinstall Desktop
sed -i '/^id/id:5:initdefault:' /etc/inittab
```

## 在 CentOS7 下安装 gnome3 桌面
```bash
yum groupinstall 'X Window System'
yum groupinstall 'Gnome Desktop'
systemctl set-default graphical.target
systemctl enable gdm
# 创建一个可登陆的普通用户
```

## 在 gdm 中隐藏用户名
- 修改文件/etc/gdm/gdm.schemas，找到这一段：
    ```xml
    <schema>
    <key>greeter/Exclude</key>
    <signature>s</signature>
    <default>bin,root, daemon,adm,lp,sync,shutdown,halt,mail,news,uucp,operator,
    nobody,nobody4,noaccess,postgres,pvm,rpm,nfsnobody,pcap</default>
    </schema>
    ```
- 将用户名添加在<default>与</default>之间即可，用逗号隔开，保存退出即可。

