技术解读

以下内容由 GitRead 中文社区 编辑团队基于项目 README 与官方资料整理, 结合中文开发者的常见使用场景补充技术选型建议。具体以项目官方文档为准。

项目背景与痛点

KDE Plasma 6 把整个桌面栈搬到了 Qt 6 上,这一跳的副作用远比版本号看起来更猛烈:窗口装饰从 KDecoration2 迁到 KDecoration3,KWin 的脚本系统被彻底改写成 QML 驱动,输入事件的处理链路也借此重做了一遍。对 Arch 用户来说,这意味着过去那套“下载主题包、手动替换 Aurorae 装饰、再贴一个 GitHub 上的 KWin JavaScript 脚本”的老套路,几乎每一步都会撞上 API 断代。

更麻烦的是,这件事在现实中会被拆成十几个彼此不相关的步骤:装全局主题、配 Kvantum、改 color scheme、处理 SDDM 登录界面、写一个手势脚本、调 kwinrc 里的触发阈值。中间任何一步版本错位,plasmashell 就会不声不响地回退到 Breeze 默认样式,而用户往往要重启一次会话才能发现。

LichArch 试图解决的正是这个“最后一公里”问题。它把三件本该分离的东西——暗色主题套件、原生 KWin 手势引擎、自动化安装器——收进同一个仓库,目标很清晰:让一台刚装完的 Plasma 6 机器用一条命令进入可用的暗色状态。

核心技术揭秘

从结构上看,LichArch 是三层叠加的:

表现层是标准的 Plasma look-and-feel 包:.colors 配色方案、SVG 九宫格切片的 Plasma style、以及窗口装饰。README 里“Hyper-optimized”这个措辞值得琢磨——暗色主题最常见的性能陷阱,是无节制地堆半透明和实时模糊。在合成器上,半透明的窗口装饰会强制每一帧重新采样背景,4K 屏上这笔账不小。合理推断,LichArch 用的是以静态 SVG 为主的装饰路线,靠九宫格缩放而非位图,既避开高 DPI 模糊,也避开了持续重绘。

手势层是它最有技术含量的部分。KWin 6 之后,脚本不再是独立进程里的 JS 沙箱,而是以 QML handler 的形式挂在输入管线上。手势从 libinput 出来,经 InputRedirection 分发,识别器判定指数量与位移方向,再映射为具体动作。这条链路的关键在于,它跑在合成器进程内部——没有 IPC 往返,没有轮询,延迟由输入管线本身决定。这正是“native”二字的分量所在:外部常驻 daemon 做手势的方案,在 Wayland 下连全局指针都拿不到。

安装层是一段 bash 编排:依赖探测 → 调 pacman 拉取缺失包 → 用 kwriteconfig6 把配置写进 kwinrc、kdeglobals、plasmarc → 通过 D-Bus 触发重载。它负责的是把散落各处的配置项收敛成一次幂等操作。

下面这张图是我对该项目运行时数据流的还原:

graph TD A[用户触摸板手势] --> B[libinput 原始事件] B --> C[KWin 6 输入分发层] C --> D{"手势识别器"} D -->|"三指横滑"| E[工作区切换动作] D -->|"四指上滑"| F[窗口总览动作] D -->|"捏合缩放"| G[平铺与缩放动作] E --> H[动作调度器] F --> H G --> H H --> I[Plasma Shell 状态同步] J[LichArch 安装器] --> K[依赖探测与 pacman 安装] K --> L[kwriteconfig6 写入配置] L --> M[全局主题与配色注入] M --> I

值得单独指出的是 H 这一节点。手势识别与动作执行之间如果直接硬编码耦合,每加一种手势就要改识别器逻辑;把它抽象成调度器,意味着手势表可以做成数据驱动——这是能否长期演进的分水岭。

功能亮点与差异

杀手锏是“版本自洽”。 主题包、手势脚本、安装器同处一个仓库同一次提交,装饰用的 SVG 与 KWin 脚本调用的 API 是同一时间点验证过的组合。这看似平淡,却恰好击中 Plasma 6 迁移期最大的痛点:社区里大量主题与脚本是跨版本拼凑的,用户根本无从判断哪两个组件能共存。

其次是手势跑在合成器内。 相比 libinput-gestures 这类基于 libinput debug-events 解析的方案,它不需要独占设备、不需要 root、也不会与 Wayland 会话产生权限冲突。代价是必须绑定 KWin,但这本来就是项目的定位。

第三是安装脚本的收敛能力。 把配置写进正确路径这件事,对熟悉 KDE 的人是常识,对新手是深坑——kdeglobals 里 [General] ColorScheme 的取值必须与已安装的 .colors 文件名严格一致,错一个字符就是静默回退。

应用场景与落地建议

它最适合的落地场景很具体:全新安装的 Arch + Plasma 6,Wayland 会话。这是作者验证过的组合,也是失败概率最低的路径。

生产环境或者多人共用机器上要谨慎。几点建议:

  • 跑安装器前先备份 ~/.config 下与 KDE 相关的 rc 文件。幂等写入是好事,但“正确配置被错误覆盖”是另一回事。
  • Plasma 6 的小版本迭代相当频繁,KWin 的 QML API 在 6.0 到 6.2 之间有过调整。滚动更新前留意仓库是否有对应 commit,不要盲目 git pull 后重跑脚本。
  • X11 会话下的手势行为与 Wayland 不一致,如果你的硬件在 Wayland 上有输入问题,先解决那个再用。
  • 企业环境或需要品牌定制的镜像不适合直接套用——主题与装饰是硬编码在包里的,二次改造成本不低。

综合评价

优点:设计意图明确,三层职责清晰;手势引擎走原生路线,延迟与权限模型都干净;安装器把隐性知识显性化,降低了 Plasma 6 的入门门槛。整体是一个“小而专注”的工具,没有为了通用性把自己吹成框架。

缺点:单一维护者项目,长期跟进 KWin API 变更的能力存疑——而 KWin 恰恰是 Plasma 里改动最激进的部分。文档与测试覆盖从仓库层面难以判断,Arch-only 的定位也意味着其他发行版用户基本无法复用。主题层的“超优化”目前更像一个主张,而非可验证的量化结果。

一句话收束:它解决的是一个真实且高频的痛点,技术选型也对路;风险不在设计,在维护的持续性。 值得用,但请把它当作一个需要你偶尔回访的依赖,而不是装完就忘的黑盒。

关于

GitHub 原始描述(英文)

Hyper-optimized dark theme suite, native KWin gesture engine, and automated setup launcher for KDE Plasma 6 on Arch Linux.

描述取自 GitHub 官方 API,保持仓库作者书写的原文。

简要分析

热度分
4639
价值分
2783
活跃状态
活跃

语言占比

JavaScript
QML
Shell

README

    __    ____ ______ _   _      ___    ____   ____ _   _ 
   / /   /  _// ____/| | | |    /   |  / __ \ / ____/| | | |
  / /    / / / /    / /_/ /    / /| | / /_/ // /    / /_/ / 
 / /___ / / / /___ / __  /    / ___ |/ _, _// /___ / __  /  
/_____//___/\____//_/ /_/    /_/  |_/_/ |_| \____//_/ /_/   

LICH ARCH THEME & KDE PLASMA SUITE

A dark, hyper-optimized Arch Linux & KDE Plasma 6 environment by Lich.
100% Decoupled & Dynamic Architecture: Independent installer scripts for custom executable tools, OCR screen capture (Meta+Shift+T), Plasma themes & color schemes, KWin Krohnkite tiling, Konsole terminal profiles, Rofi glassmorphism launcher, application configs, system info tools, and master interactive launcher.

Arch Linux KDE Plasma 6 Wayland InputActions License: MIT


Decoupled Quick Start

Every installer script is standalone and lives in scripts/. You can execute any script directly or launch the master interactive launcher:

git clone https://github.com/AhmadHassan-BTed/LichArch.git
cd LichArch

# Option 1: Master Launcher (Interactive / CLI Flags)
./install.sh

# Option 2: Execute Standalone Module Installers Directly
./scripts/setup-touchpad.sh   # Touchpad & Mouse Gestures Only (Live YAML Parser)
./scripts/setup-bin.sh        # Custom OCR Tool & Keybinding (Meta + Shift + T)
./scripts/setup-colors.sh     # Plasma Color Schemes & Desktop Themes
./scripts/setup-kwin.sh       # KWin Compositor, Tiling & Shortcuts
./scripts/setup-konsole.sh    # Konsole Terminal Profiles
./scripts/setup-rofi.sh       # Rofi Dark Glass Launcher Theme
./scripts/setup-apps.sh       # App Configs (Dolphin, Spectacle, Kate, Darkly)
./scripts/setup-sysinfo.sh    # Fastfetch & Neofetch Configs
./scripts/setup-shell.sh      # Shell Profile (.bashrc)

Decoupled Custom Modules Summary

1. Touchpad & Mouse Gesture Engine (scripts/setup-touchpad.sh)

Config: configs/inputactions/config.yaml & configs/udev/71-touchpad.rules
Native in-compositor Wayland gestures with live Python YAML parsing. Features 3-finger workspace switching, pinch overview/grid, 4-finger track skip and continuous volume control.

2. Custom Wayland OCR Tool & Keybinding (scripts/setup-bin.sh)

Source: configs/bin/ocr-screenshot & configs/applications/net.local.ocr-screenshot.desktop
Global Shortcut: Meta + Shift + T
Installs custom Wayland OCR screenshot tool combining slurp, spectacle, tesseract, and wl-copy. Pressing Meta + Shift + T opens region selection, performs optical character recognition, and copies extracted text directly to the system clipboard with notification feedback.

3. Plasma Color Schemes & Desktop Themes (scripts/setup-colors.sh)

Source: configs/plasma/color-schemes/, desktoptheme/, look-and-feel/
Installs LichDark, MoeDark, Win11OSDark, Pastelred color schemes alongside Ant-Dark, Moe-Dark, Red-pastel, and Win11OS-dark Plasma desktop themes & look-and-feel packages.

4. KWin Window Manager & Tiling (scripts/setup-kwin.sh)

Config: configs/plasma/kwinrc, kwinrulesrc, kglobalshortcutsrc
Configures 6 virtual desktops in a 2x3 grid, Krohnkite tiling engine, Darkly window decorations, 9-level blur, and global desktop hotkeys.

5. Konsole Terminal Profiles (scripts/setup-konsole.sh)

Config: configs/konsole/
Installs Sweet.profile, LichDark.profile, WhiteOnBlack.colorscheme with 92% opacity for wallpaper bleed-through and Hack font integration.

6. Rofi Launcher Dark Glass Theme (scripts/setup-rofi.sh)

Config: configs/rofi/config.rasi
Translucent dark glass style (rgba(38,43,52,85%)), rounded borders (border-radius: 11px), and JetBrainsMono font.

7. Custom Application Settings (scripts/setup-apps.sh)

Config: configs/apps/
Deploys custom settings for Dolphin file manager (dolphinrc), Spectacle screenshot tool (spectaclerc), Kate text editor (katevirc), and Darkly window decorations (darklyrc).

8. System Info Fetch Configs (scripts/setup-sysinfo.sh)

Config: configs/neofetch/config.conf & configs/fastfetch/config.jsonc
Custom CLI hardware system info configurations.

9. Shell Profile (scripts/setup-shell.sh)

Config: configs/shell/.bashrc
Personal shell environment configuration and command aliases.


Detailed Documentation

For technical gesture tuning, volume step size tweaks, and emergency recovery hotkeys, consult the detailed reference:
Touchpad Gestures & Troubleshooting Guide


MIT License - Lich (Ahmad Hassan)

评论

暂无评论