Fvwm/configure/expr

以前的记录,现在已经没有多少机会用到f?vwm了。就算一段回忆吧。

Fvwm如何根据分辨率调整button位置,关键是`expr …的调用。整理以前的记录。

AddToFunc StartFunction
#+ I Module FvwmConsole -terminal rxvt
#$[vp.width],513
+ I Module FvwmButtons Piperead ‘echo -g `expr $[vp.width]/2-513/2`x57+0-0 FvwmDock’

来源:
http://gunnm.org/~soda/dotfiles/fvwm/bindings/10numpad

# numpad – plik odpowiedizalny za konfiguracjê klawiatury numerycznej
# Jezeli hcesz go wy³±czyæ, zakomentuj jego odczyt w bindings/Geberal

# Prze³±czanie fokusu za pomoca klawiatury numerycznej
Key KP_Home A N Direction NorthWest (CurrentPage, AcceptsFocus, !Iconic) Focus
Key KP_Left A N Direction West (CurrentPage, AcceptsFocus, !Iconic) Focus
Key KP_End A N Direction SouthWest (CurrentPage, AcceptsFocus, !Iconic) Focus
Key KP_Up A N Direction North (CurrentPage, AcceptsFocus, !Iconic) Focus
Key KP_Down A N Direction South (CurrentPage, AcceptsFocus, !Iconic) Focus
Key KP_Page_Up A N Direction NorthEast (CurrentPage, AcceptsFocus, !Iconic) Focus
Key KP_Page_Down A N Direction SouthEast (CurrentPage, AcceptsFocus, !Iconic) Focus
Key KP_Right A N Direction East (CurrentPage, AcceptsFocus, !Iconic) Focus
Key KP_Begin A N Direction Center (CurrentPage, AcceptsFocus, !Iconic) Focus

# Sterowanie stanem okna
Key KP_Insert WT N Raise
Key KP_Delete WT N Lower
Key KP_Divide WT N WindowShade toggle
Key KP_Divide WT M Stick toggle
Key KP_Multiply WT N Maximize grow grow
Key KP_Multiply WT M Maximize 100 100
Key KP_Subtract A M Iconify true
Key KP_Subtract A MS Close
Key KP_Add A N Layer 0 4
Key KP_Add A M Layer 0 5
Key KP_Add A MS Layer 0 3

# Przemieszczanie okien po ekranie
Key KP_Home A M WindowMoveLeftTop
Key KP_Up A M WindowMoveCenterTop
Key KP_Page_Up A M WindowMoveRightTop
Key KP_Left A M WindowMoveLeftCenter
Key KP_Begin A M WindowMoveCenterCenter
Key KP_Right A M WindowMoveRightCenter
Key KP_End A M WindowMoveLeftBottom
Key KP_Down A M WindowMoveCenterBottom
Key KP_Page_Down A M WindowMoveRightBottom

# Przenoszenie okna o 50 pikseli w ka¿d± stronê
Key KP_Home A SM AnimatedMove w-50p w-50p
Key KP_Up A SM AnimatedMove w0p w-50p
Key KP_Page_Up A SM AnimatedMove w50p w-50p
Key KP_Left A SM AnimatedMove w-50p w0p
Key KP_Begin A SM –
Key KP_Right A SM AnimatedMove w50p w0p
Key KP_End A SM AnimatedMove w-50p w50p
Key KP_Down A SM AnimatedMove w0p w50p
Key KP_Page_Down A SM AnimatedMove w50p w50p

# Przechodzenie miêdzy biurkami na pulpicie
Key KP_Home A MCS GotoPage -1p -1p
Key KP_Up A MCS GotoPage 0p -1p
Key KP_Page_Up A MCS GotoPage +1p -1p
Key KP_Left A MCS GotoPage -1p 0p
Key KP_Right A MCS GotoPage +1p 0p
Key KP_End A MCS GotoPage -1p +1p
Key KP_Down A MCS GotoPage 0p +1p
Key KP_Page_Down A MCS GotoPage +1p +1p

# — FUNKCJE —

# Funkcja przenosz±ca okno razem z kursorem, je¿eli znajduje siê wewn±trz okna
DestroyFunc MPAnimatedMove
AddToFunc MPAnimatedMove
+ I Current (HasPointer) AnimatedMove $0 $1 Warp
+ I TestRc (NoMatch) AnimatedMove $0 $1

# Funkcje przenoz±ce aktywne okno do ró¿nych mijsc na ekranie
DestroyFunc WindowMoveCenterCenter
AddToFunc WindowMoveCenterCenter
+ I Current Piperead ‘echo MPAnimatedMove `expr $[vp.width] / 2 – $[w.width] / 2`p `expr $[vp.height] / 2 – $[w.height] / 2`p’

DestroyFunc WindowMoveLeftCenter
AddToFunc WindowMoveLeftCenter
+ I Current Piperead ‘echo MPAnimatedMove 5p `expr $[vp.height] / 2 – $[w.height] / 2`p’

DestroyFunc WindowMoveLeftTop
AddToFunc WindowMoveLeftTop
+ I Current MPAnimatedMove 5p 5p

DestroyFunc WindowMoveCenterTop
AddToFunc WindowMoveCenterTop
+ I Current Piperead ‘echo MPAnimatedMove `expr $[vp.width] / 2 – $[w.width] / 2`p 5p’

DestroyFunc WindowMoveRightTop
AddToFunc WindowMoveRightTop
+ I Current Piperead ‘echo MPAnimatedMove `expr $[vp.width] – 5 – $[w.width]`p 5p’

DestroyFunc WindowMoveRightCenter
AddToFunc WindowMoveRightCenter
+ I Current Piperead ‘echo MPAnimatedMove `expr $[vp.width] – 5 – $[w.width]`p `expr $[vp.height] / 2 – $[w.height] / 2`p’

DestroyFunc WindowMoveCenterBottom
AddToFunc WindowMoveCenterBottom
+ I Current Piperead ‘echo MPAnimatedMove `expr $[vp.width] / 2 – $[w.width] / 2`p `expr $[vp.height] – 5 – $[w.height]`p’

DestroyFunc WindowMoveLeftBottom
AddToFunc WindowMoveLeftBottom
+ I Current Piperead ‘echo MPAnimatedMove 5p `expr $[vp.height] – 5 – $[w.height]`p’

DestroyFunc WindowMoveRightBottom
AddToFunc WindowMoveRightBottom
+ I Current Piperead ‘echo MPAnimatedMove `expr $[vp.width] – 5 – $[w.width]`p `expr $[vp.height] – 5 – $[w.height]`p’

Piperead ‘echo Module FvwmButtons -g 513×57+`expr $[vp.width] / 2 – 255`-0 FvwmDock’
#

打赏

发表评论

电子邮件地址不会被公开。 必填项已用*标注