Nougat

把 nougat 改造成支持图片解析

 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
import app


def get_image_predict(img: Image):
    model_output = app.model.inference(img)

    predictions = []
    for j, output in enumerate(model_output["predictions"]):
        if model_output["repeats"][j] is not None:
            if model_output["repeats"][j] > 0:
                disclaimer = "\n\n+++ ==WARNING: Truncated because of repetitions==\n%s\n+++\n\n"
            else:
                disclaimer = (
                    "\n\n+++ ==ERROR: No output for this page==\n%s\n+++\n\n"
                )
            rest = app.close_envs(model_output["repetitions"][j]).strip()
            if len(rest) > 0:
                disclaimer = disclaimer % rest
            else:
                disclaimer = ""
        else:
            disclaimer = ""

        predictions.append(app.markdown_compatible(output) + disclaimer)


    return "".join(predictions).strip()

Themes

Openbox

lxde + openbox

配置文件: ~/.config/openbox/lxde-rc.xml 例子:

 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
<keyboard>
  <keybind key="W-Up">
    <action name="Togglemaximize"/>
  </keybind>
  <keybind key="W-Left">
    <action name="UnmaximizeFull"/>
    <action name="MoveResizeTo">
      <x>0</x>
      <y>0</y>
      <width>50%</width>
      <height>100%</height>
    </action>
  </keybind>

  <keybind key="W-Right">
    <action name="UnmaximizeFull"/>
    <action name="MoveResizeTo">
      <x>-0</x>
      <y>0</y>
      <width>50%</width>
      <height>100%</height>
    </action>
  </keybind>

  <keybind key="S-W-Right">
    <action name="MoveResizeTo">
      <!-- Move the window to the second monitor -->
      <monitor>2</monitor>
    </action>
  </keybind>

  <keybind key="S-W-Left">
    <action name="MoveResizeTo">
      <!-- Move the window to the second monitor -->
      <monitor>1</monitor>
    </action>
  </keybind>

</keyboard>