Notebook

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

HTML ファイル生成日時: 2025/06/19 08:39:27.157 (台灣標準時)

仮想マシンで 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. Computer___Python/20220518_0.html
  2. Computer___Network/20230726_00.html
  3. Misc___Taiwan/20240207_00.html
  4. Computer___Network/20230516_00.html
  5. Computer___FreeBSD/20220621_0.html
  6. Computer___Network/20240130_00.html
  7. Computer___Network/20230508_00.html
  8. Computer___Python/20220715_0.html
  9. Computer___TeX/20231107_00.html
  10. Computer___NetBSD/20230119_00.html
  11. Food___Taiwan/20220429_0.html
  12. Computer___Network/20240416_00.html
  13. Computer___Network/20220413_1.html
  14. Computer___Python/20220410_0.html
  15. Misc___Japan/20240610_00.html
  16. Computer___Python/20221013_0.html
  17. Computer___TeX/20230726_01.html
  18. Computer___Python/20240101_00.html
  19. Computer___NetBSD/20220817_3.html
  20. Computer___Debian/20210223_1.html
  21. Computer___NetBSD/20220818_1.html
  22. Computer___NetBSD/20240101_02.html
  23. Computer___Python/20210124_0.html
  24. Computer___NetBSD/20220428_0.html
  25. Misc___Taiwan/20240819_00.html
  26. Science___Math/20220420_0.html
  27. Computer___TeX/20240414_00.html
  28. Computer___TeX/20230503_00.html
  29. Computer___NetBSD/20240101_03.html
  30. Science___Astronomy/20220503_0.html


HTML file generated by Kinoshita Daisuke.