# 简介

本美化教程使用的是 owl4ce 大佬的 Joyful Desktop。
项目地址
美化效果如下:


本教程基于原项目 README,水平有限,大佬可以移步去看英文原文档 ε=ε=ε=ε=ε=ε=┌(; ̄◇ ̄)┘

# 安装

# 安装依赖

因为本人使用的是 Arch Linux,所以以下的操作都是以 Arch 为例,其他发行版操作大致相同,详细可参考官方 README 文档

# 安装 Xorg

sudo pacman -S xorg-server xorg-xrandr xorg-xrdb psmisc

如果未安装 Python3,请参考这里.

# 安装 UI 套件

yay -S dunst nitrogen openbox rofi rxvt-unicode-truecolor-wide-glyphs tint2 picom obmenu-generator perl-gtk3

# 安装音频服务

sudo pacman -S pulseaudio pulseaudio-alsa mpd mpc ncmpcpp

同时也集成了支持 MPRIS 的媒体播放器,如 [spotify](https://wiki.archlinux.org/title/spotify)。

# 扩展程序

如果以下软件没有安装,某些功能可能会在需要时出现问题。

sudo pacman -S alsa-utils brightnessctl imagemagick scrot w3m wireless_tools xclip xsettingsd xss-lock

选择你自己的 polkit 认证代理。
polkit-gnome?


# 完善桌面环境

sudo pacman -S thunar thunar-archive-plugin thunar-volman ffmpegthumbnailer tumbler htop nano #neofetch

Gsimplecal 被用来显示来自 tint2 面板的日历弹出窗口,pavucontrol 用来控制 pulseaudio-sinks。

sudo pacman -S geany geany-plugins gimp gsimplecal inkscape mpv parcellite pavucontrol viewnior xfce4-power-manager

这里是改进后的 nanorc,带有语法高亮的功能。

# 安装 zsh 与 oh-my-zsh 插件

sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
sudo chsh -s $(command -v zsh)
git clone --depth 1 https://github.com/zdharma-continuum/fast-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/fast-syntax-highlighting
git clone --depth 1 https://github.com/zsh-users/zsh-autosuggestions.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
git clone --depth 1 https://github.com/zsh-users/zsh-completions.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-completions

# 安装字体 & 图标

# 字体

TypefacesLicenseThe path of extracted files from the archive
GNOME CantarellOFL-1.1cantarell-fonts-0.303.1/prebuilt/Cantarell-VF.otf
Google Comfortaa RegularOFL-1.1
Google Comfortaa BoldOFL-1.1
Feather IcoMoonMIT (FAQ)
Material IcoMoonApache-2.0
Iosevka Nerd Font ... MonoLICENSE
M+ 1mn Nerd Font CompleteLICENSE
M+ 1mn Nerd Font ... MonoLICENSE
GNU UnifontLICENSE

所有的上述字体下载后需放至 '~/.fonts' 目录下 (压缩包请解压后再移动),或者执行下述命令进行安装。

mkdir -pv ~/.fonts/{Cantarell,Comfortaa,IcoMoon-Custom,Nerd-Patched,Unifont}

wget --no-hsts -cNP ~/.fonts/Comfortaa/ https://raw.githubusercontent.com/googlefonts/comfortaa/main/fonts/OTF/Comfortaa-{Bold,Regular}.otf
wget --no-hsts -cNP ~/.fonts/IcoMoon-Custom/ https://github.com/owl4ce/dotfiles/releases/download/ng/{Feather,Material}.ttf
wget --no-hsts -cNP ~/.fonts/Nerd-Patched/ https://github.com/owl4ce/dotfiles/releases/download/ng/M+.1mn.Nerd.Font.Complete.ttf
wget --no-hsts -cNP ~/.fonts/Nerd-Patched/ https://github.com/owl4ce/dotfiles/releases/download/ng/{M+.1mn,Iosevka}.Nerd.Font.Complete.Mono.ttf
wget --no-hsts -cNP ~/.fonts/Unifont/ https://unifoundry.com/pub/unifont/unifont-14.0.02/font-builds/unifont-14.0.02.ttf
wget --no-hsts -cN https://download-fallback.gnome.org/sources/cantarell-fonts/0.303/cantarell-fonts-0.303.1.tar.xz

tar -xvf cantarell*.tar.xz --strip-components 2 --wildcards -C ~/.fonts/Cantarell/ \*/\*/Cantarell-VF.otf

另外,请安装 noto (emoji takes precedence) 来获得 emoji 表情支持 Debian.
Arch. Gentoo.

# 图标

IconsLicenseUsability
GladientPROPIETARY (?)Openbox desktop (root-)menu
Papirus-CustomGPL-3.0Universal
Papirus-Dark-CustomGPL-3.0Universal

上述图标下载后移动到 '~/.icons' 目录 (压缩包请解压后再移动),或者执行下述命令完成安装。

mkdir -pv ~/.icons

wget --no-hsts -cN https://github.com/owl4ce/dotfiles/releases/download/ng/{Gladient_JfD,Papirus{,-Dark}-Custom}.tar.xz

tar -xf Gladient_JfD.tar.xz -C ~/.icons/
tar -xf Papirus-Custom.tar.xz -C ~/.icons/
tar -xf Papirus-Dark-Custom.tar.xz -C ~/.icons/

sudo ln -vs ~/.icons/Papirus-Custom /usr/share/icons/
sudo ln -vs ~/.icons/Papirus-Dark-Custom /usr/share/icons/
为什么我要将图标链接到[/usr]

dunst 程序需要以此显示应用发送的通知

# 壁纸

WallpapersLicenseThe path where it will be put
batik-1_4KCC BY-NC-SA 4.0~/.wallpapers/mechanical
okita-souji_FHDCC BY-NC-SA 4.0~/.wallpapers/mechanical
cherry-blossoms_FHDCC BY-NC-SA 4.0~/.wallpapers/eyecandy
floral-artistic-2_FHDCC BY-NC-SA 4.0~/.wallpapers/eyecandy

所有壁纸请放至 '~/.wallpapers' 目录下,或执行下述命令。

mkdir -pv ~/.wallpapers/{mechanical,eyecandy}

wget --no-hsts -cNP ~/.wallpapers/mechanical/ https://github.com/owl4ce/dotfiles/releases/download/ng/{batik-1_4K,okita-souji_FHD}.jpg
wget --no-hsts -cNP ~/.wallpapers/eyecandy/ https://github.com/owl4ce/dotfiles/releases/download/ng/{cherry-blossoms,floral-artistic-2}_FHD.jpg

# 扩展 (URxvt)

ExtensionsLicenseUsability
resize-fontISCFont resizer
tabbedexGPL-3.0Tab functionality

以上的 perl 脚本下载后请放至 '~/.urxvt/ext' 目录,或执行下述命令。

mkdir -pv ~/.urxvt/ext

(cd ~/.urxvt/ext/; curl -LO https://raw.githubusercontent.com/simmel/urxvt-resize-font/master/resize-font)
(cd ~/.urxvt/ext/; curl -LO https://raw.githubusercontent.com/mina86/urxvt-tabbedex/master/tabbedex)

# 主题安装

# 同步配置文件

克隆仓库后,利用 rsync 进行同步。

cd ~/Documents/

仓库镜像:https://gitlab.com/owl4ce/dotfiles.git.

git clone --depth 1 --recurse-submodules https://github.com/owl4ce/dotfiles.git
rsync -avxHAXP --exclude-from=- dotfiles/. ~/ << "EXCLUDE"
.git*
LICENSE
*.md
EXTRA_JOYFUL
EXCLUDE

确保上述的 rsync 命令全部正确,

rsync -avxHAXP --exclude-from=- dotfiles/EXTRA_JOYFUL/. ~/ << "EXCLUDE"
.git*
neofetch
EXCLUDE

建议不要删除 clone 下的目录(后续升级会方便一些)

# 重新生成字体缓存

fc-cache -rv

# 最后的步骤

最后一步是登录到 openbox-session,基本上从你的显示管理器登录,如 lightdm、gdm 等。如果你使用的是 ~/.xinitrc 而不使用显示管理器,只需在最后添加以下单行命令。

exec openbox-session

# 同步更新

因为建议从一开始就使用 rsync,最简单的方法是列出不会更新的文件(通过 shellheredocs) 列出不会被更新的文件,以避免将个人文件替换。首先,用远程 git 版本库更新本地版本库。

记住你克隆版本库的位置。假设它是在 ~/Documents 目录下。

cd ~/Documents/
(cd dotfiles/; git pull --depth 1 --recurse-submodules --rebase)
rsync -avxHAXP --exclude-from=- dotfiles/. ~/ << "EXCLUDE"
.git*
LICENSE
*.md
*.joy
settings.ini
mpd.state
autostart.sh
environment
tray
eyecandy.rasi
mechanical.rasi
shared.rasi
EXTRA_JOYFUL
.gtkrc-2.0
.joyfuld
.Xresources
EXCLUDE

# 个人配置

# Urxvt 中文字体重叠的解决

经本人使用发现 Urxvt 默认字体在输入中文的时候会发生重叠现象,目前较好的解决方案是安装并使用 Sarasa Mono 字体

yay -S nerd-fonts-sarasa-mono

修改 ~/.Xresources

URxvt.font:                        xft:Sarasa Mono SC Nerd:size=11:antialias=true,\

# Joyful 桌面环境变量

~/.joyfuld
这里面是一些配色,默认目录 (比如壁纸目录等)的环境变量的设置。

# 触控板点击输入

/etc/X11/xorg.conf.d/30-touchpad.conf

Section "InputClass"
    Identifier "touchpad"
    Driver "libinput"
    MatchIsTouchpad "on"
    Option "Tapping" "on"
    Option "TappingButtonMap" "lmr"
EndSection

# Openbox 自动启动应用

~/.config/openbox/autostart.sh

强烈建议使用 unix-shell 语法,符合 POSIX 标准。不要改变默认值可能会造成损坏。

# 托盘程序

~/.config/openbox/tray
修改后将在切换模式后生效。

# 用户环境变量

~/.config/openbox/environment

使用 export 来设置用户的环境变量。不要添加任何其他语法。

# 默认应用

~/.scripts/db.apps.joy

参数可用的描述
terminalurxvt urxvtc 终端模拟器
music_playermpd MPRIS 媒体播放器
file_manageranything文件管理器
session_lockeranything会话锁定

# 快捷键

# Openbox (rc.xml)

KeyAction
窗口管理器
super + 将窗口焦点移至左侧
super + 将窗口焦点移至右侧
super + 将窗口焦点移至上方
super + 将窗口焦点移至下方
super + shift + 将当前窗口移至左侧
super + shift + 将当前窗口移至右侧
super + shift + 将当前窗口移至上方
super + shift + 将当前窗口移至下方
super + 1 / 2 / 3 / 4 / 5 / 6 / 7 / 8移动至 N 桌面 / 工作区
super + shift + 1 / 2 / 3 / 4 / 5 / 6 / 7 / 8移动当前窗口至 N 桌面 / 工作
alt + ㅤㅤㅤㅤ在当前窗口显示菜单
super + C关闭当亲窗口
super + D切换显示桌面
super + F将当前窗口全屏显示
super + ㅤㅤㅤㅤ显示桌面菜单
super + T切换当前窗口装饰
super + X当前窗口最大化
super + Z当前窗口最小化
alt + tab切换活动窗口
alt + shift + tab切换至上一窗口
super + esc打开 rofi 扩展菜单
super + prt sc打开 rofi 截屏菜单
super + R打开 rofi 主菜单
prt sc截屏
ctrl + prt sc倒计时截屏
shift + prt sc区域选择截屏
ctrl + esc弹出历史通知
ctrl + enter打开当前通知的内容菜单
ctrl + ㅤㅤㅤㅤ关闭当前通知
ctrl + shift + ㅤㅤㅤㅤ关闭所有通知
super + E打开用户默认文件管理器
super + L锁定当前会话
super + enter打开默认终端模拟器
super + shift + enter更换终端模拟器背景
super + shift + R重启 UI
亮度控制
🔆+增加亮度
🔆-降低亮度
音量控制
🔊+增加音量
🔊-降低音量
🔇切换静音
媒体控制
上一首
下一首
停止播放
暂停 / 继续
键盘鼠标组合
super + 左键 (按住)自由拖动当前窗口
super + 右键 (按住)自由调整当前窗口大小
super + 上滚 / 下滚切换桌面 / 工作区
桌面鼠标控制
中键展示桌面 / 工作区列表
右键显示桌面菜单
上滚 / 下滚切换工作区 / 桌面
鼠标位于窗口标题栏
左键 (或者悬停)预览窗口
中键切换当前窗口
右键显示应用菜单
上滚 / 下滚滚动活动窗口

LEGEND
super[super](https://en.wikipedia.org/wiki/Super_key_(keyboard_button))

# Parcellite (parcelliterc)

KeyAction
ctrl + alt + P显示菜单
ctrl + alt + H显示历史菜单
ctrl + alt + X显示 persistent 菜单
ctrl + alt + A显示操作菜单

# URxvt (Xresources)

KeyAction
内置
ctrl + shift + L清理回卷缓冲区
ctrl + shift + C复制选区到剪切板
ctrl + shift + V粘贴剪切板
ctrl + 以行上滚
ctrl + 以行下滚
ctrl + home滚动至顶部
ctrl + end滚动至底部
ctrl + 右键 (按住)显示内容菜单?
URL 选择(匹配器)
ctrl + shift + U激活选择的 URL
/ / / 浏览选择的 URL
enter / 左键打开选择的 URL
esc停用选择的 URL
字体调整
ctrl + +增大字号
ctrl + -减小字号
ctrl + =字体大小重置至默认
ctrl + ?查看字体信息
标签扩展
ctrl + shift + T新建标签页
ctrl + shift + R重命名当前标签页
ctrl + shift + W关闭当前标签页
ctrl + pg up跳至下一标签页
ctrl + pg dn跳至上一标签页
ctrl + shift + pg up移动当选前标签页到下一个
ctrl + shift + pg dn移动当前标签页至上一个

SHELL
大多数 shell 使用 readline 库.

man 3 readline | less +/EDITING\ COMMANDS

# Dunst(dunstrc)

KeyAction
左键关闭当前通知
中键打开通知内容菜单
右键关闭所有通知