Share
Embed
MastodonとtootとTerminal graphics protocolのKittyとiTerm2
発表: 未発表
source: https://codeberg.org/matoken/koedolug-2025.04/src/branch/main/slide/slide.adoc
pdf: https://codeberg.org/matoken/koedolug-2025.04/src/branch/main/slide/slide.pdf
Kenichiro MATOHARA
April 12, 2025
Transcript
27 slides
-
鹿児島の右下の山奥から参加 好きなLinuxディストリビューションは Debian ActivityPub @ matrix @matoken:matrix.org Signal matoken.256 map:
© OpenStreetMap contributors Kenichiro Matohara(matoken) https://matoken.org [email protected] 2 -
motivation 低スペックな環境でもMastodonをしたい それも画像付きで 初代Raspberry Pi model Bくらいでも動くといいなくらいの想 定(ARMv6 RAM256MB)
国産Mastodon clientのnanotodonもSixel graphics対 応でおすすめ taka-tuos/nanotodon: CLI mastodon client 4 -
terminal graphics ピクセルベールのグラフィック実装がいくつかある Sixel/Kitty/iTerm2等 SixelはDECの端末やプリンタでサポートされていた VT200とVT320端末に対応 最近は対応しているターミナルエミュレータも多い see → tmuxやZellijなどのターミナルエミュレータも対応
Kitty,iTerm2はそれぞれの同名の端末で実装,その後いくつかの端 末にも移植されている 互換性はSixelが一番高い Are We Sixel Yet? 7 -
toot Mastodon CLI/TUI client Python実装,GPL-3.0 license CLI or TUIで利用できる マルチアカウント対応
Kitty/iTerm graphicに対応 Kitty/iTerm実装以前にSixel対応patchがあった 10 -
toot導入例 Debian sidは最新と同じ0.48.1だがgraphicが動作しない? 1 Kitty/iTerm graphicを使う場合に必要 pipでtootを導入することも可能 $ git
clone https://github.com/ihabunek/toot $ cd toot $ python3 -m venv venv $ source venv/bin/activate $ pip install pillow term-image urwidgets $ python -m toot --version Warning: Settings section [tui] has been deprecated in favour of [commands.tui]. python -m toot v0.48.1 1 11 -
help $ python -m toot Warning: Settings section [tui] has
been deprecated in favour of [commands.tui]. Usage: python -m toot [OPTIONS] COMMAND [ARGS]... Toot is a Mastodon CLI Options: -w, --max-width INTEGER Maximum width for content rendered by toot [default: 80] --debug / --no-debug Log debug info to stderr [default: no-debug] --color / --no-color Use ANSI color in output [default: color] --as ACCOUNT The account to use, overrides the active account. --version Show the version and exit. -h, --help Show this message and exit. Commands: activate Switch to logged in ACCOUNT. auth Show logged in accounts and instances block Block an account blocked List blocked accounts bookmark Bookmark a status bookmarks Show recent statuses in a timeline delete Delete a status diag Display useful information for diagnosing problems favourite Favourite a status 13 -
follow Follow an account followers List accounts following an account.
following List accounts followed by an account. instance Display instance details lists Show and manage your lists login Log into an instance using your browser (recommended) login_cli Log into an instance from the console (not recommended) logout Log out of ACCOUNT, delete stored access keys mute Mute an account muted List muted accounts notifications Show notifications pin Pin a status post Post a new status reblog Reblog (boost a status reblogged_by Show accounts that reblogged a status search Search for content in accounts, statuses and hashtags. status Show a single status tags List, follow, and unfollow tags thread Show thread for a toot. timeline Show timelines (deprecated, use `toot timelines` instead) timelines Show various timelines tui Launches the toot terminal user interface 14 -
TUIを使う場合はアカウント登録後はあまり使わない unblock Unblock an account unbookmark Unbookmark a status
unfavourite Unfavourite a status unfollow Unfollow an account unmute Unmute an account unpin Unpin a status unreblog Unreblog (unboost) a status update_account Update your account details upload Upload an image or video file whoami Display logged in user details whois Display account details 15 -
アカウント登録 1 インスタンスurl 2 ウェブブラウザで認証 3 ブラウザで取得した認証コードを入力 $ toot login
Warning: Settings section [tui] has been deprecated in favour of [commands.tui]. Enter instance URL [https://mastodon.social]: : Login URL: https://mastodon.social/oauth/authorize/?response_type=code&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&scope Open link in default browser? [Y/n]: Authorization code: XXXXXXXXXXXXXXXXXXX : 1 2 3 16 -
登録済アカウントの確認 1 ACTIVE の付いているアカウントが既定 $ toot auth Warning: Settings section
[tui] has been deprecated in favour of [commands.tui]. Authenticated accounts: * [email protected] ACTIVE * [email protected] Auth tokens are stored in: /home/matoken/.config/toot/config.json 1 18 -
規定アカウントの切り替え --as オプションで指定アカウントを指定可能 $ toot --as …… $ toot
activate [email protected] Warning: Settings section [tui] has been deprecated in favour of [commands.tui]. ✓ Account [email protected] activated [email protected] 19 -
画像が表示されない場合 Kitty or iTerm2 graphic対応端末? kitten icat <imagefile> などで確認 ターミナルマルチプレクサを挟んでいないか?
tmux から Kitty を起動などもNG tootが0.43.0以降か? toot --version Pythonのグラフィックライブラリが導入されているか pip list toot に -f kitty or -f iterm で明示的に対応プロトコルを渡して みる 22 -
Kitty/iTerm2 graphics非対応だけど 画像を表示できないか? 1. ブロックで雰囲気を楽しむ 解像度により大分見た目が変わる 2. 外部画像ビュワーを利用 以下は fim
指定例 .~/.config/toot/settings.toml 図 2. block表示( -f block ) [tui] media_viewer = "fimgs" 23 -
問題点 Sixel対応ターミナルマルチプレクサ経由で起動するとKitty graphicが動作しない ターミナルマルチプレクサが対応する必要がある iBus Mozc環境で入力ができない? Kitty側の問題? Kittyの消費リソースが大きい Linux amd64
の Kitty 0.41.1 で 140MB前後のRAMを使 用 軽量なターミナルを探したい 25 -
Kitty graphics対応terminals から軽いものを探す Ghostty → おばけ 👻 Konsole → KDE標準
st (with a patch) → 軽量(RAM 14MB前後)だがtootでの graphicsは動作せず Warp → AI/Kittyよりさらにメモリを消費(330MB) wayst Wayland and X11 → 未検証 WezTerm → ParrotOS標準,Kittyと機能が似ている.その割 には軽量(RAM 33MB前後) Terminal graphics protocol - kitty 26 -
まとめ Terminal graphicを使ったcli/tui Mastodon clientのtoot 対応端末で画像付きでMastodonが楽しめる ActivityPubプロトコルではなくMastodon client 画像があると色々とわかりやすいしにぎやか 権威に基づく確証バイアスに陥りやすくなる?
最近の端末ソフトは結構メモリ食いになっているので軽いものを探し 中 > 現在はmlterm/WezTerm併用 ほとんどの人はウェブブラウザでいい……はい 28 -
SEE ALSO ターミナルに特化した Misskey ストリームクラ イアントです。(Sixel対応) CLI Mastodon Client.(0.5.0でSixel対応) A
command-line Fediverse client that doesn’t require a server. a blingful TUI library. → run notcurses-demo isaki68k/sayaka taka-tuos/nanotodon: CLI mastodon client BentonEdmondson/servitor: A command-line Fediverse client that doesn’t require a server notcurses 29 -
ActivityPub terminal client matrix toot Servitor nanotodon sayaka service Mastodon
ActivityPub Mastodon Misskey login Y Y toot Y Y cli Y tui Y Y streaming Y Y graphic Kitty/iTerm2/block Sixel Sixel 30 -
奥付 発表 2024-12- 14(sat) 未発表 発表者 利用ソフトウェア NeiVim + textlint
+ ライセンス 小江戸らぐ 12月のオフな集まり(第269回) Kenichiro Matohara(matoken) Asciidoctor Reveal.js CC BY 4.0 31