Ubuntu 21.10にテキストブラウザw3mをインストールする

1.OSバージョンの確認
# cat /etc/issue
Ubuntu 21.10 \n \l

2.w3mをインストール
# sudo apt install w3m

3.w3mの使い方

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# w3m -h
options:
-t tab set tab width
-r ignore backspace effect
-l line # of preserved line (default 10000)
-I charset document charset
-O charset display/output charset
-B load bookmark
-bookmark file specify bookmark file
-T type specify content-type
-m internet message mode
-v visual startup mode
-M monochrome display
-N open URL of command line on each new tab
-F automatically render frames
-cols width specify column width (used with -dump)
-ppc count specify the number of pixels per character (4.0...32.0)
-ppl count specify the number of pixels per line (4.0...64.0)
-dump dump formatted page into stdout
-dump_head dump response of HEAD request into stdout
-dump_source dump page source into stdout
-dump_both dump HEAD and source into stdout
-dump_extra dump HEAD, source, and extra information into stdout
-post file use POST method with file content
-header string insert string as a header
+<num> goto <num> line
-num show line number
-no-proxy don't use proxy
-4 IPv4 only (-o dns_order=4)
-6 IPv6 only (-o dns_order=6)
-no-mouse don't use mouse
-cookie use cookie (-no-cookie: don't use cookie)
-graph use DEC special graphics for border of table and menu
-no-graph use ASCII character for border of table and menu
-s squeeze multiple blank lines
-W toggle search wrap mode
-X don't use termcap init/deinit
-title[=TERM] set buffer name to terminal title string
-o opt=value assign value to config option
-show-option print all config options
-config file specify config file
-help print this usage message
-version print w3m version
-reqlog write request logfile
-debug DO NOT USE
# w3m -h options: -t tab set tab width -r ignore backspace effect -l line # of preserved line (default 10000) -I charset document charset -O charset display/output charset -B load bookmark -bookmark file specify bookmark file -T type specify content-type -m internet message mode -v visual startup mode -M monochrome display -N open URL of command line on each new tab -F automatically render frames -cols width specify column width (used with -dump) -ppc count specify the number of pixels per character (4.0...32.0) -ppl count specify the number of pixels per line (4.0...64.0) -dump dump formatted page into stdout -dump_head dump response of HEAD request into stdout -dump_source dump page source into stdout -dump_both dump HEAD and source into stdout -dump_extra dump HEAD, source, and extra information into stdout -post file use POST method with file content -header string insert string as a header +<num> goto <num> line -num show line number -no-proxy don't use proxy -4 IPv4 only (-o dns_order=4) -6 IPv6 only (-o dns_order=6) -no-mouse don't use mouse -cookie use cookie (-no-cookie: don't use cookie) -graph use DEC special graphics for border of table and menu -no-graph use ASCII character for border of table and menu -s squeeze multiple blank lines -W toggle search wrap mode -X don't use termcap init/deinit -title[=TERM] set buffer name to terminal title string -o opt=value assign value to config option -show-option print all config options -config file specify config file -help print this usage message -version print w3m version -reqlog write request logfile -debug DO NOT USE
# w3m -h
options:
    -t tab           set tab width
    -r               ignore backspace effect
    -l line          # of preserved line (default 10000)
    -I charset       document charset
    -O charset       display/output charset
    -B               load bookmark
    -bookmark file   specify bookmark file
    -T type          specify content-type
    -m               internet message mode
    -v               visual startup mode
    -M               monochrome display
    -N               open URL of command line on each new tab
    -F               automatically render frames
    -cols width      specify column width (used with -dump)
    -ppc count       specify the number of pixels per character (4.0...32.0)
    -ppl count       specify the number of pixels per line (4.0...64.0)
    -dump            dump formatted page into stdout
    -dump_head       dump response of HEAD request into stdout
    -dump_source     dump page source into stdout
    -dump_both       dump HEAD and source into stdout
    -dump_extra      dump HEAD, source, and extra information into stdout
    -post file       use POST method with file content
    -header string   insert string as a header
    +<num>           goto <num> line
    -num             show line number
    -no-proxy        don't use proxy
    -4               IPv4 only (-o dns_order=4)
    -6               IPv6 only (-o dns_order=6)
    -no-mouse        don't use mouse
    -cookie          use cookie (-no-cookie: don't use cookie)
    -graph           use DEC special graphics for border of table and menu
    -no-graph        use ASCII character for border of table and menu
    -s               squeeze multiple blank lines
    -W               toggle search wrap mode
    -X               don't use termcap init/deinit
    -title[=TERM]    set buffer name to terminal title string
    -o opt=value     assign value to config option
    -show-option     print all config options
    -config file     specify config file
    -help            print this usage message
    -version         print w3m version
    -reqlog          write request logfile
    -debug           DO NOT USE

4.w3m起動
通常は、w3mコマンドにurlを渡して起動します。
$ w3m google.co.jp

ブックマークを設定している場合、オプション「-B」を渡します。
$ w3m -B

5.設定方法
・表示色
「アンカーの色」を「黄」に変更。
→背景色を暗くしてある場合、青のままでは見にくいから。

・雑多な設定
「マウスを使う」を「NO」に変更。
→マウスを使って文字列のコピーができるようになる。

・文字コードの設定
「ある種のUnicode文字を全角にする」を「YES」に変更。
→罫線などの文字化け対策

Ubuntu 21.10

Posted by arkgame