diff --git a/box/Dockerfile b/box/Dockerfile index 897c854..f9f5ebe 100644 --- a/box/Dockerfile +++ b/box/Dockerfile @@ -4,7 +4,7 @@ # be read with their places and numbered on the bot's picture (box/a11y, after XBot's box). # The desktop is LazyBoy2's box (was fluxbox, a bare menu on a right click): a minimal XFCE # (xfwm4 + xfdesktop + a panel with 應用程式, 瀏覽器, 終端機, the open windows and a clock), -# Arc-Dark + Papirus + jf open 粉圓, Traditional Chinese menus, Taipei time. Not on LazyBoy2's: +# Arc-Dark + Papirus + 思源黑體 (粉圓 until box 14), Traditional Chinese menus, Taipei time. Not on LazyBoy2's: # 檔案管理員 (Thunar, with thumbnails), 文字編輯器 (Mousepad) and 影像檢視器 (Ristretto), so a # file a bot made or downloaded opens with a double click. FROM debian:bookworm-slim @@ -44,12 +44,8 @@ RUN printf '%s\n' \ && apt-get clean && rm -rf /var/lib/apt/lists/* \ && useradd -m -s /bin/bash bot && echo 'bot ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/bot \ && ln -sf /usr/share/novnc/vnc.html /usr/share/novnc/index.html -# jf open 粉圓 (OFL) as the desktop's font, pinned like LazyBoy2's. -RUN mkdir -p /usr/share/fonts/truetype/huninn \ - && curl -fsSL https://github.com/justfont/open-huninn-font/releases/download/v2.1/jf-openhuninn-2.1.ttf \ - -o /usr/share/fonts/truetype/huninn/jf-openhuninn-2.1.ttf \ - && echo '9d5bf4932d31fe94c18cd8cfddc98bc1b14ce10f4e354c682179db290a99c825 /usr/share/fonts/truetype/huninn/jf-openhuninn-2.1.ttf' | sha256sum -c \ - && fc-cache -f +# The desktop's font is 思源黑體 (Noto Sans CJK TC, from fonts-noto-cjk above) — the same face as +# AnyBot's own window; 思源宋體 (Noto Serif CJK TC, same package) for serif. Box 14 dropped 粉圓. COPY start.sh /usr/local/bin/anybot-box-start COPY a11y /usr/local/bin/anybot-a11y COPY browser /usr/local/bin/anybot-browser @@ -71,7 +67,6 @@ COPY xfce/browser.desktop /usr/share/applications/anybot-browser.desktop COPY xfce/terminal.desktop /usr/share/applications/anybot-terminal.desktop COPY fonts.conf /etc/fonts/conf.d/99-anybot-cjk.conf COPY gtk3-settings.ini /etc/gtk-3.0/settings.ini -COPY licenses/huninn-OFL.txt /usr/share/licenses/huninn/OFL.txt RUN chmod +x /usr/local/bin/anybot-box-start /usr/local/bin/anybot-a11y /usr/local/bin/anybot-browser /usr/local/bin/anybot-screen /usr/local/bin/anybot-terminal \ # The menu shows 瀏覽器 and 終端機 once each: anybot-browser is the one way to start Chromium # (the same profile and DevTools port as the browser tools), anybot-terminal the terminal. @@ -107,6 +102,6 @@ RUN chmod +x /usr/local/bin/anybot-box-start /usr/local/bin/anybot-a11y /usr/loc # unset, so one command can still ask for LANG=C. ENV LANG=zh_TW.UTF-8 LANGUAGE=zh_TW:zh:en DISPLAY=:1 SCREEN_SIZE=1280x800x24 XDG_CURRENT_DESKTOP=XFCE GTK_MODULES=gail:atk-bridge GTK_A11Y=atspi GNOME_ACCESSIBILITY=1 NO_AT_BRIDGE=0 EXPOSE 6080 -LABEL anybot.box.version="13" +LABEL anybot.box.version="14" ENTRYPOINT ["/usr/bin/tini", "--"] CMD ["/usr/local/bin/anybot-box-start"] diff --git a/box/fonts.conf b/box/fonts.conf index b1faef7..3dd8dc4 100644 --- a/box/fonts.conf +++ b/box/fonts.conf @@ -1,31 +1,25 @@ - - - 粉圓 - jf open 粉圓 2.1 - - - jf open 粉圓 - jf open 粉圓 2.1 - - - Huninn - jf open 粉圓 2.1 - - + sans-serif - jf open 粉圓 2.1 + Noto Sans CJK TC zh sans-serif - jf open 粉圓 2.1 + Noto Sans CJK TC + + + + serif + + Noto Serif CJK TC diff --git a/box/gtk3-settings.ini b/box/gtk3-settings.ini index 23cc34c..9434058 100644 --- a/box/gtk3-settings.ini +++ b/box/gtk3-settings.ini @@ -1,5 +1,5 @@ [Settings] -gtk-font-name=jf open 粉圓 2.1 12 +gtk-font-name=Noto Sans CJK TC 11 gtk-icon-theme-name=Papirus-Dark gtk-theme-name=Arc-Dark gtk-application-prefer-dark-theme=1 diff --git a/box/start.sh b/box/start.sh index ccd0e64..8504e4b 100644 --- a/box/start.sh +++ b/box/start.sh @@ -66,7 +66,7 @@ done su bot -c "$AS_BOT gsettings set org.gnome.desktop.interface toolkit-accessibility true" 2>/dev/null || true # The file window opens smaller than the screen, whatever size it was left at. (GTK takes the # saved size only with a saved place too; without one it sized the window from the font, and with -# 粉圓 12 that was 1342×1029: 開啟 off the right edge of the screen.) +# the old 粉圓 12 that was 1342×1029: 開啟 off the right edge of the screen.) su bot -c "$AS_BOT gsettings set org.gtk.Settings.FileChooser window-size '($((SW * 7 / 10)), $((SH * 3 / 4)))'" 2>/dev/null || true su bot -c "$AS_BOT gsettings set org.gtk.Settings.FileChooser window-position '($((SW * 15 / 100)), $((SH / 8)))'" 2>/dev/null || true su bot -c "$AS_BOT xrdb -nocpp -merge /home/bot/.Xresources" diff --git a/box/welcome.html b/box/welcome.html index 2cec29e..75c5875 100644 --- a/box/welcome.html +++ b/box/welcome.html @@ -4,7 +4,7 @@ Bot 的電腦 diff --git a/box/xfce/xfwm4.xml b/box/xfce/xfwm4.xml index 5603ff5..748e452 100644 --- a/box/xfce/xfwm4.xml +++ b/box/xfce/xfwm4.xml @@ -12,7 +12,7 @@ - + diff --git a/docs/feature-map/computers.md b/docs/feature-map/computers.md index 2aad88f..58f2ad6 100644 --- a/docs/feature-map/computers.md +++ b/docs/feature-map/computers.md @@ -35,7 +35,7 @@ - Bot 不能自己換電腦:工具指定了別台,但使用者最近三則訊息沒提到那台,這一步會被移回使用者選的那台,結果裡會說。真的要別台先問使用者。 - 使用者選的那台沒開機、或那台的 AnyBot 沒開沒登入,就不在清單上:Bot 先待在自己的電腦,`list_computers` 會寫那台「現在沒有連線」。 - 在 Bot 自己的電腦上做事不用問,但它看不到使用者的檔案;檔案工具只碰得到自己的資料夾(大家共用同一台)。 -- Bot 的電腦的桌面是第 12 版起換的(照 LazyBoy2 的 box:XFCE 工作列、深色主題、粉圓字型、繁中、台北時間);第 11 版以前是 fluxbox,只有右鍵選單和一條細工作列,設定 › 電腦「更新 Bot 的電腦」換新版。桌面設定每次開機照映像檔重放,在桌面上改的外觀、工作列不會留下;留下的是檔案和瀏覽器的登入。工作列鎖住(xfconf 的鎖要寫使用者名稱 bot,寫「*」不算數);它的「面板 › 登出 › 結束」只關掉工作列,一秒後自己回來。網頁上傳檔案的視窗開機時設好大小和位置(GTK 沒有記著位置就照字型算大小,比螢幕大)。時區是 /etc/localtime(台北),沒有 TZ 變數,Bot 改了就生效。 +- Bot 的電腦的桌面是第 12 版起換的(照 LazyBoy2 的 box:XFCE 工作列、深色主題、繁中、台北時間;字型第 14 版起是思源黑體,和 AnyBot 視窗同一套,以前是粉圓);第 11 版以前是 fluxbox,只有右鍵選單和一條細工作列,設定 › 電腦「更新 Bot 的電腦」換新版。桌面設定每次開機照映像檔重放,在桌面上改的外觀、工作列不會留下;留下的是檔案和瀏覽器的登入。工作列鎖住(xfconf 的鎖要寫使用者名稱 bot,寫「*」不算數);它的「面板 › 登出 › 結束」只關掉工作列,一秒後自己回來。網頁上傳檔案的視窗開機時設好大小和位置(GTK 沒有記著位置就照字型算大小,比螢幕大)。時區是 /etc/localtime(台北),沒有 TZ 變數,Bot 改了就生效。 - 檔案視窗的「取消」「開啟」在視窗最上面(第 11 版以前在最下面、被螢幕切掉,網頁上傳圖片選得到檔案卻送不出去——設定 › 電腦「更新 Bot 的電腦」換新版)。看畫面時可以跟自己的電腦互相複製貼上;在畫面裡打的字進到正在看的那個螢幕(Bot 自己的螢幕也一樣,不會打到共用的)。那個 Bot 的螢幕沒開時,看到的是共用桌面,點擊和打字也都算在共用桌面(共用桌面上的 Bot 會停手);畫面中途關掉,之後打的字不會另外開一個看不到的螢幕。 - 從帳號看 Bot 電腦的畫面,只要開著就不會斷;之前靜止畫面一分鐘、或看超過十分鐘會被帳號伺服器切掉,要更新帳號伺服器(make update-server)。 - 從帳號看畫面的票會出現在網址裡,所以網頁一打開就換掉連結裡那張(舊的當場作廢),每次斷線重連再換一張;票只在發出後十分鐘內能開新連線,已連上的畫面在要票的手機還登入時一直開著。斷線超過十分鐘:手機網頁用自己的登入重新要票;電腦開的網頁顯示「這個畫面連結已過期」並停止重試,回 AnyBot 再開一次。驗證:開著畫面、關掉 Wi-Fi 一分鐘再打開要自己接回;把連結複製到另一個瀏覽器(原本的已經開著)要連不上。 diff --git a/docs/install.md b/docs/install.md index 120537a..5caa6c4 100644 --- a/docs/install.md +++ b/docs/install.md @@ -64,7 +64,7 @@ make install | xclip / wl-clipboard | 貼上圖片;GNOME/KDE Wayland 上打中文 | | ffmpeg | 影片、語音、示範錄影 | | docker.io | Bot 自己的電腦 | -| fonts-noto-cjk | 更多中文字形(內建的粉圓體已經夠用) | +| fonts-noto-cjk | 更多中文字形(內建的思源黑體、思源宋體已經夠用) | 沒有螢幕的 Linux(只當手腳或大腦):只需要 `libasound2`;要讓 Bot 看得到畫面,還要虛擬螢幕(Xvfb)、視窗管理員和輔助使用服務。`./install.sh hands` 會一起裝好(自己來:`make hands`)。 diff --git a/src/cloudbox.rs b/src/cloudbox.rs index 8687306..2c989f5 100644 --- a/src/cloudbox.rs +++ b/src/cloudbox.rs @@ -127,7 +127,7 @@ const TYPE_DELAY_MS: u64 = 12; const DOCKERFILE: &str = include_str!("../box/Dockerfile"); /// Every file the box image is built from (build_image writes them next to the Dockerfile), by -/// its path under box/. The desktop is LazyBoy2's: XFCE with a panel, Arc-Dark, jf open 粉圓. +/// its path under box/. The desktop is LazyBoy2's: XFCE with a panel, Arc-Dark — in 思源黑體 (Noto Sans CJK TC). const BOX_FILES: &[(&str, &str)] = &[ ("start.sh", include_str!("../box/start.sh")), ("a11y", include_str!("../box/a11y")), @@ -139,7 +139,6 @@ const BOX_FILES: &[(&str, &str)] = &[ ("welcome.html", include_str!("../box/welcome.html")), ("fonts.conf", include_str!("../box/fonts.conf")), ("gtk3-settings.ini", include_str!("../box/gtk3-settings.ini")), - ("licenses/huninn-OFL.txt", include_str!("../box/licenses/huninn-OFL.txt")), ("xfce/wallpaper.svg", include_str!("../box/xfce/wallpaper.svg")), ("xfce/xfce4-panel.xml", include_str!("../box/xfce/xfce4-panel.xml")), ("xfce/xfwm4.xml", include_str!("../box/xfce/xfwm4.xml")), @@ -3855,7 +3854,7 @@ mod tests { use chrono::TimeZone; let at = chrono::Utc.with_ymd_and_hms(2026, 11, 6, 19, 0, 0).unwrap().with_timezone(&chrono_tz::Asia::Taipei); assert!(in_schedule_window("03:00", at.time())); - assert_eq!(wanted_version(), "13"); + assert_eq!(wanted_version(), "14"); // Every file the Dockerfile copies is one this app carries (build_image writes them), and // every file carried is copied. let copied: Vec<&str> = DOCKERFILE.lines().filter_map(|l| l.trim().strip_prefix("COPY ")).map(|l| l.split_whitespace().next().unwrap()).collect();