これは日々の作業を通して学んだことや毎日の生活で気づいたことをを記録しておく備忘録である。
HTML ファイル生成日時: 2025/06/19 08:39:27.157 (台灣標準時)
ウィンドウマネージャーはいろいろあるでござるが、 fvwm を愛用しているでござる。四半世 紀以上 fvwm を使っているでござる。何が良いかと言うと、仮想画面がタイル 状に並んでいて、上下左右に移動でき、探しているウィンドウを見つけやすい ことでござる。「ctrl + 矢印」で、上下左右に仮想画面を移動できるように なっているでござる。ところが、仮想マシンを VNC で使うようになってから、 不便に感じることがあったでござる。それは、 VNC で使っている仮想マシン では、「ctrl + 矢印」で仮想画面を切り替えられないことでござる。物理ハー ドウェアで動いている fvwm が「ctrl + 矢印」のキーを受け取ってしまい、 VNC で使っている仮想マシンの fvwm が仮想画面を切り替えてくれないのでご ざる。どうしたものかと思っていたのでござるが、ふと思いついたでござる。 物理ハードウェアで動いている fvwm では「ctrl + 矢印」で仮想画面を切り 替えるようにし、仮想マシンで動いている fvwm では「ctrl + shift + 矢印」 で仮想画面を切り替えるようにすれば、よさそうでござる。実際に試してみる と、期待通りに動作してくれたでござる。しかし、計算機ごとに ~/.fvwm/config を書き換えるのは面倒でござる。二種類のファイ ルを用意しておき、物理ハードウェアで動作しているのか、仮想マシンで動作 しているのかによって、 fvwm3 を実行するときに、読み込む設定ファイルを 指定できれば便利でござる。そのようなことができるのか、調べてみたでござ る。 man fvwm3 を実行してみたでござる。 -f オプ ションを使えばよいようでござる。
man fvwm3 |
---|
![]() |
man fvwm3 |
![]() |
そこで、二つの config ファイルを用意したでござる。仮想画面の切り替えに ついて、一つは以下のようにしたでござる。「ctrl + shift + 矢印」を無効 にしたでござる。
########################################################################### # # Keyboard # # press arrow + control anywhere, and scroll by 1 page Key Left A C Scroll -100 +0 Key Right A C Scroll +100 +0 Key Up A C Scroll +0 -100 Key Down A C Scroll +0 +100 # press arrow + meta key, and scroll by 1/10 of a page Key Left A M Scroll -10 +0 Key Right A M Scroll +10 +0 Key Up A M Scroll +0 -10 Key Down A M Scroll +0 +10 # press shift arrow + control anywhere, and move the pointer by 1% of a page #Key Left A SC CursorMove -1 +0 #Key Right A SC CursorMove +1 +0 #Key Up A SC CursorMove +0 -1 #Key Down A SC CursorMove +0 +1 # press shift arrow + meta key, and move the pointer by 1/10 of a page Key Left A SM CursorMove -10 +0 Key Right A SM CursorMove +10 +0 Key Up A SM CursorMove +0 -10 Key Down A SM CursorMove +0 +10 ###########################################################################
もう一つの config ファイルは以下のようにしたでござる。「ctrl + 矢印」 を無効にしたでござる。
########################################################################### # # Keyboard # # press arrow + control anywhere, and scroll by 1 page #Key Left A C Scroll -100 +0 #Key Right A C Scroll +100 +0 #Key Up A C Scroll +0 -100 #Key Down A C Scroll +0 +100 Key Left A SC Scroll -100 +0 Key Right A SC Scroll +100 +0 Key Up A SC Scroll +0 -100 Key Down A SC Scroll +0 +100 # press arrow + meta key, and scroll by 1/10 of a page Key Left A M Scroll -10 +0 Key Right A M Scroll +10 +0 Key Up A M Scroll +0 -10 Key Down A M Scroll +0 +10 # press shift arrow + control anywhere, and move the pointer by 1% of a page #Key Left A SC CursorMove -1 +0 #Key Right A SC CursorMove +1 +0 #Key Up A SC CursorMove +0 -1 #Key Down A SC CursorMove +0 +1 # press shift arrow + meta key, and move the pointer by 1/10 of a page Key Left A SM CursorMove -10 +0 Key Right A SM CursorMove +10 +0 Key Up A SM CursorMove +0 -10 Key Down A SM CursorMove +0 +10 ###########################################################################
そして、物理ハードウェアで fvwm を使う場合には、 ~/.xinitrc に以下のように記述したでござる。
exec fvwm3 -f ~/.fvwm/config.physical
仮想マシンを VNC で使う場合には、 ~/.config/tigervnc/xstartup に以下のように記述したでござる。
fvwm3 -f ~/.fvwm/config.virtual &