CUIにこだわるべきか
CUI至上主義者ではないが、CUIで可能な事をGUIでやる必要はないと思う。
エクセルでも慣れてしまえば、マウスを使うより、ショートカットキーの方が早い。ましてやテキストエディターで何故マウスが必要なのか?
GUIのメリットは、ユーザーインタフェースを説明的に作りこむ事で直感的な操作が可能になる事。それでも日常的に使うアプリならば、GUIは必要ない。なにより、GUIはコストが高い。魅力的なビジュアルは営業的には意味があるかもしれないが、本来のロジックよりもリソースを喰うUIに魅力はない。
今、Xありきで、X絡みのドライバなしでアプリケーションをインストールするのは、逆に難しい。pkgを使っての導入は不可能に近いので、portからインストールしてみようと思う。
対象は111Cのクローンで111C-NOX11。
リポジトリを取得できなかったので、/etc/unbound/forwad.conf を修正して、dnsをgoogleのものに変更。
freebsd-update fetchで始まる一連のおまじない。今回pkg upgrade もやっておく。
cd /usr/ports/japanese/uim-mozc
make install
... ただただ時間がかかる。
uim, jfbterm
8年前の記事 ...
'~/.uim' を作成して、以下を記述。
;; toggle input method key configuration (define-key generic-on-key? '("<Control>\\" "<Alt>zenkaku-hankaku" "zenkaku-hankaku" "Henkan_
Mode" "<Shift> ")) (define-key generic-off-key? '("<Control>\\" "<Alt>zenkaku-hankaku" "zenkaku-hankaku" "Henkan_ Mode" "<Shift> "))
uim-fepを実行。画面左下にmozc[Mz- RM]が表示されるまで待つ。
これだけで、一応コンソールから日本語入力が可能になった。
デフォルトのコンソールが多言語対応のvtになっているので、jfbtermをインストールする必要はない。
FBSD111C-EMACSを作成
FBSD111Cの新しいクローンとしてFBSD111C-EMACSを作成。
なるべくシンプルで軽いEmacs環境を作れないか?
mozc-uim,emax-nox11,uim.elを試してみたい。
Uim を使って日本語を入力 - ArchWiki を参考にする。
mozcとemacsをセットでインストールするから、見通しが悪くなる。欲しくもないX関連のモジュールがインストールされてしまう。なるべくXを使わないシンプルなEmacsをインストールして、emacs.elで日本語入力が使えるならそれに越した事はない。
uimに関しても、枯れた入力システムでサポートは続いており、目的に合っているだろう。
- /etc/.rc.confを編集してhost名を変更
- 念のため、pkg update と portsnap fetch update, freebsd-update fetch, 同 installを実行 → そこそこ変更はあるよう。
-
# pkg install ja-uim-mozc
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Updating database digests format: 100%
New version of pkg detected; it needs to be installed first.
The following 1 package(s) will be affected (of 0 checked):Installed packages to be UPGRADED:
pkg: 1.10.3_1 -> 1.10.5Number of packages to be upgraded: 1
3 MiB to be downloaded.
New packages to be INSTALLED:
ja-uim-mozc: 2.20.2677.102.02_8
uim: 1.8.6_3
pango: 1.42.0
libXrender: 0.9.10
xproto: 7.0.31
renderproto: 0.11.1
libX11: 1.6.5,1
libxcb: 1.12_2
libXdmcp: 1.1.2
libXau: 1.0.8_3
libxml2: 2.9.7
libpthread-stubs: 0.4
kbproto: 1.0.7
xorg-fonts-truetype: 7.7_1
font-misc-meltho: 1.0.3_3
mkfontscale: 1.1.2
libfontenc: 1.1.3_1
freetype2: 2.8_1
mkfontdir: 1.0.7
fontconfig: 2.12.1_3,1
expat: 2.2.5
font-misc-ethiopic: 1.0.3_3
font-bh-ttf: 1.0.3_3
encodings: 1.0.4_4,1
font-util: 1.3.1
dejavu: 2.37
libXft: 2.3.2_1
harfbuzz: 1.7.6
graphite2: 1.3.11
cairo: 1.14.8_1,2
xcb-util-renderutil: 0.3.9_1
xcb-util: 0.4.0_2,1
pixman: 0.34.0
libXext: 1.3.3_1,1
xextproto: 7.3.0
glproto: 1.4.17
dri2proto: 2.8
png: 1.6.34
mesa-libs: 17.3.1
libxshmfence: 1.2_2
libXxf86vm: 1.1.4_1
xf86vidmodeproto: 2.3.1
libXfixes: 5.0.3
fixesproto: 5.0
libXdamage: 1.1.4_3
damageproto: 1.2.1
libdrm: 2.4.89,1
libpciaccess: 0.13.5
pciids: 20180219
libunwind: 20170615
glib: 2.50.3_1,1
python27: 2.7.14_1
readline: 7.0.3_1
indexinfo: 0.3.1
libffi: 3.2.1_2
gettext-runtime: 0.19.8.1_1
gmp: 6.1.2
libiconv: 1.14_11
perl5: 5.26.1
pcre: 8.40_1
libedit: 3.1.20170329_2,1
fribidi: 0.19.7
gtk2: 2.24.32
libXrandr: 1.5.1
randrproto: 1.5.0
libXinerama: 1.1.3_3,1
xineramaproto: 1.2.1
libXi: 1.7.9,1
inputproto: 2.3.2
libXcursor: 1.1.15
libXcomposite: 0.4.4_3,1
compositeproto: 0.4.2
cups: 2.2.6
gnutls: 3.5.18
trousers: 0.3.14_2
tpm-emulator: 0.7.4_2
p11-kit: 0.23.10
libtasn1: 4.13
ca_root_nss: 3.36
nettle: 3.4
libidn2: 2.0.4
libunistring: 0.9.9
libpaper: 1.1.24.4
avahi-app: 0.6.31_6
gnome_subr: 1.0
libdaemon: 0.14_1
gobject-introspection: 1.50.0_1,1
dbus-glib: 0.108
dbus: 1.10.16_1
libSM: 1.2.2_3,1
libICE: 1.0.9_1,1
gdbm: 1.13_1
shared-mime-info: 1.8
hicolor-icon-theme: 0.15
gtk-update-icon-cache: 2.24.32
gdk-pixbuf2: 2.36.11
libXt: 1.1.5,1
tiff: 4.0.9_1
jpeg-turbo: 1.5.3
jbigkit: 2.1_1
jasper: 1.900.1_17
atk: 2.24.0
ja-zinnia: 0.06_1
ja-mozc-tool: 2.20.2677.102.02_8
qt5-widgets: 5.9.4_1
qt5-gui: 5.9.4_3
xcb-util-wm: 0.4.1_3
xcb-util-keysyms: 0.4.0_1
xcb-util-image: 0.4.0_1
libxkbcommon: 0.7.1_1
qt5-network: 5.9.4_2
qtchooser: 39
qt5-core: 5.9.4_1
pcre2: 10.21_1
icu: 60.2_2,1
xdg-utils: 1.1.1
xset: 1.2.3_1
libXmu: 1.1.2_3,1
libXfontcache: 1.0.5_3
fontcacheproto: 0.1.3
xprop: 1.2.2
qt5-dbus: 5.9.4_1
ja-tegaki-zinnia-japanese: 0.3
qt5-buildtools: 5.9.4_1
protobuf: 3.5.1.1
ja-mozc-server: 2.20.2677.102.02_8Number of packages to be installed: 126
The process will require 456 MiB more space.
108 MiB to be downloaded.なかなかシンプルにというわけにはいかない。
Message from freetype2-2.8_1:
The 2.7.x series now uses the new subpixel hinting mode (V40 port's option) as
the default, emulating a modern version of ClearType. This change inevitably
leads to different rendering results, and you might change port's options to
adapt it to your taste (or use the new "FREETYPE_PROPERTIES" environment
variable).The environment variable "FREETYPE_PROPERTIES" can be used to control the
driver properties. Example:FREETYPE_PROPERTIES=truetype:interpreter-version=35 \
cff:no-stem-darkening=1 \
autofitter:warping=1This allows to select, say, the subpixel hinting mode at runtime for a given
application.The controllable properties are listed in the section "Controlling FreeType
Modules" in the reference's table of contents
(/usr/local/share/doc/freetype2/reference/ft2-toc.html, if documentation was installed).
Message from python27-2.7.14_1:===========================================================================
Note that some standard Python modules are provided as separate ports
as they require additional dependencies. They are available as:bsddb databases/py-bsddb
gdbm databases/py-gdbm
sqlite3 databases/py-sqlite3
tkinter x11-toolkits/py-tkinter===========================================================================
Message from perl5-5.26.1:The /usr/bin/perl symlink has been removed starting with Perl 5.20.
For shebangs, you should either use:#!/usr/local/bin/perl
or
#!/usr/bin/env perl
The first one will only work if you have a /usr/local/bin/perl,
the second will work as long as perl is in PATH.
Message from dejavu-2.37:Make sure that the freetype module is loaded. If it is not, add the following
line to the "Modules" section of your X Windows configuration file:Load "freetype"
Add the following line to the "Files" section of X Windows configuration file:
FontPath "/usr/local/share/fonts/dejavu/"
Note: your X Windows configuration file is typically /etc/X11/XF86Config
if you are using XFree86, and /etc/X11/xorg.conf if you are using X.Org.
Message from ca_root_nss-3.36:********************************* WARNING *********************************
FreeBSD does not, and can not warrant that the certification authorities
whose certificates are included in this package have in any way been
audited for trustworthiness or RFC 3647 compliance.Assessment and verification of trust is the complete responsibility of the
system administrator.*********************************** NOTE **********************************
This package installs symlinks to support root certificates discovery by
default for software that uses OpenSSL.This enables SSL Certificate Verification by client software without manual
intervention.If you prefer to do this manually, replace the following symlinks with
either an empty file or your site-local certificate bundle.* /etc/ssl/cert.pem
* /usr/local/etc/ssl/cert.pem
* /usr/local/openssl/cert.pem***************************************************************************
Message from qtchooser-39:qtchooser is a wrapper that allows selecting whether Qt4 or Qt5 binaries for
qmake, moc and other tools will be run when invoking the binaries in $PATH.By default, the Qt5 versions are run. It is possible to change the behavior by
setting the QT_SELECT environment variable to "qt4". See qtchooser(1) for more
information.
Message from trousers-0.3.14_2:To run tcsd automatically, add the following line to /etc/rc.conf:
tcsd_enable="YES"
You might want to edit /usr/local/etc/tcsd.conf to reflect your setup.
If you want to use tcsd with software TPM emulator, use the following
configuration in /etc/rc.conf:tcsd_enable="YES"
tcsd_mode="emulator"
tpmd_enable="YES"To use TPM, add your_account to '_tss' group like following:
# pw groupmod _tss -m your_account
Message from ja-uim-mozc-2.20.2677.102.02_8:To activate uim-mozc, please add the following into ~/.xinitrc,
~/.xsession, or ~/.kde4/env (for KDE4):export GTK_IM_MODULE=uim
export QT_IM_MODULE=uim
export XMODIFIERS=@im=uim
export XIM=uim
/usr/local/bin/mozc start
uim-xim &状況が似ているので、親近感を覚えた
今更だが、anthyの開発はDebianが引き継いだようなので、ja-uim-anthyでもいいのでは?) - コンソールで日本語入力を可能にしたいのだが、どうすれば?
とりあえずrebootして、mozcと入力すると、
% mozc
/usr/local/bin/mozc [start|stop|restart|forcestart|forcestop|status]su しなくても、mozcのsatat/stopはできる。
mozcが起動していれば、statusで番号を返し、停止していれば何も返さない。
uimをコンソールに反映させる為にはどうすればいいのか?FreeBSD のコンソールで漢字の読み書き:ある nakagami の日記:So-netブログ
以下はRloginでの確認。
リンクはuim-anthyの設定例。
コンソールのプロンプトから'uim-fep'と入力するとコンソール左下に’mozc[mz- RM]’が表示される。('CTRL-J'でFEPのオンオフはできない。)
suしてexitしたら’mozc[mz- RM]’は消えた。(再現性はない。消える時もあれば、消えない時もある。)
mozc stopしてから、uim-fepを入力すると、mozcも立ち上がる。
’mozc[mz- RM]’の表示がある間は、mozc stopとしても、mozcは停止しない。mozc forcestopとしてもダメ。
まずは uimについて、しばらく腰を落ち着けて調べてみる。
mozc の起動時不調
Emacsでのmozcが不調なのは、w3mのインストールで、その分起動に時間がかかっていたのが、原因だったっぽい。
現在の~/.emacs.d/init.elの内容
% cat ~/.emacs.d/init.el
;;mozc
; 言語を日本語にする;; Added by Package.el. This must come before configurations of
;; installed packages. Don't delete this line. If you don't want it,
;; just comment it out by adding a semicolon to the start of the line.
;; You may delete these explanatory comments.
(package-initialize)(set-language-environment "Japanese")
; 極力UTF-8とする
(prefer-coding-system 'utf-8)
(setq default-input-method "japanese-mozc")
(global-set-key (kbd "C-o") 'toggle-input-method)
rootに日本語は必ずしも必要ないかもしれないと思い始めている。
mozc と w3m
特に便利だとも思わないのだが、sudoをインストール
# pkg install sudo-1.8.21p2_1
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 1 package(s) will be affected (of 0 checked):New packages to be INSTALLED:
sudo: 1.8.21p2_1Number of packages to be installed: 1
The process will require 4 MiB more space.
885 KiB to be downloaded.Proceed with this action? [y/N]: y
[1/1] Fetching sudo-1.8.21p2_1.txz: 100% 885 KiB 453.0kB/s 00:02
Checking integrity... done (0 conflicting)
[1/1] Installing sudo-1.8.21p2_1...
Extracting sudo-1.8.21p2_1: 100%
% sudo ls -l
あなたはシステム管理者から通常の講習を受けたはずです。
これは通常、以下の3点に要約されます:#1) 他人のプライバシーを尊重すること。
#2) タイプする前に考えること。
#3) 大いなる力には大いなる責任が伴うこと。パスワード:
muh は sudoers ファイル内にありません。この事象は記録・報告されます。
... ちょっとウザい。visudoの使い方も良く判らない。セキュリティ上はどうか判らないが、今のところはsuでいい。
それはそうと、たぶん、w3m-emacs は問題なく動いている。
もっとも、w3mは今のネット世界では古さは否めない。それでもプライベートな世界では使えなくはない。このブログとw3mの相性は読むだけなら悪くなくて、chromeで読むより、ストレスがないかもしれない。
さて、w3mの使い道はあるのだけれど、mozcが使えないのは困る。何が衝突しているのかも良く判らない。しかし、完全にmozcが死んでいるわけではない。
C-\だとダメだが、C-oだといけるのか?
元々、mozcは少し不安定なところがある。
mozcの読み込みやセットアップに時間が掛かっているだけなのか?
日本語入力システムそのものを見直した方がいいのか?
w3m-emacsをインストールするなら、w3mをインストールする必要はない。
とりあえずが多いが、騙し騙しなら使えなくもない。
shellからの入力についてはuim-mozc周辺を調べてみる。
uim.elってのもある。
半歩だけでも進んだかというと、半歩くらいは進んだが、覚えるよりも忘れるのが早い。あまり進み過ぎないようにした方がいいのかもしれない。まぁゆっくり行こう。
Emacsをちょっとだけ調べる
深入りすると抜け出せなくなるので、ちょっとだけ。
とりあえず、freebsdで、emacsのsite-lispなんかがあるディレクトリは、
/usr/local/share/emacs
ちょっと判りにくいところにある。
実行ファイルとしてのemacsがあるのは
/usr/local/bin
% ls -l emacs*
lrwxr-xr-x 1 root wheel 10 3月 24 10:39 emacs -> emacs-25.3
-rwxr-xr-x 1 root wheel 9705356 3月 24 10:39 emacs-25.3
-r-xr-xr-x 1 root wheel 23128 3月 24 10:39 emacsclient