AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题 / 1053497
Accepted
Dawoodjee
Dawoodjee
Asked: 2018-07-10 04:38:15 +0800 CST2018-07-10 04:38:15 +0800 CST 2018-07-10 04:38:15 +0800 CST

如何在 Calibre Ebook Viewer 中获得深色主题/夜间模式?

  • 772

大多数电子书阅读器都带有标准的简易夜间模式开关。我试图在 Calibre 中解决这个问题。到目前为止,我已经能够通过创建来更改应用程序主题以使用我的黑暗系统主题

$ sudo nano /etc/profile.d/calibre.sh

export CALIBRE_USE_SYSTEM_THEME=1

然后

$ sudo service gdm restart

但我仍然需要帮助以使 Ebook Viewer 中的背景更暗,文本更浅。

themes calibre
  • 4 4 个回答
  • 38443 Views

4 个回答

  • Voted
  1. Dawoodjee
    2018-07-11T04:23:53+08:002018-07-11T04:23:53+08:00

    除了使整个应用程序主题变暗的问题中的步骤之外,还必须在电子书查看器中应用一个主题。以下是如何做到这一点:

    保存默认主题

    1. 打开电子书(任何电子书)。
    2. 单击左下角的设置图标(螺丝刀和扳手图标取决于您的版本)。
    3. 打开主题选项卡并按您选择的名称保存主题。

    创建黑暗主题

    1. 打开用户样式表选项卡
    2. 将 Solarised Dark 主题 CSS 代码粘贴到此答案的底部。来自saucemcboss 的 Github 回购。
    3. 打开主题选项卡并以您选择的名称保存新主题。

    这样,它将适用于您的所有电子书以及应用程序的主题。您可以从主题选项卡的加载按钮在默认主题和深色主题之间切换。

    CSS:

    article,
    aside,
    details,
    figcaption,
    figure,
    footer,
    header,
    hgroup,
    nav,
    section,
    summary {
      display: block;
    }
    audio,
    canvas,
    video {
      display: inline-block;
    }
    audio:not([controls]) {
      display: none;
      height: 0;
    }
    [hidden] {
      display: none;
    }
    html {
      font-family: sans-serif;
      -webkit-text-size-adjust: 100%;
      -ms-text-size-adjust: 100%;
    }
    body {
      margin: 0;
    }
    a:focus {
      outline: thin dotted;
    }
    a:active,
    a:hover {
      outline: 0;
    }
    h1 {
      font-size: 2em;
    }
    abbr[title] {
      border-bottom: 1px dotted;
    }
    b,
    strong {
      font-weight: bold;
    }
    dfn {
      font-style: italic;
    }
    mark {
      background: #ff0;
      color: #000;
    }
    code,
    kbd,
    pre,
    samp {
      font-family: monospace, serif;
      font-size: 1em;
    }
    pre {
      white-space: pre-wrap;
      word-wrap: break-word;
    }
    q {
      quotes: "\201C" "\201D" "\2018" "\2019";
    }
    small {
      font-size: 80%;
    }
    sub,
    sup {
      font-size: 75%;
      line-height: 0;
      position: relative;
      vertical-align: baseline;
    }
    sup {
      top: -0.5em;
    }
    sub {
      bottom: -0.25em;
    }
    img {
      border: 0;
    }
    svg:not(:root) {
      overflow: hidden;
    }
    figure {
      margin: 0;
    }
    fieldset {
      border: 1px solid #c0c0c0;
      margin: 0 2px;
      padding: 0.35em 0.625em 0.75em;
    }
    legend {
      border: 0;
      padding: 0;
    }
    button,
    input,
    select,
    textarea {
      font-family: inherit;
      font-size: 100%;
      margin: 0;
    }
    button,
    input {
      line-height: normal;
    }
    button,
    html input[type="button"],
    input[type="reset"],
    input[type="submit"] {
      -webkit-appearance: button;
      cursor: pointer;
    }
    button[disabled],
    input[disabled] {
      cursor: default;
    }
    input[type="checkbox"],
    input[type="radio"] {
      box-sizing: border-box;
      padding: 0;
    }
    input[type="search"] {
      -webkit-appearance: textfield;
      -moz-box-sizing: content-box;
      -webkit-box-sizing: content-box;
      box-sizing: content-box;
    }
    input[type="search"]::-webkit-search-cancel-button,
    input[type="search"]::-webkit-search-decoration {
      -webkit-appearance: none;
    }
    button::-moz-focus-inner,
    input::-moz-focus-inner {
      border: 0;
      padding: 0;
    }
    textarea {
      overflow: auto;
      vertical-align: top;
    }
    table {
      border-collapse: collapse;
      border-spacing: 0;
    }
    html {
      font-family: 'PT Sans', sans-serif;
    }
    pre,
    code {
      font-family: 'Inconsolata', sans-serif;
    }
    h1,
    h2,
    h3,
    h4,
    h5,
    h6 {
      font-family: 'PT Sans Narrow', sans-serif;
      font-weight: 700;
    }
    html {
      background-color: #073642;
      color: #839496;
    }
    body {
      background-color: #002b36;
      margin: 0 auto;
      max-width: 23cm;
      border: 1pt solid #586e75;
      padding: 1em;
    }
    code {
      background-color: #073642;
      padding: 2px;
    }
    a {
      color: #b58900;
    }
    a:visited {
      color: #cb4b16;
    }
    a:hover {
      color: #cb4b16;
    }
    h1 {
      color: #d33682;
    }
    h2,
    h3,
    h4,
    h5,
    h6 {
      color: #859900;
    }
    pre {
      background-color: #002b36;
      color: #839496;
      border: 1pt solid #586e75;
      padding: 1em;
      box-shadow: 5pt 5pt 8pt #073642;
    }
    pre code {
      background-color: #002b36;
    }
    h1 {
      font-size: 2.8em;
    }
    h2 {
      font-size: 2.4em;
    }
    h3 {
      font-size: 1.8em;
    }
    h4 {
      font-size: 1.4em;
    }
    h5 {
      font-size: 1.3em;
    }
    h6 {
      font-size: 1.15em;
    }
    .tag {
      background-color: #073642;
      color: #d33682;
      padding: 0 0.2em;
    }
    .todo,
    .next,
    .done {
      color: #002b36;
      background-color: #dc322f;
      padding: 0 0.2em;
    }
    .tag {
      -webkit-border-radius: 0.35em;
      -moz-border-radius: 0.35em;
      border-radius: 0.35em;
    }
    .TODO {
      -webkit-border-radius: 0.2em;
      -moz-border-radius: 0.2em;
      border-radius: 0.2em;
      background-color: #2aa198;
    }
    .NEXT {
      -webkit-border-radius: 0.2em;
      -moz-border-radius: 0.2em;
      border-radius: 0.2em;
      background-color: #268bd2;
    }
    .ACTIVE {
      -webkit-border-radius: 0.2em;
      -moz-border-radius: 0.2em;
      border-radius: 0.2em;
      background-color: #268bd2;
    }
    .DONE {
      -webkit-border-radius: 0.2em;
      -moz-border-radius: 0.2em;
      border-radius: 0.2em;
      background-color: #859900;
    }
    .WAITING {
      -webkit-border-radius: 0.2em;
      -moz-border-radius: 0.2em;
      border-radius: 0.2em;
      background-color: #cb4b16;
    }
    .HOLD {
      -webkit-border-radius: 0.2em;
      -moz-border-radius: 0.2em;
      border-radius: 0.2em;
      background-color: #d33682;
    }
    .NOTE {
      -webkit-border-radius: 0.2em;
      -moz-border-radius: 0.2em;
      border-radius: 0.2em;
      background-color: #d33682;
    }
    .CANCELLED {
      -webkit-border-radius: 0.2em;
      -moz-border-radius: 0.2em;
      border-radius: 0.2em;
      background-color: #859900;
    }
    
    • 13
  2. Best Answer
    cipricus
    2020-03-16T11:17:10+08:002020-03-16T11:17:10+08:00

    我认为不需要新的 CSS 文件。此外,主要答案中的说明已过时(与具有不同 Ebook Viewer GUI 的旧版本 Calibre 相关),Calibre 主 GUI 的深色调色板的命令(在问题中)也是如此;在 4.6 版中进行测试,这是export CALIBRE_USE_DARK_PALETTE=1为了达到这个结果——正如@meskobalazs 在评论中所说。)

    为了在电子书查看器中获得深色背景和浅色字体,只需使用它打开一本电子书(使用查看器,而不是 Calibre 本身;或者,从 Calibre 主菜单中,选择书籍并按“查看”(阅读书籍)按钮) ; 然后,右键单击,然后是Preferences。或者打开该书并右键单击其中的任意位置,然后单击Preferences。

    在此处输入图像描述

    然后颜色

    在此处输入图像描述

    然后新方案

    在此处输入图像描述

    然后设置背景和前景(文本)的颜色。

    选择应用并确定。


    对于某些电子书文档,我发现了一个奇怪的问题,即无论上述设置如何,字体颜色都保持黑色,在这种情况下,使背景变暗不是一种选择。在这种情况下,其他一些电子书阅读器也有同样的问题(Foliate),而有些可以解决它(Bookworm)。

    正如这里所说的字体类型,电子书内的 CSS 文件可能会覆盖软件设置,包括字体颜色。测试一下,我提取了 epub 文件(实际上是一个 zip;一些存档管理器需要zip扩展名,有些可以直接提取)并找到/EXTRACTED_LOCATION/OEBPS/Content/Content.css该行color:Black多次出现的位置。将其替换为“灰色”会产生相当暗(但可读)的灰色,而“#DBDBDB”会产生较浅的灰色。(更改后,将提取的文件和文件夹压缩回 zip 文件,并将扩展名更改为 epub。)

    但是在这里我发现可以从 Calibre 内部进行更改:转换书籍>外观>样式,选择转换为相同的格式并检查“颜色”(而不是/旁边的“字体”)。

    在此处输入图像描述

    • 6
  3. ulle
    2019-12-14T10:15:13+08:002019-12-14T10:15:13+08:00

    使用 Calibre 4.6 版,您现在可以使用CALIBRE_USE_DARK_PALETTE=1环境变量。

    • 2
  4. CyclicUniverse
    2020-05-23T03:50:11+08:002020-05-23T03:50:11+08:00

    较新版本的 calibre 4.16 在 Preferences -> Colors 中有一个名为“覆盖书本颜色”的选项,可用于在暗模式下强制使用一致的颜色:这是一个快照。 在此处输入图像描述 单击确定,一切就绪。

    • 1

相关问题

  • 如何安装不同的图标?[复制]

  • 每当我在 wine 中安装任何东西时,主题都会混乱

  • 我可以使用哪些工具和技术来制作 GTK 主题?

  • 如何更改 GDM 中的登录屏幕主题?

  • 如何获取和安装更多主题、图标和指针?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve