Gruvbox配色主题补完计划

前言

Gruvbox是一个柔和复古的暖色调主题,对比度也很高,长时间盯着也不会刺眼难受,这也是我最喜欢的配色主题,所以我的整个linux基本都是gruvbox的配色主题,包括终端st,窗口管理器dwm和其他软件,所以本篇博文我会分享我linux的gruvbox的配色主题文件,你也可以看看gruvbox的色调(暗):

配置主题

如果你要自定义图标或主题,那么使用一个gtk编辑器来自由切换主题就十分方便,我们可以使用nwg-look来管理我们的图标和主题了,这个软件可以使用包管理来安装使用,我已arch为例:
sudo pacman -S nwg-look

随便提一句nwg-look是nwg-shell的一部分,nwg-shell 项目旨在为sway Wayland 合成器创建一个基于 GTK3 的统一用户界面。为了给用户提供尽可能多的选择,安装好nwg-look后就可以开始下载主题文件那些来

1. gtk主题

gtk是一个gui框架,很多应用都是使用gtk框架,所以所以gtk主题就可以让许多软件变成gruvbox配色,我们可以在opendesktop里下载压缩包或者如果你使用的是arch就可以使用aur仓库里的包来安装了:
yay -S gruvbox-gtk-theme-git

如果你是手动下载那你需要在家目录下手动创建一个.themes的文件夹
mkdir .themes

然后在把下载好的压缩包解压放入到里面,如果要所有用户生效移动至全局目录/usr/share/themes下然后打开nwg-look就可以看到添加的主题了,相比之下我更推荐使用aur的方案

2. 图标主题

在默认的软件图标是软件的默认图标,可能会和gruvbox主题格格不入,所以可以借助图标主题来增加美观性,如果你是arch你可以使用aur仓库的包:
yay -S gruvbox-plus-icon-theme-git

也可以在项目发布页面下载.zip压缩包后解压放在家目录的.icons文件夹,如果要所有用户生效移动至全局目录/usr/share/icons下然后打开nwg-look就可以看到添加的主题了,相比之下我更推荐使用aur的方案

3. 鼠标主题

默认的鼠标主题可能会和gruvbox主题格格不入,所以可以借助鼠标主题来增加美观性,这里使用Moga Neon鼠标主题,在下载网站下载文件名有sandy的zip压缩包解压到家目录的.icons文件夹,如果要所有用户生效移动至全局目录/usr/share/icons下然后打开nwg-look就可以看到添加的主题了,不过在nwg-look下选择应用是没有办法应用的,我们还需要其他配置,这里已dwm(x11)为例,在家目录新建.Xresources文件,在文件添加

1
2
Xcursor.theme: Moga-Neon-Sandy
Xcursor.size: 24

上面分别是鼠标主题名称和鼠标大小,然后我们还要在.xinitrc加载,在.xinitrc添加:
xrdb -merge ~/.Xresources

其他细节查看: https://wiki.archlinux.org/title/Cursor_themes

4. dwm状态栏配色

打开config.h配置文件:

1
2
3
4
5
6
7
8
9
10
11
12
/* 状态栏配色(Gruvbox) */
static const char col_gray1[] = "###32302f"; /* 背景色 */
static const char col_gray2[] = "###1d2021"; /* 非激活窗口 */
static const char col_gray3[] = "###ebdbb2"; /* 文字颜色 */
static const char col_gray4[] = "###ebdbb2"; /* 激活窗口边框/文字 */
static const char col_cyan[] = "###5b623e"; /* 主题色 */
static const char *colors[][3] = {
/* fg bg border */
[SchemeNorm] = { col_gray3, col_gray1, col_gray2 },
[SchemeSel] = { col_gray4, col_cyan, col_cyan },
};

不过相对于修改config.h文件,我还是推荐修改config.def.h在删除config.h文件:
rm -rf config.h

因为如果不删除config.h文件,编译安装后就还是之前的配置,所以需要删除后在编译安装:
sudo make clean install

5. Fcitx5主题

默认的fcitx5主题是白色的,十分刺眼,所以使用主题就可以来增加美观性,主题使用fcitx5-gruvbox-dark-theme,如果你是arch可以使用aur的包:
yay -S fcitx5-gruvbox-dark-theme-git

或者也可以手动安装,首先使用git克隆仓库:
git clone https://github.com/zpyg/fcitx5-gruvbox-dark-theme ~/.local/share/fcitx5/themes/gruvbox-dark --depth=1

  1. 设置主题颜色(可选,默认为aqua)
1
2
cd ~/.local/share/fcitx5/themes/gruvbox-dark
ln -sf ./theme-'颜色'.conf theme.conf

(注:如果说aur安装的不需要这一部)

然后在.config/fcitx5/conf/classicui.conf文件下设置主题:

1
2
3
4
5
6
7
8
9
10
11
### 垂直候选列表
Vertical Candidate List=False

### 按屏幕 DPI 使用
PerScreenDPI=True

### Font (设置成你喜欢的字体)
Font="思源黑体 CN Medium 13"

### 主题
Theme=gruvbox-dark-green

然后在重新启动就可以了

6. st(终端模拟器)

打开config.h配置文件:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/* Terminal colors (16 first used in escape sequence) */
static const char *colorname[] = {
/* 8 normal colors */
"###282828", /* black */
"###cc241d", /* red */
"###98971a", /* green */
"###d79921", /* yellow */
"###458588", /* blue */
"###b16286", /* magenta */
"###689d6a", /* cyan */
"###a89984", /* white */

/* 8 bright colors */
"###928374", /* black */
"###fb4934", /* red */
"###b8bb26", /* green */
"###fabd2f", /* yellow */
"###83a598", /* blue */
"###d3869b", /* magenta */
"###8ec07c", /* cyan */
"###ebdbb2", /* white */

[255] = 0,

/* more colors can be added after 255 to use with DefaultXX */
"###add8e6", /* 256: cursor */
"###555555", /* 257: rev cursor*/
"###282828", /* 258: background */
"###ebdbb2", /* 259: foreground */

};


/*
* Default colors (colorname index)
* foreground, background, cursor, reverse cursor
*/
unsigned int defaultfg = 259;
unsigned int defaultbg = 258;
unsigned int defaultcs = 256;
static unsigned int defaultrcs = 257;

不过相对于修改config.h文件,我还是推荐修改config.def.h在删除config.h文件:
rm -rf config.h

因为如果不删除config.h文件,编译安装后就还是之前的配置,所以需要删除后在编译安装:
sudo make clean install

7. Telegram

gruvbox 风格的 Telegram 主题
使用方法很简单,只需打开:
https://t.me/addtheme/gruvboxTelegram

跳转到应用后点击应用就可以了

8. qbittorrent

在默认的qbittorrent 是只有白色的,在晚上就十分刺眼,我们可以使用配色文件来效果
仓库地址:
https://github.com/MahdiMirzadeh/qbittorrent

  1. 在 qBittorrent 中:
    • 转到“工具”→“选项”→“行为”→“界面”
    • 在“界面主题”下,点击“…”并选择下载的.qbtheme文件
    • 点击确定并重启 qBittorrent

9. nvim

仓库地址:
https://github.com/ellisonleao/gruvbox.nvim

如果你的nvim插件管理器是packer
use { "ellisonleao/gruvbox.nvim" }

如果是lazy
{ "ellisonleao/gruvbox.nvim" },

然后在init.lua添加:

1
2
3
4
--外观
opt.termguicolors = true
vim.o.background = "dark" -- or "light" for light mode
vim.cmd([[colorscheme gruvbox]])

10. yazi

仓库地址:
https://github.com/bennyyip/gruvbox-dark.yazi

使用插件管理器安装:
ya pkg add bennyyip/gruvbox-dark

在theme.toml文件添加

1
2
3
[flavor]
dark = "gruvbox-dark"