msr | syui.ai

msrは、rustで書かれたシンプルなmastodon clientです。

Download

# mac
$ curl -sLO https://github.com/syui/msr/releases/download/main/msr-x86_64-pc-windows-msvc
$ mv msr-x86_64-apple-darwin msr
$ chmod +x msr
$ ./msr
# security setting
# macの場合、ここで設定->セキュリティにてファイルを開くを選択します

# linux
$ curl -sLO https://github.com/syui/msr/releases/download/main/msr-x86_64-unknown-linux-gnu
$ mv msr-x86_64-unknown-linux-gnu msr
$ chmod +x msr
$ ./msr

build

$ git clone https://github.com/syui/msr
$ cd msr/
$ cargo build
$ ./target/debug/msr

use

mastodonの開発からappを発行してください。権限は必要最小限で構いません。名前はmsrでredirect-urlはlocalhost(なんでもいい)です。

~/.config/msr/config.tomlにtokenなどの情報を記述してください。

$ mkdir -p ~/.config/msr
$ cp config.toml.example ~/.config/msr/config.toml
$ vim ~/.config/msr/config.toml
token = "アクセストークン"
client_id = "クライアントキー"
client_secret = "クライアントシークレット"
redirect = "localhost"
base = "https://mastodon.social"

なお、~/.config/msr/setting.tomlを置くことで、簡単にaccountの切り替えができるようになります。

$ msr a -d

基本的には、a option後にfile-pathを指定することで、accountを切り替えられます。

$ msr a ~/.config/msr/social.toml

icon

macはiterm2のimgcatを使い、linuxはmltermなどでimg2sixelを使ってアイコンを表示します。

$ msr i

windowsの場合は、msys2でsixelをcompileし、minttyで表示できます。scoopでmsys2をinstallする場合のpathは~/scoop/apps/msys2/currentになります。

$ scoop install msys2
$ msys2
$ cd
$ git clone https://github.com/saitoha/libsixel
$ cd libsixel
$ pacman -S make gcc
$ ./configure
$ make
$ make install

$ mintty
$ img2sixel test.png

その他の使い方は、command helpを見てください。