mac(ver 10.13)でbrewを使ってw3mを入れても画像は表示されない.
色々不毛な時間を過ごしたが,表示できるようになったのでメモ.
☆ソースからコンパイル.
brew install imlib2
git clone https://github.com/tats/w3m.git
cd ./w3m
./configure LDFLAGS='-L/usr/local/opt/openssl/lib -L/opt/X11/lib -lX11' CPPFLAGS='-I/usr/local/opt/openssl/include -I/opt/X11/include ' --enable-japanese=U --prefix=/Users/ぷっちょ/w3m-from-git
make
make install
☆あるいは,finkをソースからインストールし,
sudo apt-get install w3m
☆macのアプリのターミナルでは画像は表示できていない.xtermなら表示できる.
xquartzをインストールするとxtermもついてくる.
brew install xquartz
☆xtermを使いやすくしておく.
14x14ja.bdf.gz と 14x14ja.pcf.gzのフォントを/opt/X11/share/fonts/miscに入れておき,そこでmkfontdirを実行.
macuimをインストールし,日本語入力ができるようにしておく.
#!/bin/sh
.bashrcに以下を追加
.Xresourcesに
xterm*ximFont: -misc-fixed-medium-r-normal--14-130-75-75-c-140-jisx0208.1983-0
☆xtermの起動
xterm -fg white -bg black -sb -sl 60000 -geometry 140x25+40+0 -fn '-misc-fixed-medium-*-14-*-iso10646-*'
これで画像がインラインで表示できる.
image/png; /sw/bin/gpicview '%s'; description=PNG Image; test=test -n "$DISPLAY"; nametemplate=%s.png
image/jpeg; /sw/bin/gpicview '%s'; description=JPEG Image; test=test -n "$DISPLAY"; nametemplate=%s.jpeg
image/gif; /sw/bin/gpicview '%s'; description=JPEG Image; test=test -n "$DISPLAY"; nametemplate=%s.jpeg
#image/gif; /sw/bin/firefox '%s'; description=GIF Image; test=test -n "$DISPLAY"; nametemplate=%s.gif
#image/gif; /usr/bin/qlmanage -p '%s'; description=GIF Image; test=test -n "$DISPLAY"; nametemplate=%s.gif
個人的にはgpicviewがよく,finkを用いてインストールしておいた.
sudo apt-get install gpicview
雑記および追記:
○gdk-pixbufをbrew --interactiveでコンパイルしてインストールしようとしても,--with-x11はlibx11.laがないためリンカエラーがでる.libx11.laはどうやって入手するのかわからない.
○mltermでw3mインライン画像表示できるが,窓をドラッグで大きくしたらクラッシュした.xtermでも急に拡大させるとクラッシュする場合があった.
○yahooサイトはw3mでログインできないし,画像も表示されない.そういうサイトもあるだろう.