第 9 章 配置文件说明

Last Updated: 2026-10-23 02:52 Views: 13

第 9 章 配置文件说明

wxreader 的全部用户数据集中在一个目录,与 wxterm / wxeditor 完全 分离:

平台 配置目录
Linux / FreeBSD ~/.wxreader/
macOS ~/Library/Application Support/wxreader/
Windows %APPDATA%\wxreader\

9.1 文件一览

文件 用途
data.dat 书库 SQLite 数据库(WAL 模式):shelf / books / notes / mark 四表
cover/{书id}.png 封面缓存(240×320)
settings.json 全部设置:options(主题/语言/UI 字体/主题切换/背景图)+ editor(阅读器样式 reader 节)
logs/app_{日期}.log 运行日志(按日期滚动,排查问题时可查看)

9.2 data.dat 表结构

表 字段
shelf id、name(唯一)、added_time、sort_order(拖拽排序)
books id、shelf_id(0=未分组)、title、path(唯一,去重键)、cover、added_time、last_read、read_seconds、progress、favorite、author、format、note
notes id、book_id、page、selected_text、note_content、added_time
mark id、book_id、page、selected_text、added_time

format 取值:pdf / epub / mobi(含 azw3、prc)/ md / txt / chm / img(漫画文件夹)。

9.3 settings.json 结构

{
  "options": {
    "theme": "Tokyo Night",
    "lang": "zh-CN",
    "themeFontFamily": "微软雅黑",
    "themeFontSize": 12,
    "themeSwitchMode": "by-time",
    "uiDarkTheme": "Dark",
    "uiLightTheme": "Light",
    "darkThemeStartTime": "19:00",
    "lightThemeStartTime": "07:00",
    "backgroundImage": "/path/to/img.jpg",
    "backgroundImageMode": 2,
    "backgroundImageOpacity": 0.3
  },
  "editor": {
    "reader": {
      "fontSize": 18,
      "lineHeight": 1.5,
      "paraSpacing": 1.0,
      "textAlign": 0,
      "invert": false,
      "brightness": 1.0,
      "autoScroll": false,
      "scrollInterval": 3,
      "viewMode": 0
    }
  }
}

9.4 进度语义

books.progress(1-based)按格式含义不同:

format progress 含义
epub / mobi / md / txt 章节号
pdf 页码
img 递归阅读顺序的图片序号
chm 恒 1

read_seconds 为累计阅读秒数(窗口存活期间每 60 秒 +60)。

← Previous Article 第 8 章 快捷键与命令行 Next Article → 第 10 章 常见问题

Comments

No comments yet