История изменений
Исправление Evgueni, (текущая версия) :
Мой fwvm представляет из себя просто пустой экран с одной немного нестандартной конструкцией (утащил идею у Кнута), которую можно увидеть тут: auctex forward search Это просто список виртуальных экранов, часы и загрузка в одном флаконе. На картинке конструкция находилась на левом мониторе в верхнем углу (посередине снимка). В том или ином виде эта конструкция у меня уже много лет и сейчас она находится всегда на правом мониторе в верхнем углу. Число рабочих виртуальных экранов возникло экспериментальным путём, но тогда у меня был только один монитор. С двумя мониторами в принципе достаточно 4ёх.
Код:
*FvwmButtonsRows 5
*FvwmButtonsColumns 10
*FvwmButtonsGeometry 165x84+2782+0 # 2960-165
*FvwmButtonsBoxSize fixed
*FvwmButtonsFont None
*FvwmButtonsBack Orange
*FvwmButtonsPadding 0 0
*FvwmButtons(4x4+6+0, Swallow(UseOld,Respawn) ASClock "Exec LANG=C asclock -theme /usr/share/asclock/penguin/")
*FvwmButtons(10x1+0+4, Swallow(UseOld,Respawn) \
XLoad "Exec xload -nolabel -geometry 165x12+0+0 -bg dimgrey -fg white -update 1")
#метки на Pager'е
*FvwmPager: Label 0 "1"
*FvwmPager: Label 1 "2"
*FvwmPager: Label 2 "3"
*FvwmPager: Label 3 "4"
*FvwmPager: Label 4 "5"
*FvwmPager: Label 5 "6"
*FvwmPager: Columns 3
*FvwmPager: Rows 2
*FvwmButtons: (6x4+0+0,Swallow "FvwmPager" "FvwmPager 0 5")
Переключалка для виртуальных экранов Alt+{1,2,3,4,5,6}:
Key 1 A M GotoDesk 0 0
Key 2 A M GotoDesk 0 1
Key 3 A M GotoDesk 0 2
Key 4 A M GotoDesk 0 3
Key 5 A M GotoDesk 0 4
Key 6 A M GotoDesk 0 5
Переключение между окнами с клавиатуры (де факто использую только Alt+TAB, так что полезна только первая строчка)
Key Tab A M WindowList Root c c \
CurrentDesk, NoGeometry, CurrentAtEnd, IconifiedAtEnd
Key Super_L A A WindowList
Key Super_R A A Menu Window-Ops Nop
Key Menu A A Menu Root-Menu Nop
Обрамление окон у меня можно посмотреть тут: TeXmacs и FriCAS Тоже утащил у Кнута и лень было менять
# I'm putting three buttons in the titlebars of ordinary windows.
# At the left (which Fvwm calls button 1), a lightning bolt;
# this will close the program when touched with any mouse click.
# (It does NOT pop up a menu. Closing is better than Deleting and Destroying:
# it tries to delete gracefully, then destroys if the window is uncooperative.)
Mouse 0 1 A Close
ButtonStyle 1 Vector 7 \
65x15@0 25x55@1 45x55@0 35x85@1 75x45@0 55x45@1 65x15@0
ButtonStyle 1 - MWMDecorMenu
# At the right, a button that iconifies the window; we draw a small square
# (because I tried to draw an X but it looked horrible):
Mouse 0 2 A Iconify
#ButtonStyle 2 Vector 17 \
# 20x20@1 30x20@1 50x40@1 70x20@1 80x20@1 80x30@0 60x50@0 80x70@1 \
# 80x80@0 70x80@0 50x60@0 30x80@0 20x80@0 20x70@0 40x50@1 20x30@0 20x20@1
ButtonStyle 2 Vector 5 40x40@1 60x40@1 60x60@0 40x60@0 40x40@1
ButtonStyle 2 - MWMDecorMin
# Next to that, a button with a big square; this one maximizes the window.
# (More precisely, if you double-click, the window goes to full screen size;
# if you single-click, it goes to full height but keeps its width.
# But if the window was already in "maximized" state, it goes back to normal.
# If you try to drag this button, it unconditionally goes to full width.)
Mouse 0 4 A Maximize-Function
ButtonStyle 4 Vector 5 20x20@1 80x20@1 80x80@0 20x80@0 20x20@1
AddtoFunc Maximize-Function "D" Maximize 100 100
+ "C" Maximize 0 100
+ "M" Function Go-Max
AddtoFunc Go-Max "I" Current (Maximized) Maximize
+ "I" Maximize 100 100
ButtonStyle 4 - MWMDecorMax
Реакция окон на мышь (при наведении на окно автоматически поднимается над другими окнами без необходимости его кликать):
Module FvwmAuto 1000 Raise Nop
Style * FocusFollowsMouse
Реакция на клики на пустом экране (взял у Кнута не переделывая):
# Now for mouse commands in the root window R:
# Left mouse button brings up Root-Menu; middle button brings up Window-Ops
# Clicking instead of dragging makes the menu stay up; cursor is <== then.
# Double-clicking takes the menu away.
# Here "A" means an arbitrary combination of shift/meta/control/numlock etc.
Mouse 3 R A Menu Root-Menu Nop
Mouse 2 R A Menu Window-Ops Nop
# Right button gives window list. Caution: Double clicking gets you a sort of
# random window, because double-click control comes only with a Menu spec!
Mouse 1 R A WindowList
Стандартное меню заполняется под свои задачи. Для меня самое главное, чтобы вверху был вызов терминала и emacs, то есть что-то вроде:
AddtoMenu Root-Menu "xterm" Exec exec gnome-terminal
+ "Emacs " Exec exec emacs -geometry 100x48+0+0 -fn 10x20
ну и так далее
Меню с действиями на окнах (средняя кнопка):
AddToMenu Window-Ops "Window Operations" Title
+ "Move" Move
+ "Resize" Resize
+ "Raise" Raise
+ "Lower" Lower
+ "Iconify/DeIconify" Iconify
+ "Stick/UnStick" Stick
+ "Maximize/Normalize" Maximize
#+ "Refresh" RefreshWindow
+ "" Nop
+ "Delete" Delete
+ "Close" Close
+ "Destroy" Destroy
Реакция на клик мыши на обрамлении окна, для его переносамежду виртуальными экранами. Stick — окно есть на всех виртаульных экранах, Unstick — окно есть только на текущем экране
# Middle mouse Stick or UnStick
Mouse 2 FTSI A Stick
Добавил реакцию на клик мыши по обрамлению окон для постоянного выведения их на передний план (иногда для некоторых окон это необходимо)
# Right mouse raises window Layer.
AddToFunc layer-raise
+ I Layer 1
+ I Raise
Mouse 3 FTSI N layer-raise
# Right mouse + Shift/control/Meta puts window to default layer.
AddToFunc layer-default
+ I Layer
+ I Raise
Mouse 3 FTSI S layer-default
Mouse 3 FTSI C layer-default
Mouse 3 FTSI M layer-default
При запуск fvwm часть программ стартует вместе с ним. В частности открывается пара терминалов на 2ом и 3-ем виртуальных экранах и emacs на основном:
AddToFunc InitFunction "I" Echo initializing...
+ "I" Function Basic-Setup
+ "I" Desk 0 1
+ "I" Exec exec gnome-terminal -t "удалённый ПК" -e "ssh удалённый@адрес"
+ "I" Wait gnome-terminal
+ "I" Desk 0 2
+ "I" Exec exec gnome-terminal
+ "I" Wait gnome-terminal
+ "I" Desk 0 0
+ "I" Exec exec xplanet -longitude 82 -latitude 55
+ "I" Exec exec ssh удалённый@адрес bash --login -c "\"/usr/bin/emacs -fn 10x20 -geometry 100x52+420+0\""
+ "I" Exec exec xscreensaver -no-splash
#emacs -geometry 82x56+0+0
#+ "I" Wait emacs
#+ "I" Exec exec xeyes -geometry 55x50+1050+12 -fg DarkGreen -center dimgrey -outline \#000060
#+ "I" Wait xeyes
+ "I" Exec exec setxkbmap -layout "us,ru(winkeys)" -option "grp:caps_toggle,grp_led:scroll,grp:switch"
+ "I" Exec exec xxkb
Собственно говоря, всё.
Исходная версия Evgueni, :
Мой fwvm представляет из себя просто пустой экран с одной «висюличкой» (утащил идею у Кнута), которую можно увидеть тут: auctex forward search Это просто список виртуальных экранов, часы и загрузка в одном флаконе. На картинке она находилась на левом мониторе в верхнем углу. В том или ином виде эта конструкция у меня уже много лет и сейчас она находится всегда на правом мониторе в верхнем углу. Число рабочих виртуальных экранов возникло экспериментальным путём, но тогда у меня был только один монитор. С двумя мониторами в принципе достаточно 4ёх.
Код:
*FvwmButtonsRows 5
*FvwmButtonsColumns 10
*FvwmButtonsGeometry 165x84+2782+0 # 2960-165
*FvwmButtonsBoxSize fixed
*FvwmButtonsFont None
*FvwmButtonsBack Orange
*FvwmButtonsPadding 0 0
*FvwmButtons(4x4+6+0, Swallow(UseOld,Respawn) ASClock "Exec LANG=C asclock -theme /usr/share/asclock/penguin/")
*FvwmButtons(10x1+0+4, Swallow(UseOld,Respawn) \
XLoad "Exec xload -nolabel -geometry 165x12+0+0 -bg dimgrey -fg white -update 1")
#метки на Pager'е
*FvwmPager: Label 0 "1"
*FvwmPager: Label 1 "2"
*FvwmPager: Label 2 "3"
*FvwmPager: Label 3 "4"
*FvwmPager: Label 4 "5"
*FvwmPager: Label 5 "6"
*FvwmPager: Columns 3
*FvwmPager: Rows 2
*FvwmButtons: (6x4+0+0,Swallow "FvwmPager" "FvwmPager 0 5")
Переключалка для виртуальных экранов Alt+{1,2,3,4,5,6}:
Key 1 A M GotoDesk 0 0
Key 2 A M GotoDesk 0 1
Key 3 A M GotoDesk 0 2
Key 4 A M GotoDesk 0 3
Key 5 A M GotoDesk 0 4
Key 6 A M GotoDesk 0 5
Переключение между окнами с клавиатуры (де факто использую только Alt+TAB, так что полезна только первая строчка)
Key Tab A M WindowList Root c c \
CurrentDesk, NoGeometry, CurrentAtEnd, IconifiedAtEnd
Key Super_L A A WindowList
Key Super_R A A Menu Window-Ops Nop
Key Menu A A Menu Root-Menu Nop
Обрамление окон у меня можно посмотреть тут: TeXmacs и FriCAS Тоже утащил у Кнута и лень было менять
# I'm putting three buttons in the titlebars of ordinary windows.
# At the left (which Fvwm calls button 1), a lightning bolt;
# this will close the program when touched with any mouse click.
# (It does NOT pop up a menu. Closing is better than Deleting and Destroying:
# it tries to delete gracefully, then destroys if the window is uncooperative.)
Mouse 0 1 A Close
ButtonStyle 1 Vector 7 \
65x15@0 25x55@1 45x55@0 35x85@1 75x45@0 55x45@1 65x15@0
ButtonStyle 1 - MWMDecorMenu
# At the right, a button that iconifies the window; we draw a small square
# (because I tried to draw an X but it looked horrible):
Mouse 0 2 A Iconify
#ButtonStyle 2 Vector 17 \
# 20x20@1 30x20@1 50x40@1 70x20@1 80x20@1 80x30@0 60x50@0 80x70@1 \
# 80x80@0 70x80@0 50x60@0 30x80@0 20x80@0 20x70@0 40x50@1 20x30@0 20x20@1
ButtonStyle 2 Vector 5 40x40@1 60x40@1 60x60@0 40x60@0 40x40@1
ButtonStyle 2 - MWMDecorMin
# Next to that, a button with a big square; this one maximizes the window.
# (More precisely, if you double-click, the window goes to full screen size;
# if you single-click, it goes to full height but keeps its width.
# But if the window was already in "maximized" state, it goes back to normal.
# If you try to drag this button, it unconditionally goes to full width.)
Mouse 0 4 A Maximize-Function
ButtonStyle 4 Vector 5 20x20@1 80x20@1 80x80@0 20x80@0 20x20@1
AddtoFunc Maximize-Function "D" Maximize 100 100
+ "C" Maximize 0 100
+ "M" Function Go-Max
AddtoFunc Go-Max "I" Current (Maximized) Maximize
+ "I" Maximize 100 100
ButtonStyle 4 - MWMDecorMax
Реакция окон на мышь (при наведении на окно автоматически поднимается над другими окнами без необходимости его кликать):
Module FvwmAuto 1000 Raise Nop
Style * FocusFollowsMouse
Реакция на клики на пустом экране (взял у Кнута не переделывая):
# Now for mouse commands in the root window R:
# Left mouse button brings up Root-Menu; middle button brings up Window-Ops
# Clicking instead of dragging makes the menu stay up; cursor is <== then.
# Double-clicking takes the menu away.
# Here "A" means an arbitrary combination of shift/meta/control/numlock etc.
Mouse 3 R A Menu Root-Menu Nop
Mouse 2 R A Menu Window-Ops Nop
# Right button gives window list. Caution: Double clicking gets you a sort of
# random window, because double-click control comes only with a Menu spec!
Mouse 1 R A WindowList
Стандартное меню заполняется под свои задачи. Для меня самое главное, чтобы вверху был вызов терминала и emacs, то есть что-то вроде:
AddtoMenu Root-Menu "xterm" Exec exec gnome-terminal
+ "Emacs " Exec exec emacs -geometry 100x48+0+0 -fn 10x20
ну и так далее
Меню с действиями на окнах (средняя кнопка):
AddToMenu Window-Ops "Window Operations" Title
+ "Move" Move
+ "Resize" Resize
+ "Raise" Raise
+ "Lower" Lower
+ "Iconify/DeIconify" Iconify
+ "Stick/UnStick" Stick
+ "Maximize/Normalize" Maximize
#+ "Refresh" RefreshWindow
+ "" Nop
+ "Delete" Delete
+ "Close" Close
+ "Destroy" Destroy
Реакция на клик мыши на обрамлении окна, для его переносамежду виртуальными экранами. Stick — окно есть на всех виртаульных экранах, Unstick — окно есть только на текущем экране
# Middle mouse Stick or UnStick
Mouse 2 FTSI A Stick
Добавил реакцию на клик мыши по обрамлению окон для постоянного выведения их на передний план (иногда для некоторых окон это необходимо)
# Right mouse raises window Layer.
AddToFunc layer-raise
+ I Layer 1
+ I Raise
Mouse 3 FTSI N layer-raise
# Right mouse + Shift/control/Meta puts window to default layer.
AddToFunc layer-default
+ I Layer
+ I Raise
Mouse 3 FTSI S layer-default
Mouse 3 FTSI C layer-default
Mouse 3 FTSI M layer-default
При запуск fvwm часть программ стартует вместе с ним. В частности открывается пара терминалов на 2ом и 3-ем виртуальных экранах и emacs на основном:
AddToFunc InitFunction "I" Echo initializing...
+ "I" Function Basic-Setup
+ "I" Desk 0 1
+ "I" Exec exec gnome-terminal -t "удалённый ПК" -e "ssh удалённый@адрес"
+ "I" Wait gnome-terminal
+ "I" Desk 0 2
+ "I" Exec exec gnome-terminal
+ "I" Wait gnome-terminal
+ "I" Desk 0 0
+ "I" Exec exec xplanet -longitude 82 -latitude 55
+ "I" Exec exec ssh удалённый@адрес bash --login -c "\"/usr/bin/emacs -fn 10x20 -geometry 100x52+420+0\""
+ "I" Exec exec xscreensaver -no-splash
#emacs -geometry 82x56+0+0
#+ "I" Wait emacs
#+ "I" Exec exec xeyes -geometry 55x50+1050+12 -fg DarkGreen -center dimgrey -outline \#000060
#+ "I" Wait xeyes
+ "I" Exec exec setxkbmap -layout "us,ru(winkeys)" -option "grp:caps_toggle,grp_led:scroll,grp:switch"
+ "I" Exec exec xxkb
Собственно говоря, всё.