Notebook

これは日々の作業を通して学んだことや毎日の生活で気づいたことをを記録しておく備忘録である。

HTML ファイル生成日時: 2025/07/30 08:17:51.269 (台灣標準時)

仮想マシンで fvwm を使う

ウィンドウマネージャーはいろいろあるでござるが、 fvwm を愛用しているでござる。四半世 紀以上 fvwm を使っているでござる。何が良いかと言うと、仮想画面がタイル 状に並んでいて、上下左右に移動でき、探しているウィンドウを見つけやすい ことでござる。「ctrl + 矢印」で、上下左右に仮想画面を移動できるように なっているでござる。ところが、仮想マシンを VNC で使うようになってから、 不便に感じることがあったでござる。それは、 VNC で使っている仮想マシン では、「ctrl + 矢印」で仮想画面を切り替えられないことでござる。物理ハー ドウェアで動いている fvwm が「ctrl + 矢印」のキーを受け取ってしまい、 VNC で使っている仮想マシンの fvwm が仮想画面を切り替えてくれないのでご ざる。どうしたものかと思っていたのでござるが、ふと思いついたでござる。 物理ハードウェアで動いている fvwm では「ctrl + 矢印」で仮想画面を切り 替えるようにし、仮想マシンで動いている fvwm では「ctrl + shift + 矢印」 で仮想画面を切り替えるようにすれば、よさそうでござる。実際に試してみる と、期待通りに動作してくれたでござる。しかし、計算機ごとに ~/.fvwm/config を書き換えるのは面倒でござる。二種類のファイ ルを用意しておき、物理ハードウェアで動作しているのか、仮想マシンで動作 しているのかによって、 fvwm3 を実行するときに、読み込む設定ファイルを 指定できれば便利でござる。そのようなことができるのか、調べてみたでござ る。 man fvwm3 を実行してみたでござる。 -f オプ ションを使えばよいようでござる。

man fvwm3
fig_202506/man_fvwm3_00.png
man fvwm3
fig_202506/man_fvwm3_01.png

そこで、二つの 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 &



Frequently accessed files

  1. Misc___Taiwan/20240819_00.html
  2. Computer___TeX/20231107_00.html
  3. Computer___NetBSD/20240805_03.html
  4. Computer___NetBSD/20250728_00.html
  5. Computer___TeX/20240410_00.html
  6. Misc___Taiwan/20250728_01.html
  7. Computer___Network/20230516_00.html
  8. Misc___Taiwan/20240207_00.html
  9. Misc___Taiwan/20240903_01.html
  10. Computer___NetBSD/20250409_00.html
  11. Computer___NetBSD/20241102_00.html
  12. Computer___Network/20230726_00.html
  13. Computer___NetBSD/20230119_00.html
  14. Computer___NetBSD/20250301_01.html
  15. Computer___TeX/20240414_01.html
  16. Computer___Python/20231008_00.html
  17. Food___Taiwan/20230609_12.html
  18. Computer___Hardware/20240820_00.html
  19. Computer___Python/20250330_00.html
  20. Computer___NetBSD/20240719_00.html
  21. Misc___Japan/20240610_00.html
  22. Computer___Network/20220817_6.html
  23. Computer___NetBSD/20250113_00.html
  24. Computer___Network/20241214_00.html
  25. Food___Taiwan/20220812_5.html
  26. Computer___TeX/20241108_00.html
  27. Misc___Taiwan/20250125_00.html
  28. Computer___Network/20210205_0.html
  29. Computer___Network/20240130_00.html
  30. Computer___TeX/20240411_00.html


HTML file generated by Kinoshita Daisuke.