Fvwm Başlangıç Rehberi

From Lapis Wiki

Jump to: navigation, search

Bu makale bir Taslak tır. İçeriğini geliştirerek Lapis-Wiki'ye yardımcı olabilirsiniz.


Konu başlıkları

Giriş

FVWM(Feeble Sanal Pencere Yöneticisi) X Window için çok esnek bir masaüstü/pencere yöneticisidir. İsmi biraz yanıltıcı, fakat asıl olarak FVWM, TWM pencere yöneticisinden ayrılmakta ve yerini hafifletici şekilde almaktadır. Burada FVWM aile ağacını gözümüze iliştiren hoş bir plan bulunmakta. FVMW, mütevazi başlangıcından itibaren hep gelişmektedir ve günümüzde en fazla düzenlenebilir pencere yöneticisidir. Bir masaüstü/pencere yöneticisinde aklınıza gelebilecek herhangi birşeyi düşünün, FVWM bunu büyük ihtimalle üstesinden gelmenizi ve daha fazlasını size sunacaktır. 'Zayıf' ismi bu pencere yöneticisi artık geçerli değildir. İsim değişimindeki belirli denemeler ve orijinal 'F' harfi hakkında şehir efsanesi yaratma durumunun nasıl elden ele değiştiği bunu göstermektedir. Çoğunlukla kullanımda olan F? harfi ile beraber Sanal Pencere Yöneticisi (Virtual Window Manager) olarak söylenmeye, ya da kısaca FVWM olarak anılmaya devam etmiştir.

Though FVWM is extremely versatile and programmable, many shy away from it due to the lack of GUI configuration tools for it. Though there have been some attempts at making such tools, fvwm-themes for example, the amount of options involved cannot be easily summed up into a GUI, so the best way to configure fvwm is to write a personalized config file. This guide is to help you get familiar with how the syntax for configuring FVWM is used. The first part of the guide will lead you step by step in creating a simple config file. I have set the info to go into the config file aside so one could simply copy and paste as they work though the guide. My attention is to have you work though this guide copying and pasting some parts, but also taking some steps in modifying what I have put there so you can get use to the syntax and add your own flavor to the config. After you are done creating the basic config in this guide, I then have an appendix full of more advanced topics and configurations that you can play with to implement into your desktop. By the end of this guide its my hope that you are familiar with FVWM and can then create your own config to turn it into your window manager.

The guide tries to explain most of the options I present, but all of this information is clearly explained in the FVWM MAN PAGES. The man page is quite long, but once one has key words, it should be easy to search for how that is used in the configuration. Some of the configurations I present I will skim or skip over and expect you to use the man page to fill any any details I miss. Again just in case you didn't hear me the FVWM MAN PAGES are a valuable resource.

This guide is written for the configuration syntax of the unstable release, current at this time is fvwm-2.5.10. I have not tested the configuration on the stable release, 2.4.18, so I am unsure on how well it will work. My suggestion is to use the 2.5.10 version. Though its dubbed unstable, the basic functionality is stable and I have yet to notice any grave bugs from its operation. I also use bits of the Translucency patch in this config (though I only present it as an alternative). If your interested in using the translucency patch to add a more realistic transparency effect to your menus, instructions on how to install it can be found here.

All of FVWM is configured by a single config file which is normally located at $HOME/.fvwm2rc or $HOME/.fvwm/.fvwm2rc. Though by the use of the 'Read' command, one could split the config file up into smaller config files. For this guide we will just put everything into one config file. For sake of argument lets put everything in the $HOME/.fvwm directory, so for the first step create the $HOME/.fvwm directory and create an empty .fvwm2rc file. If you run fvwm, Don't be surprised if you think the default setup is quite ugly, cause many will agree with you, but that is a good place to start.

The images I use in this guide can all be downloaded here. If you want to work though this guide and use my images, download that file, then untar it in your $HOME directory. It will create a .fvwm folder with all the icons and decors I use in this guide. There is also a copy of the fvwm2rc that can be generated by copying and pasting though the first part of this guide.

Next open the file $HOME/.fvwm/.fvwm2rc file in your favorite text editor. This file is parsed by FVWM when it starts up (or is restarted) and fvwm uses the info in here to set up the look and feel of your desktop. To comment out a line a '#' is used. Lets put some comments at the top of the file as a starter. For example you could put the following at the top of your fresh fvwm2rc file.

Global Ayarlar

Çevresel değişkenlerı ve masaüstü temel ayarları değiştirmek için, ilk yapmanız gereken genel (global) ayarları değiştirmek olacaktır. Bir çevresel değişken aynen Shell ortamında kullanıldığı gibi kullanılır; değişken içine değer atayabilir ve bu sayede, ayar dosyasının (fvwm2rc) farklı yerlerinde kullanabilirsiniz. Ben şahsi olarak çevresel değişkenleri genel olarak fvwm programına farklı dizinlerin nerede olduğunu tanımlamak için kullanıyorum. Mesela aşağıda bazı örnekleri var:

#####
# Çevresel değişkenlerin ayarlanması
###########
SetEnv fvwm_home $[HOME]/.fvwm
SetEnv fvwm_img $[fvwm_home]/images
SetEnv fvwm_icon $[fvwm_home]/icons
SetEnv fvwm_scrpt $[fvwm_home]/scripts
SetEnv fvwm_wallpapers $[fvwm_img]/wallpaper

Ya da çevresel değişkenler yardımı ile kullanılacak olan programlarda bir tercih yapabilirsiniz, mesela:

SetEnv fvwm_webbrowser /usr/bin/firefox
SetEnv fvwm_term /usr/bin/aterm
SetEnv fvwm_mail /usr/bin/mutt
SetEnv fvwm_media_player /usr/bin/xmms
SetEnv fvwm_video_player /usr/bin/mplayer

Bir sonraki adım ise, resim dosya kısayollarıdır (ImagePath). Bu değişkeni shell altındaki $PATH değişkeninde olduğu gibi düşünebilirsibiz. Bu değişken sayesinde FVWM hangi dizin altında resim dosyaları arayacağı tanımlanır (hızlı çalıştırma ikonları, menu ikonları vb). Örnek bir resim kısayol tanımlaması aşağıdaki gibi olabilir.

#####
# Örnek bir resim kısayol tanımlaması
###########
ImagePath $[fvwm_icon]:$[fvwm_icon];.png:+

Ben bütüm ikonlarımı my $[fvwm_icon] dizini altında topluyorum. Bunun sebebi, öntanımlı olarak hem xpm dosyalarını hemde png dosyalarını kullanmak istediğimi öğretmek. Birden fazla resim kısayol (ImagePath) tanımlaması yapılabilir. Bu tanımalar bütün kullanıcılar için '/usr/local/share/images' dizini veya sadece belirli bi rkullanıcı için ise $HOME/images dizini altında olabilir.

Son adım olarak, Virtual masaüstlerinin ayarlanması var. FVWM altında birden fazla virtual masaüstüne sahip olabilirsiniz. Her masaüstünede farklı sayfalar koyabilirsibiz. Mesela 3 farklı masüstü ve her masaüstünde 9 sayfa olmasını istiyorsanız aşağıdaki gibi bir tanımlama yapabilirsiniz.

#####
# Virtual Masaüstleri 
###########
DesktopSize 3x3
DesktopName 0 Main
DesktopName 1 Work
DesktopName 2 Games
EdgeScroll 100 100
EdgeResistance 150  150
EdgeThickness 1

DesktopSize değişkeni her virtual masaüstündeki sayfa sayısını tanımlar. Mesela bkz. aşağıdaki örnek:












Burada adları Main, Work ve Games olan 3 Sanal Masaüstü tanımladık. (numaraları 0, 1, 2). EdgeScroll parametresi fareyle ekranda dolaşırken ekranı hangi oranda kullanacağınız ayarlar.'EdgeScroll 100 100' ile sonraki sayfanın 100% ü (veya tamamı) dolaşılabilir. EdgeResistance scrollar oluşmadan önce gerekli olan "dayanıklılık" veya zamanı belirler. EdgeThickness ise EdgeScroll efekti ile alınan düzenlemeye göre 'root' penceresinin etrafında ki köşelerin pixel kalınlığını belirler.Bu ayarları beğenmezseniz 'EdgeThickness 0' veya 'EdgeScroll 0 0' ayarlarını da kullanabilirsiniz.

Şimdide varsayılan Fare ve Odak davranışını belirleyeceğiz. Bunun için bir örnek verecek olursak;

#####
# Fare ve Odak Davranışları
###########
ClickTime 350
MoveThreshold 3
Style * SloppyFocus, MouseFocusClickRaises

ClickTime is the time in milliseconds between pushing the mouse button and releasing it that FVWM will consider that a 'click'. If that time is exceeded FVWM will consider that a 'hold'. MoveThreshold is the number of pixels the mouse must move before FVWM will consider that action a 'move'. Note, all this stuff will set up the feel of your window manager and is important when making functions.

Styles are used throughout FVWM to set up various Styles of how you want things to act, look, behave, etc. Styles will be used a lot, but for start, lets just look at this style line. In Style statements, *'s are wild cards, so 'Style *' says apply this style to every window. This is followed by a list of styles separated by commas that you wish to use, for example the first Style I have used is SloppyFocus which means that the window in focus is the one with the mouse over it (excluding special windows like the root window). The second Style in that line is MouseFocusClickRaises which says that if I click on a focused window it will raise to the top. Other styles could be 'ClickToFocus', 'ClickToFocusPassesClick', 'ClickToFocusPassesClickOff', 'ClickToFocusRaises' and 'ClickToFocusRaisesOff'. All of which are explained in more detail in the man page.

Besides Styles there are some special key words to set up how the default desktop environment behaves. An example of a few of these are;

EwmhBaseStruts 62 162 0 48
IgnoreModifiers L25

This first line EwmhBaseStruts sets up the 'usable' screen area. How this works is by stating 'EwmhBaseStructs left right top bottom'. The numbers are how many pixels bordering each edge of the screen are used as a padding for maximizing windows and window placement. This setup leaves a bit of space along the right, left and bottom of the screen for the FvwmTaskBar, FvwmPager and FvwmButtons. If you would like the window to ignore this setting you can use the EWMHMaximizeIgoreWorkingArea Style option. The next line tells FVWM to ignore certain modifiers, in this case it ignores the 'Num Lock' modifier and helps in lots of situations.

Some other styles I use in my fvwm2rc file are as follows, I'm not gonna explain them here, but just let you see that there are various other options you can add to your config to further control how the the FVWM Desktop functions.

#####
# Global Styles and options
###########
Style * TileCascadePlacement, GrabFocusOff
Style * NoPPosition, ResizeOpaque
OpaqueMoveSize -1
Emulate MWM
HideGeometryWindow Never
SnapAttraction 5 SameType Screen
SnapGrid 3 3
XorValue 55555
Style * DecorateTransient, DontRaiseTransient
Style * DontLowerTransient, StackTransientParent
Style * GrabFocusTransientOff
Style * WindowShadeSteps 20, WindowShadeScrolls
SetAnimation  10  -.01 0 .01 .03 .08 .18 .3 .45 .6 .75 .85 .90 .94 .97 .99 1.0
Style * MwmDecor, SlipperyIcon
Style * IconBox screen w 15 15 -165 -15, IconGrid 3 3, IconFill right top

Next I setup various program specific Styles. How the Style command works is 'Style [string] [styles]'. FVWM then compares [string] (including wild cards '*') to the Name, Class and/or Resource of a window. To figure out what the Name, Class and Resource of an application is you could use the FvwmIdent Module. This example sets up program specific styles. I mainly set up the MiniIcon and Icon that is associated with the program, though any Style option can be applied to the program.

#####
# Program Styles
###########
Style "*" Icon 48x48/unknown.xpm
Style "XTerm" Icon 48x48/xterm.png, NoActiveIconOverride, MiniIcon mini/xterm.png
Style "gvim" Icon 48x48/gvim.png, IconOverride, MiniIcon mini/gvim.png, EWMHMiniIconOverride
Style "Firefox-bin" Icon 48x48/firefox.png, MiniIcon mini/firefox.png, EWMHMiniIconOverride
Style "irssi" Icon 48x48/gaim.png, MiniIcon mini/irc.png
Style "xmms" WindowListSkip, CirculateSkip
Style "MPlayer" Icon 48x48/mplayer.png

Fonksiyonlar

Fonksiyonlar, fvwm ayar dosyasının belli bölümlerinden çalıştırılırlar. Burda birkaç basit fonksiyon göstereceğiz. Daha detaylı ve komplike fonksiyonlar için "İleri Düzey" başlığına bakabilirsiniz.

Başlangıçta fonksiyonların iskelet yapısına bakarak fikir edinmiş oluruz. Bu satırları fvwm2rc dosyanıza yapıştırın. Bu size fonksiyonların nasıl çalıştığını hatırlatır.

#####
#
# DestroyFunc FonkAdı
# AddToFunc   FonkAdı
# + I (Fonksiyon çağrıldığı anda işler)
# + C (Fareyle tek tıklama yapıldığında işler)
# + D (Fareyle çift tıklama yapıldığında işler)
# + H (Taşıma işleminde(drag-drop) işler)
# + M (Fare hareket ettirildiğinde işler)
#
###########


Burada öncelikle destroy fonksiyonunu kullanmamızın amacı, daha önce ki ayarları temizlemek(sıfırlamak)tır. Daha sonra AddToFunc ile fonksiyonu çağırdığımızda yapmasını istediğimiz komutları yazarız, ve farenin hareketine bağlı olarak farklı işlemlerin gerçekleştiğini göreceksiniz. Şimdide fonksiyonu çağırırken hangi parametleri kullanacağımıza bakalım. Örneğin fonksiyonu "FonkName "$0" "$1" "$2" "$3" "$4" şeklinde çağırabilirsiniz . Burda ki $0, $1 gibi değerlerle fonksiyona dışarıdan değer göndermiş olursunuz.Bunları dikkate alarak basit fonksiyonlara bir göz atalım.

#####
# Basit Fonksiyonlar
###########
DestroyFunc FvwmDeleteOrDestroy
AddToFunc   FvwmDeleteOrDestroy
+ H Nop
+ M Nop
+ C Delete
+ D Destroy
DestroyFunc FvwmIconifyOrShade
AddToFunc   FvwmIconifyOrShade
+ C Iconify
+ D WindowShade
DestroyFunc FvwmMaximize
AddToFunc   FvwmMaximize
+ H Nop
+ M Nop
+ C Maximize $0 $1
DestroyFunc FvwmMoveOrIconify
AddToFunc   FvwmMoveOrIconify
+ M Move 
+ D Iconify 
DestroyFunc FvwmWindowShade
AddToFunc   FvwmWindowShade
+ D WindowShade $0

Birinci fonksiyon (FvwmDeleteOrDestroy) fare işlem yapmadıkça(H=taşıma,D=DoubleClick,C=Click,M=Motion) işleme alınmaz(harflere dikkat). Aktif pencerede normal bir tıklama ile 'Delete', çift tıklama ile 'Destroy' işlenir. İkinci fonksiyon olan FvwmIconifyOrShade ile, aktif pencereye tek tıklama ile Iconify(simge durumu), çift tıklama ile WindowShade(pencereyi gizle) komutunu işletmiş oluruz. FvwmMaximized fonksiyonu çağrıldığında pencere boyutunu belirleyen 2 değer gönderilmeli. Örneğin fonksiyonu 'FvwmMaximize 100 100' çağırdığnızda pencere ekranın 100%'ünü kaplayacaktır, Mesela 'FvwmMaximize 100 0' ile pencerenin yatay boyutu maximum olur fakat dikey boyut sabit kalır. FvwmMoveOrIconify fonksiyonunda ise fare hareket ettiğinde taşıma, çift tıklamada ise Iconify(simge durumu) fonksiyonu çalışacaktır. The FvwmWindowShade fonksiyonu ise aktif pencerede ancak 2 değer alabilir shade için, 'FvwmWindowShade True', shade kullanmamak için, 'FvwmWindowShade. Eğer değer gönderilmezse en son durumuna göre tersi değer alır(shade ise unshade, unshade ise shade olur).

Şimdide programda kullanacağımız fonksiyonları yazıp onları çağıralım. Bunlar basit fonksiyonlar ancak hepsini bir araya topladığımızda güzel şeyler çıkaracaktır. Örnek fonksiyon kodu;

#####
# Programda çalışacak fonksiyonlar
###########
DestroyFunc FvwmXTerm
AddToFunc   FvwmXTerm
+ I Exec exec xterm
DestroyFunc FvwmATerm
AddToFunc   FvwmATerm
+ I Exec exec aterm
DestroyFunc FvwmGVim
AddToFunc   FvwmGVim
+ I Exec exec gvim
DestroyFunc FvwmGimp
AddToFunc   FvwmGimp
+ I Exec exec gimp-2.0
DestroyFunc FvwmFireFox
AddToFunc   FvwmFireFox
+ I Exec exec firefox
DestroyFunc FvwmIrssi
AddToFunc   FvwmIrssi
+ I Exec exec aterm -e irssi 
DestroyFunc FvwmXmms
AddToFunc   FvwmXmms
+ I Exec exec xmms
DestroyFunc FvwmViewManPage
AddToFunc   FvwmViewManPage 
+ I Exec exec xterm -fg White -bg DarkBlue -g 80x40 -fn 7x14 -fb 7x14bold \
-n "Manual Page - $0" -T "Manual Page - $0" -e man "$0"

İlk fonksiyona dikkat ederseniz sadece xterm çalıştırılıyor, herhangi bir parametre yok. Ancak son fonksiyonda önce komut sonra parametreler en sonda("-e man") bir değişken.Son fonksiyon çağrıldığı zaman bir tanede değişken(değer) göndermemizi isteyecektir. Örneğin fonksiyonu "FvwmViewManPage fvwm) şeklinde çağırırsak bize xterm ile "man fvwm" komutunu çalıştıracaktır. Bazen fonksiyonlar için birkaç satır gerekebilir. Bunun için satır sonuna '\' koyup alt satırdan fonksiyona devam edebilirsiniz. Bu satır sayısını çoğaltmak aynı şekilde mümkündür.

Şimdide üç özel fonksiyonla bakalım. 'StartFunction', 'InitFunction' ve 'RestartFunction'. StartFunction, fvwm ilk yüklendiğinde işler, InitFunction, fvwm ilk başlatıldığında StartFunction'dan sonra işlenir(ekran koruyucu gibi işlemler). RestartFunction, fvwm tekrar yükletildiğinde işler. Bunlara örnek verecek olursak

#####
# Başlangıç Fonksiyonu
###########
DestroyFunc StartFunction
AddToFunc   StartFunction
+ I Module FvwmTaskBar
+ I Module FvwmPager 0 2
+ I Module FvwmButtons MyButtons
DestroyFunc InitFunction
AddToFunc   InitFunction
+ I Exec exec xscreensaver
+ I Exec exec fvwm-root -r $[fvwm_wallpapers]/background.png
+ I FvwmXmms
+ I FvwmATerm
DestroyFunc RestartFunction
AddToFunc   RestartFunction
+ I Nop

Fvwm başladığı anda üç modül yükleyecektir. Bunlar; FvwmButtons, FvwmPager ve FvwmTaskBar. Fvwm ilk başlatıldığında xscreensaver, fvwm-root ile arkaplan, xmms ve aterm yürütülüyor. Fvwm yeniden yüklendiğindeyse hiçbir fonksiyon yüklenmiyor (StartFunction fonksiyonları hariç)

Fonksiyonlar masaüstünüz için oldukça detaylı ve kullanışlı işler çıkarır.Diğer parametrelerle($0, $1, $2, $3, vs.) çağrılan fonksiyonlar, farenin farklı olaylarıyla farklı hareket eder. Bu fonksiyonlar FVWM'ye ait olan fonksiyonlardan farklı isimle isimlendirilmelidir.Örneğin Nop, Delete, Destroy, Restart, Exec, vs.

Sıra kompleks fonksiyonlara örnek vermeye geldi;

#####
# Screenshot Fonksiyonu (ImageMagick kullanılır)
###########
DestroyFunc FvwmWindowScreenshot
AddToFunc   FvwmWindowScreenshot
+ I ThisWindow (!Shaded !Iconic Iconifiable) \
 Exec import -window $[w.id] -quality 100 -silent \
 "$[fvwm_home]/screenshot/screenshot-`date +%F[%R]`.$[w.id].jpg"
DestroyFunc FvwmDesktopScreenshot
AddToFunc   FvwmDesktopScreenshot
+ I Exec sleep $0; import -window root -quality 100 -silent \
 "$[fvwm_home]/screenshot/screenshot-`date +%F[%R]`.jpg"
#####
# XRoach Invasion
###########
DestroyFunc XRoachInvasion
AddToFunc   XRoachInvasion
+ I Exec exec xroach -roaches 5 -rc Cyan -speed 17
+ I Exec exec xroach -roaches 3 -rc Red -speed 15
+ I Exec exec xroach -roaches 7 -rc Green -speed 10
+ I Exec exec xroach -roaches 3 -rc Blue -speed 20
+ I Exec exec xroach -roaches 1 -rc Black -speed 30
+ I Exec exec xroach -roaches 1 -rc White -speed 40
DestroyFunc XRoachExterminate
AddToFunc   XRoachExterminate
+ I Exec killall xroach

Birinci set fonksiyonda imagemagick'in import özelliğinden masaüstünün veya aktif pencerenin screenshot alıyoruz. Basit bir pencerenin screenshot'unu almak için fonksiyonu 'Pick (CirculateHit) FvwmWindowScreenshot' şeklinde çağırmalısınız. Bu('Pick') size hangi pencerenin screenshot'unu alacağınız bilgisini verir. İkinci fonksiyon ise masaüstünüzün screenshot'unu '$O' saniye sonra alıyor. Bu size menüyü açtıktan sonra screenshot almanıza (vs, vs) olanak sağlar. Örneğin 'FvwmDesktopScreenshot 5' 5 saniye bekler ondan sonra bir screenshot alır. The second set of functions is just an old X toy, it will launch an invasion of different colored 'Roaches' that will scurry across your screen and hide under your windows. You can either call an Invasion of these roaches or Exterminate them all. You will need 'xroach' installed to run these functions successfully.

Bağlantılar

There are two types of bindings, you can either bind actions to the mouse or to the keyboard. To understand how these work, lets first look how a typical screen with one Window and two Iconified Windows is set up. In the figure below notice how the screen is divided up into the following parts: R - the root window, I - Icon, F - frame corners, S - frame sides, T - title bar, W - application window and 0-9 - buttons. Note that A will stand for anywhere, i.e. it doesn't matter where the mouse is located.

Resim:Window_layout.png

Bindings are set up as follows, you can either bind a key to an action by 'Key X Context Modifier Action' or bind the mouse to an action 'Mouse X Context Modifier Action'. Context is where the mouse is currently located (as shown above) and the Modifier is any combination of the following; (A)ny, (C)ontrol, (S)hift, (M)eta, (N)othing, or 1-5, representing the X Modifiers mod1-mod5 (man xmodmap). Examples of bindings are as follows:

  #####
  # Basic Bindings
  ###########
  Key F1 A M Menu MenuFvwmRoot
  Key Tab A M WindowList Root c c NoDeskSort, SelectOnRelease Meta_L
  Key Super_L A A FvwmATerm
  Mouse 1 R A Menu FvwmRootMenu
  Mouse 3 R A Menu FvwmWindowOpsMenu
  Mouse 1 1 A FvwmDeleteOrDestroy
  Mouse 1 3 A FvwmIconifyOrShade
  Mouse 1 5 A FvwmMaximize 100 100
  Mouse 2 5 A FvwmMaximize 0 100
  Mouse 3 5 A FvwmMaximize 100 0
  Mouse 1 W M FvwmMoveOrIconify
  Mouse 1 I A FvwmMoveOrIconify
  Mouse 4 T A FvwmWindowShade True
  Mouse 5 T A FvwmWindowShade False

The bindings from order of top to bottom perform the following actions;

  1. Opens the root menu when alt-f1 is pressed anywhere.
  2. Opens the WindowList which lists the running applications when alt-tab is pushed, and then switches to the application you selected when the alt key is released.
  3. Launches an aterm when the left command key (windows key) his hit.
  4. Opens the root menu when the left mouse button is clicked in the root window.
  5. Opens the window ops menu when the right mouse button is clicked in the root window.
  6. Deletes or Destroys the window when button number 1 is clicked or double clicked.
  7. Iconifies or Shades the window when button number 3 is clicked or double clicked.
  8. Maximizes the window to fit the full screen when the first mouse button is clicked on button number 5.
  9. Maximizes the window vertically when the second mouse button is clicked on button number 5.
 10. Maximizes the window horizontally when the third mouse button is clicked on button number 5.
 11. Moves the window with alt+click when the mouse moves and Iconifies the window a double click.
 12. Binds the FvwmMoveOrIconify function to work on 'Icons' so they can be moved and UnIconified.
 13. Shades the active window when you roll up on the mouse wheel twice, since the function requires a double click.
 14. UnShades the active window when you roll down on the mouse wheel twice.

Pencere Dekoru

Pencere dekorunu istediğiniz şekilde tanımlayabilirsiniz. FVWM penecere dekorasyonlarını renk şeması veya pixmap lerle yapabilir. Buna ilk örneğimizde renk şemasını kullanarak yapalım.Bağlangıçta kullanacağımız dekorasyonlar için birkaç renk seti tanımlayalım. Bu renk setlerini FVWM nin herhangi bir yerinden çağırıp kullanabiliriz(Html de kullanılan css ye benzer şekilde kullanılır). Şimdide üç renk setini tanımlayalım.

  #####
  # Pencere renk setleri
  ###########
  #Kodu         ön renk, arka renk 
  Colorset 3 fg #101060, bg #e6e7d7
  Colorset 4 fg Black, bg #a6a797
  Colorset 5 fg White, bg Black

Kodları 3, 4, 5 olup ön renge ve arka plan rengine sahip 3 renk seti tanımlamış olduk. Renkleri bu şekilde tanımlayabildiğimiz gibi yolu /etc/X11/rgb.txt olan X tanımlarınıda kullanabiliriz(yani rgb şeklinde de kullanabiliriz). Diğer renkleri renk setiyle birlikte hilight (hi) ve shade (sh) kullanabilirsiniz. Renk setleri long(uzun) integer tanımlamalardır, fakat numaraları mümkün olduğunca düşük tutarsanız fvwm'nin renk setleri için kullanacağı bellek miktarını düşük tutmuş olursunuz. Daha fazla bilgi için FvwmThemes ana sayfasına göz atın.

Dekor TitleStyle, ButtonStyle, BorderStyle diye üç bölümden oluşur. Basit bir dekor hazırlayayalım.

  #####
  # Pencere Dekoru
  ###########
  DestroyDecor MyDecor
  AddToDecor   MyDecor
  + TitleStyle LeftJustified Height 18
  + ButtonStyle 1 ActiveUp Vector 4 30x30@3 60x60@3 60x30@4 30x60@3 -- Flat
  + ButtonStyle 1 ActiveDown Vector 4 30x30@3 60x60@3 60x30@4 30x60@3 -- Flat
  + ButtonStyle 1 Inactive Vector 4 30x30@3 60x60@3 60x30@4 30x60@3 -- Flat
  + ButtonStyle 3 ActiveUp Vector 5 30x60@3 60x60@3 60x50@3 30x50@3 30x60@3 -- Flat
  + ButtonStyle 3 ActiveDown Vector 5 30x60@3 60x60@3 60x50@3 30x50@3 30x60@3 -- Flat
  + ButtonStyle 3 Inactive Vector 5 30x60@3 60x60@3 60x50@3 30x50@3 30x60@3 -- Flat
  + ButtonStyle 5 ActiveUp Vector 7 30x30@3 30x60@3 60x60@3 60x30@3 30x30@3 30x35@3 60x35@3 -- Flat
  + ButtonStyle 5 ActiveDown Vector 7 30x30@3 30x60@3 60x60@3 60x30@3 30x30@3 30x35@3 60x35@3 -- Flat
  + ButtonStyle 5 Inactive Vector 7 30x30@3 30x60@3 60x60@3 60x30@3 30x30@3 30x35@3 60x35@3 -- Flat
  + TitleStyle -- Flat
  + BorderStyle Simple -- NoInset Flat
  + ButtonStyle All -- UseTitleStyle

Bu dekorda 1, 3, 5 numaralı üç buton hazırlayıp (Bunların pozisyonlarını Bindings(bağlantılar) başlığında işledik) vektörel olarak kullanılmış. Not olarak, bunların etkisini görebilmek için bu butonlara bağlantı vermiş olmanız gerekir. Each part is followed by a '-- Flat' to make the buttons and title bar not appear to be pushed out (or in) from the window. Vectors are just simple line drawings. Each vector is set up on a 100x100 grid and can have any number of points all connected by lines. The syntax is 'Vector [number of points] [[point1] [point2] ...]'. The points are defined by 'XxY@Z' where Z is any number 0-4 representing the color to be used for the line. 0 - Shadow(sh), 1 - Hilight(hi), 2 - Background(bg), 3 - Foreground(fg), 4 - Invisible.

Here is an example of a more elaborate Decor using pixmaps for the buttons and title bar.

  #####
  # Ukkosta Decor
  ###########
  DestroyDecor UkkostaDecor
  AddToDecor   UkkostaDecor
  + TitleStyle LeftJustified Height 24
  + ButtonStyle 1 \
          ActiveUp     (Pixmap $[fvwm_img]/button/close-activeup.png -- Flat) \
          ActiveDown   (Pixmap $[fvwm_img]/button/close-activedown.png -- Flat) \
          Inactive     (Pixmap $[fvwm_img]/button/inactive.png -- Flat)
  + ButtonStyle 3 \
          ActiveUp     (Pixmap $[fvwm_img]/button/iconify-activeup.png -- Flat) \
          ActiveDown   (Pixmap $[fvwm_img]/button/iconify-activedown.png -- Flat) \
          Inactive     (Pixmap $[fvwm_img]/button/inactive.png -- Flat)
  + ButtonStyle 5 \
          ActiveUp     (Pixmap $[fvwm_img]/button/maximize-activeup.png -- Flat) \
          ActiveDown   (Pixmap $[fvwm_img]/button/maximize-activedown.png -- Flat) \
          Inactive     (Pixmap $[fvwm_img]/button/inactive.png -- Flat)
  + ButtonStyle 1 - Clear
  + ButtonStyle 3 - Clear MwmDecorMin
  + ButtonStyle 5 - Clear MwmDecorMax
  + TitleStyle AllActive MultiPixmap \
          Main AdjustedPixmap $[fvwm_img]/decor/title-main-active.xpm, \
          LeftEnd AdjustedPixmap $[fvwm_img]/decor/title-leftend-active.xpm, \
          RightEnd AdjustedPixmap $[fvwm_img]/decor/title-rightend-active.xpm, \
          UnderText AdjustedPixmap $[fvwm_img]/decor/title-undertext-active.xpm, \
          LeftOfText AdjustedPixmap $[fvwm_img]/decor/title-leftoftext-active.xpm, \
          RightOfext AdjustedPixmap $[fvwm_img]/decor/title-rightoftext-active.xpm
  + TitleStyle AllInactive MultiPixmap \
          Main AdjustedPixmap $[fvwm_img]/decor/title-main-inactive.xpm, \
          LeftEnd AdjustedPixmap $[fvwm_img]/decor/title-leftend-inactive.xpm, \
          RightEnd AdjustedPixmap $[fvwm_img]/decor/title-rightend-inactive.xpm, \
          UnderText AdjustedPixmap $[fvwm_img]/decor/title-undertext-inactive.xpm, \
          LeftOfText AdjustedPixmap $[fvwm_img]/decor/title-leftoftext-inactive.xpm, \
          RightOfext AdjustedPixmap $[fvwm_img]/decor/title-rightoftext-inactive.xpm
  + TitleStyle -- Flat
  + BorderStyle Simple -- NoInset Flat
  + ButtonStyle All -- UseTitleStyle

Now that you got the decor defined we need to tell the windows to use it and also tell them what colorset to use. This is done as follows:

  #####
  # Window Styles
  ###########
  Style "*" UseDecor MyDecor
  Style "*" Font "xft:Sans:Bold:size=8:minspace=False:antialias=True"
  Style "*" BorderWidth 1, HandleWidth 1
  Style "*" MWMBorder, FirmBorder
  Style "*" Colorset 4
  Style "*" HilightColorset 3
  Style "*" BorderColorset 5
  Style "*" HilightBorderColorset 4

These string of Styles tell every window to use the Decor MyDecor, along with setting up the font, BorderWidth, (Hilight)Colorset and (Hilight)BorderColorset the windows use. I like all my windows to look the same but one could make different Colorsets and Decors to set up styles for particular applications.

Menü

Menu listeleri görev çubuğundaki başlat ikonuna tıkladığmızda açılan pop up listesidir. Menüler program listesini kullanabilir veya dinamik olarak oluşturulur, bu nedenle bir dizinden liste yapabilirsiniz, mesela etc içerisinden uygulamaların listesini alabilirsiniz. Öncelikle menülerde kullanacağımız renk gruplarını ayarlayalım. Çoğunlukla menüler 2 renk seti kullanır, bunlardan biri normal liste bir diğeride aktif olan itemdir. Şimdi 2 tane color set tanımlayalım;

  #####
  # Menu Renk Paleti
  ###########
  #Colorset kodu önrenk, arka renk,sh rengi , hilight renk 
  Colorset 7 fg Black, bg #e6e7d7, sh Black, hi #202070
  Colorset 8 fg DarkRed, bg #e6e7d7, sh Black, hi #202070

Fvwm 2.5.10 ile RootTransparent renk setide menüler için kullanılmaya başlandı. Bu renk setleri arkaplanı pixmap olarka kullandığı için menüler transparan görünür fakat menülerin altında herhangi bir pencere gösterilmez. Örnek renk seti :

  Colorset 7 RootTransparent, fg Black, bg average, sh Black, \
    hi #202070, Tint White 60, bgTint White 60

Bu bir RootTransparan renk setidir, Tint ve bgTint menu renklerine hafif renk yüzdesi verir. 0(sıfır) değeri tam transparan, 100 değeri ise katı rengin kendisini verir.

Translucency yaması ilepencere davranışlarında gerçek transparanlık verir(ben pek bir fark göremedim). Eğer yamayı doğru bir şekilde kurduysanız, bir translucent renk seti oluşturabiirsiniz. Kullanırken 'Translucent [renk] [yüzde]' şeklinde renk setine ekleyip örneğe göz atalım:

  Colorset 7 fg Black, Translucent White 75, \
    hi Black, sh Black

Renk setlerini ayarladıktan sonra menü stillerini FVWM ye tanıtmaya geldi. Menü stilleri Style komutlarıyla benzerlik gösterir ve '*' takısı ile birlikte kullanılır böylece bütün menü stilleri aynı görünür veya farklı menülerde farklı MenStyle kullanabilirsiniz. Genel bir MenuStyle örneği için;

  #####
  # MenuStyles
  ###########
  MenuStyle * PopupDelayed, PopupDelay 300, PopdownImmediately
  MenuStyle * PopupOffset -5 100, TitleWarpOff
  MenuStyle * TitleUnderlines2, SeparatorsLong, TrianglesSolid
  MenuStyle * AnimationOff, AutomaticHotkeysOff
  MenuStyle * BorderWidth 2
  MenuStyle * PopupAsSubmenu, HoldSubmenus, SubmenusRight
  MenuStyle * ItemFormat "%|%5.5i%1.3l%2.3>%|"
  MenuStyle * VerticalItemSpacing 1 1, VerticalTitleSpacing 2 2
  MenuStyle * MenuColorset 7
  MenuStyle * ActiveFore, Hilight3DOff
  MenuStyle * ActiveColorset 8
  MenuStyle * Font "Shadow=2:xft:Sans:Bold:size=11:antialias=True"

Her opsiyon için man sayfasını göz atabilirsiniz, fakat onlar çok açıklayıcı ve PopUp ve PopDown kontrolü, colorset, menü liste ve başlıklarının font ve formatlarını kullanabilirsiniz. Eğer farklı menü görünümleri istiyorsanız "*" yerine menü ismini yazabilirsiniz. Örneğin 'MenuStyle FvwmMenu* [styles]' ve 'MenuStyle MyMenu* [styles]' ile iki menü görünümü elde edilir, bunlardan biri FvwmMenu ve MyMenu isimli menüleri için.

Şimdi menülerin görünüm ve hareketine sahip olmuş olduk, zamanla birkaç menü için tasarlanır. Menü hazırlanması tasarım fonksiyonları oldukça benzerdir, öncelikleönceki menüyü öldürmeli(destroy) ve daha sonra maddeyi menüye görünmesini istediklerinizi ekleyin. Basit root menü için bu örneğe bakın:

  #####
  # FvwmRootMenu
  ###########
  DestroyMenu FvwmRootMenu
  AddToMenu   FvwmRootMenu "Root Menu" Title
  + "Programs%menu/programs.png%"  Popup FvwmProgramsMenu
  + "Console%menu/terminal.png%"  FvwmATerm
  + "FVWM Console%menu/terminal.png%"  Module FvwmConsole
  + "" Nop
  + "Help%menu/help.png%"  Popup FvwmManPagesMenu
  + "Restart FVWM%menu/restart.png%"  Restart
  + "Quit FVWM%menu/quit.png%"  Quit

Basit menü item formato '+ "[item adı]%[ikon]%" [komut]' şeklindedir. İkonun önde veya arkada olması farketmez, örneğin '+ "%[ikon]%[item adı]" [komut]' aynı işlevi gerçekleştirir. İkonların itemin sağında veya solunda görünmesini kontrol etmek isterseniz, MenüStyle kısmını karıştırmak isteyeceksiniz. Oluşturduğumuz bu basit 'Root Menu' siz hangi tuşu ayarladıysanız onu tıkladığınızda açılacaktır(binding sayfasını tekrar göz atabilirsiniz). Bu menü 5 iteme sahip, birinicisinde bir sub-menü 'FvwmProgramsMenu' menüsünü çağıracak. İkincide FvwmATerm fonksiyonu çalıştırılacak. Üçüncüdeyse FvmwConsole modulu açılacaktır. Bu anında Fvwm komutlarını çalıştırabileceğiniz bir terminaldir. '+ "" Nop' ise bir separator oluşturur. Son birkaç item ise biri 'FvwmManPagesMenu' menüsünü çağıracak, biri yendien başlatacak, bir diğeride fvwm den çıkacaktır.

Şimdi iki sub-menü çağıracağız, bunlara diğer ayarlarımızı ekliyoruz, biri genişletilebilir küçük program listesi olacak ve diğeriyse fvwm'nin bütün man sayfalarının kütüphaneleri olacak.

  #####
  # Program Menüsü
  ###########
  DestroyMenu FvwmProgramsMenu
  AddToMenu   FvwmProgramsMenu "Programs" Title
  + "GVim%menu/vim.png%"  FvwmGVim
  + "Gimp%menu/gimp.png%"  FvwmGimp
  + "FireFox%menu/firefox.png%"  FvwmFireFox
  + "Irssi%menu/irc.png%"  FvwmIrssi
  + "Xmms%menu/xmms.png%"  FvwmXmms
  + "XRoach-Invasion%menu/xroach.png%"  XRoachInvasion
  + "XRoach-Exterminate%menu/xroach.png%"  XRoachExterminate
  #####
  # FVWM Man Sayfası Menüsü
  ###########
  DestroyMenu FvwmManPagesMenu
  AddToMenu   FvwmManPagesMenu "FVWM Man Pages" Title
  + "%menu/help.png%fvwm"                FvwmViewManPage fvwm
  + "%menu/help.png%FvwmAnimate"         FvwmViewManPage FvwmAnimate
  + "%menu/help.png%FvwmAuto"            FvwmViewManPage FvwmAuto
  + "%menu/help.png%FvwmBacker"          FvwmViewManPage FvwmBacker
  + "%menu/help.png%FvwmBanner"          FvwmViewManPage FvwmBanner
  + "%menu/help.png%FvwmButtons"         FvwmViewManPage FvwmButtons
  + "%menu/help.png%FvwmCommand"         FvwmViewManPage FvwmCommand
  + "%menu/help.png%FvwmConsole"         FvwmViewManPage FvwmConsole
  + "%menu/help.png%FvwmConsoleC.pl"     FvwmViewManPage FvwmConsoleC.pl
  + "%menu/help.png%FvwmCpp"             FvwmViewManPage FvwmCpp
  + "%menu/help.png%FvwmDebug"           FvwmViewManPage FvwmDebug
  + "%menu/help.png%FvwmDragWell"        FvwmViewManPage FvwmDragWell
  + "%menu/help.png%FvwmEvent"           FvwmViewManPage FvwmEvent
  + "%menu/help.png%FvwmForm"            FvwmViewManPage FvwmForm
  + "%menu/help.png%FvwmGtk"             FvwmViewManPage FvwmGtk
  + "%menu/help.png%FvwmGtkDebug"        FvwmViewManPage FvwmGtkDebug
  + "%menu/help.png%FvwmIconBox"         FvwmViewManPage FvwmIconBox
  + "%menu/help.png%FvwmIconMan"         FvwmViewManPage FvwmIconMan
  + "%menu/help.png%FvwmIdent"           FvwmViewManPage FvwmIdent
  + "%menu/help.png%FvwmM4"              FvwmViewManPage FvwmM4
  + "%menu/help.png%FvwmPager"           FvwmViewManPage FvwmPager
  + "%menu/help.png%FvwmPerl"            FvwmViewManPage FvwmPerl
  + "%menu/help.png%FvwmProxy"           FvwmViewManPage FvwmProxy
  + "%menu/help.png%FvwmRearrange"       FvwmViewManPage FvwmRearrange
  + "%menu/help.png%FvwmSave"            FvwmViewManPage FvwmSave
  + "%menu/help.png%FvwmSaveDesk"        FvwmViewManPage FvwmSaveDesk
  + "%menu/help.png%FvwmScript"          FvwmViewManPage FvwmScript
  + "%menu/help.png%FvwmScroll"          FvwmViewManPage FvwmScroll
  + "%menu/help.png%FvwmTaskBar"         FvwmViewManPage FvwmTaskBar
  + "%menu/help.png%FvwmTheme"           FvwmViewManPage FvwmTheme
  + "%menu/help.png%FvwmWharf"           FvwmViewManPage FvwmWharf
  + "%menu/help.png%FvwmWinList"         FvwmViewManPage FvwmWinList
  + "%menu/help.png%FvwmWindowMenu"      FvwmViewManPage FvwmWindowMenu
  + "" Nop
  + "%menu/help.png%fvwm-config"         FvwmViewManPage fvwm-config
  + "%menu/help.png%fvwm-perllib"        FvwmViewManPage fvwm-perllib
  + "%menu/help.png%fvwm-root"           FvwmViewManPage fvwm-root
  + "%menu/help.png%fvwm-bug"            FvwmViewManPage fvwm-bug
  + "%menu/help.png%fvwm-convert-2.2"    FvwmViewManPage fvwm-convert-2.2
  + "%menu/help.png%fvwm-convert-2.4"    FvwmViewManPage fvwm-convert-2.4
  + "" Nop
  + "%menu/help.png%fvwm-menu-desktop"   FvwmViewManPage fvwm-menu-desktop
  + "%menu/help.png%fvwm-menu-directory" FvwmViewManPage fvwm-menu-directory
  + "%menu/help.png%fvwm-menu-headlines" FvwmViewManPage fvwm-menu-headlines
  + "%menu/help.png%fvwm-menu-xlock"     FvwmViewManPage fvwm-menu-xlock

Bir sonraki menüde penecere üzerinde çeşitli operasyonları gerçekleştirebileceğiniz eylemler ve screenshot alma olacak. Bağlamalarda yaptığımız ayarlarda etkin penecereye sol klik yaptığımız zaman açılacak. SOn item FvwmIdent modülünü çağıracak -ki bu modül bu pencere hakkında çeşitli karakteristik özellikleri verir-, örneğin ismi, sınıfı, kaynağı ve diğer bilgileri verir.

  #####
  # fvwm Pencere Çalışma Meünüsü
  ###########
  DestroyMenu FvwmWindowOpsMenu
  AddToMenu   FvwmWindowOpsMenu "Window Operations" Title
  + "Move%menu/window-move.xpm%"  Move
  + "Resize%menu/window-resize.xpm%"  Resize
  + "(De)Iconify%menu/window-iconify.xpm%"  Iconify
  + "(Un)Maximize%menu/window-maximize.xpm%"  Maximize
  + "(Un)Shade%menu/window-shade.xpm%"  WindowShade
  + "(Un)Stick%menu/window-stick.xpm%"  Stick
  + "" Nop
  + "Close%menu/window-close.xpm%"  Close
  + "Delete%menu/window-delete.xpm%"  Delete
  + "Destroy%menu/window-destroy.xpm%"  Destroy
  + "" Nop
  + "StaysOnTop%menu/window-raise.xpm%"  Pick (CirculateHit) Layer 0 6
  + "Layer +1%menu/window-raise.xpm%"  Pick (CirculateHit) Layer +1
  + "StaysPut%menu/window.xpm%"  Pick (CirculateHit) Layer 0 4
  + "Layer -1%menu/window-lower.xpm%"  Pick (CirculateHit) Layer -1
  + "StaysOnBottom%menu/window-lower.xpm%"  Pick (CirculateHit) Layer 0 2
  + "" Nop
  + "%menu/window.xpm%Window Screenshot"  Pick (CirculateHit) FvwmWindowScreenshot
  + "%menu/display.xpm%Screenshot" FvwmDesktopScreenshot 5
  + "" Nop
  + "Identify%menu/window-identify.xpm%"  Module FvwmIdent

Modüller

The FvwmModules are bits of software launched from within FVWM using the 'Module' command to add more functionality and versatility to the Desktop. There are a hand full of different modules out there, but the main ones I'm gonna focus on in this part of the guide is the FvwmTaskBar, FvwmPager and FvwmButtons. To launch a module you first need to configure it and then launch it using the Module Command. These modules will all use colorsets as an option, so I will first generate two colorsets to be used though out the module section. The three main modules, FvwmTaskBar, FvwmPager and FvwmButtons can all use RootTransparent colorsets, so if you like transparency feel free to make these colorsets RootTransparent like for the menu. To my knowledge the Translucency patch only affects menus and Translucent colorsets cannot be used.

  #####
  # Module Colorsets
  ###########
  Colorset 9 fg rgb:00/00/00, hi rgb:00/00/00, sh rgb:00/00/00, bg rgb:e9/e9/d9
  Colorset 10 fg rgb:00/00/00, hi rgb:dd/00/00, sh rgb:dd/00/00, bg rgb:fb/fc/ec

To see how the basic syntax for module configuration works, lets take a look at the FvwmIdent Module. This module is used to identify a window and gives us info about it that can be useful in configuring fvwm. As with most things in FVWM the first thing that should be done is to destroy any previous config. After that send some options to the module as follows:

  #####
  # FvwmIdent
  ###########
  DestroyModuleConfig FvwmIdent: *
  *FvwmIdent: Colorset 9
  *FvwmIdent: Font "xft:Sans:Bold:size=12:antialias=True"

The config for this module is quite simple, I just tell FvwmIdent what font and colorset to use. To launch the module, just add 'Module FvwmIdent' to an action (such as I have in the window ops menu).

FvwmGörevÇubuğu

FvwmGörevÇubuğu Windows'takine benzer bir görev çubuğudur. There is a start menu button you can bind any menu to, a place for quick launch buttons, a list of running tasks and finally have a clock at the far end.

To start with lets set up some Styles for FvwmTaskBar. We want to set up the task-bar so it has no window decorations and also so it won't include itself in the list of running tasks. I also make the task-bar 'Sticky' so it will be shown on all your Virtual desktops and make its size and position fixed. You can achieve this as follows:

  #####
  # FvwmTaskBar
  ###########
  Style "FvwmTaskBar" NoTitle, !Handles, !Borders, Sticky, WindowListSkip, \
    CirculateSkip, StaysOnBottom, FixedPosition, FixedSize, !Iconifiable

Next you need to set up the various options for the FvwmTaskBar Module. That is achieved as follows:

  DestroyModuleConfig FvwmTaskBar: *
  *FvwmTaskBar: Geometry +0-0
  *FvwmTaskBar: Rows 3
  *FvwmTaskBar: Font "xft:Sans:Bold:pixelsize=12:minispace=True:antialias=True"
  *FvwmTaskBar: SelFont "xft:Sans:Bold:pixelsize=12:minispace=True:antialias=True"
  *FvwmTaskBar: StatusFont "xft:Sans:Bold:pixelsize=12:minispace=True:antialias=True"
  *FvwmTaskBar: Colorset 9
  *FvwmTaskBar: IconColorset 9
  *FvwmTaskBar: FocusColorset 9
  *FvwmTaskBar: TipsColorset 9
  *FvwmTaskBar: UseSkipList
  *FvwmTaskBar: UseIconNames
  *FvwmTaskBar: ShowTips
  *FvwmTaskBar: StartName FVWM
  *FvwmTaskBar: StartMenu FvwmRootMenu
  *FvwmTaskBar: Button Title ATerm, Icon mini/xterm.png, Action (Mouse 1) FvwmATerm
  *FvwmTaskBar: Action Click3 Menu FvwmWindowOpsMenu
  *FvwmTaskBar: StartIcon mini/fvwm.png

The first line destroys the default config and allows you to start you config from scratch. The following lines set up various options, all of which are explained in the FvwmTaskBar man page. The main ones are to set up the colorset that the TaskBar uses, along with the font. I also tell the TaskBar to UseSkipList, so any windows that have the Style 'WindowSkipList' won't be shown on the TaskBar. I also set up an action, so if your right click on a button it will open the WindowOps menu so you can perform actions on the window you click on. I also set up one button that will launch an aterm by clicking on it.

Now once you have the module configured, you need only launch it. The module is launched by running 'Module FvwmTaskBar', but this is already done in the StartFunction, so it shouldn't need to be put in the config.

FvwmSayfalayıcı

FvwmPager is used to show the layout of your Virtual Desktop. It will show all the Pages and Desktops you have set up, and the windows opened in each.

As with the FvwmTaskBar, the first thing to do is set up the Styles and Colorsets you want to use for your pager. I am just gonna use the same colorset as was used for the TaskBar.

  #####
  # FvwmPager
  ###########
  Style "FvwmPager" NoTitle, !Handles, !Borders, Sticky, WindowListSkip, \
    CirculateSkip, StaysOnBottom, FixedPosition, FixedSize, !Iconifiable
  
  DestroyModuleConfig FvwmPager: *
  *FvwmPager: Geometry 150x150-0+0
  *FvwmPager: Colorset * 9
  *FvwmPager: HilightColorset * 10
  *FvwmPager: BalloonColorset * 9
  *FvwmPager: WindowColorsets 9 10
  *FvwmPager: Font "xft:Sans:Bold:pixelsize=12:minspace=True:antialias=True"
  *FvwmPager: Balloons All
  *FvwmPager: BalloonFont "xft:Sans:Bold:pixelsize=12:minspace=True:antialias=True"
  *FvwmPager: BallonYOffset +2
  *FvwmPager: Window3dBorders
  *FvwmPager: MiniIcons
  *FvwmPager: UseSkipList
  *FvwmPager: Rows 3

Refer to the man page for full explanation of all the options available. To launch the FvwmPager, you run it as 'Module FvwmPager [start desk] [finish desk]'. In the StartFunction I have this one set up to show all three desktops on one pager so I run it as 'Module FvwmPager 0 2'. If no options are sent, FvwmPager will only show the current Desktop.

FvwmDüğmeleri

FvwmButtons are probably one of the most versatile module for FVWM. As taviso says:

  #####
  # FvwmButtons is an incredible piece of software.
  #
  # It can create freeform panels of any size, shape (including Non-Rectangular windows), 
  # Colour and function. It can swallow other applications, even applications not designed
  # for docking, have "panels" that slide out consisting of other panels, has a "startup-notification"
  # like feature, hundreds of possible bindings, uses the powerful fvwm Colorsets feature, and
  # can even change dynamically and respond to window manager events.
  #
  # The widgets can be transparent, use Xft fonts, and using fvwm's font definitions can render drop shadows
  # at any direction, offset, size and colour. Buttons can all use different Colorsets, and can have different
  # reliefs, shapes, anything! 
  #
  # FvwmButtons is even tolerant to errors in configuration, and can workaround bad or impossible 
  # definitions!
  #
  # As it's an fvwm module, it has 100% integration with the window manager and can use
  # internal fvwm commands, functions, etc.
  #
  # as you can tell, i am a big FvwmButtons fan :)
  #
  # I've written a quick introduction into making panels with FvwmButtons, you can read it here
  # http://forums.gentoo.org/viewtopic.php?t=162177
  #
  ###########

taken from taviso's fvwm2rc file.

With that being said, the intro here will only cover the basics of how to set up FvwmButtons. As mentioned, you can create as many instances of FvwmButtons as you would like to do about anything you would want on your desktop. I will create a simple set of Buttons called MyButtons to get you familiar with the syntax. In the advanced topics section I will give examples of more complex FvwmButtons to give you a better feel for how they work.

The basic layout of FvwmButtons is a rectangle (though as taviso mentioned you can configure them to be any shape). You set the geometry of the FvwmButtons by giving its size (width X height) and then can break that into a grid by expressing the number of rows and columns it has. This is important because then each button inside the FvwmButtons panel can span any number of rows and columns allowing you to make buttons of various sizes. Then inside each button you can set up Titles, Icons, Actions and even have it swallow other applications (more on this in the advanced topics appendix). The buttons are filled in from the top left to the bottom right as shown in the figure.

Resim:Fvwmbuttons_layout.png

The example I provide for this guide is quite basic just to show you the basic syntax. This is a single column button with a title and then a few quick launch buttons to launch some applications.

  #####
  # MyButtons
  ###########
  Style "MyButtons" NoTitle, !Handles, !Borders, Sticky, WindowListSkip, \
    CirculateSkip, StaysOnBottom, FixedPosition, FixedSize, !Iconifiable
  
  DestroyModuleConfig MyButtons: *
  *MyButtons: Geometry 60x420+0+0
  *MyButtons: Colorset 9
  *MyButtons: Rows 38
  *MyButtons: Columns 1
  *MyButtons: Frame 0
  *MyButtons: Font "Shadow=3:xft:Sans:Bold:pixelsize=14:minspace=True:antialias=True"
  *MyButtons: (1x2, Frame 0, Title(Center) "FVWM")
  *MyButtons: (1x5, Frame 0, Icon 48x48/terminal.png, \
    Action(Mouse 1) "FvwmATerm", \
    Action(Mouse 3) "FvwmXTerm")
  *MyButtons: (1x5, Frame 0, Icon 48x48/xmms.png, \
    Action(Mouse 1) "FvwmXmms")
  *MyButtons: (1x5, Frame 0, Icon 48x48/vim.png, \
    Action(Mouse 1) "FvwmGvim")
  *MyButtons: (1x5, Frame 0, Icon 48x48/gimp.png, \
    Action(Mouse 1) "FvwmGimp")
  *MyButtons: (1x5, Frame 0, Icon 48x48/firefox.png, \
    Action(Mosue 1) "FvwmFireFox")
  *MyButtons: (1x5, Frame 0, Icon 48x48/irc.png, \
    Action(Mouse 1) "FvwmIrssi")
  *MyButtons: (1x5, Frame 0, Icon 48x48/tux.png, \
    Action(Mouse 1) "FvwmXLock")
  *MyButtons: (1x1, Frame 0)

Genel Bakış/Karar

Congratulations, you have just completed your first fvwm2rc file. Its my hope that you have gotten some basics about how FVWM is configured, and maybe a small glimpse of how much freedom you have. All of the stuff mentioned so far is what I would consider the basics for any FVWM desktop. As an over view recall that we looked at how to set up global settings such as 'Styles' to control the behavior of FVWM. We then saw how to create functions, set up bindings, build a Decor and a create Menus. Finally we got to see some of the Modules we could use to add onto FVWM.

The fvwm2rc file that this guide creates can be found here, so you can see it all in one page. Also if you you use this fvwm2rc file with the images I provided your desktop will look something like;

Resim:Fvwm-guide-screenshot-thumbnail.jpg

The rest of this guide will include some more bells and whistles you could add to your config along with the resources and references I have seen and used in my experience with FVWM.

Ek

Gelişmiş Başlıklar

Gelişmiş Fonksiyonlar

Functions are one of my favorite things to use (as you noticed I write a function even for simple tasks). As is true with almost anything you want to program, being able to write good functions is the key. Almost all of the advanced sections are gonna include functions, so this part is just filled with miscellaneous functions.

These first two functions are taken from taviso's fvwm2rc file. They use the tools from ImageMagick to take screen shots of an open window and then use it for an Icon. The first function Thumbnail will use the screenshot of the current window and use that as the Icon for its Iconified state.

  DestroyFunc Thumbnail
  AddToFunc Thumbnail
  + I Raise
  + I SetEnv Icon-$[w.id] $[w.iconfile]
  + I ThisWindow (!Shaded Iconifiable !Iconic) PipeRead \
      "xwd -silent -id $[w.id] | convert -scale $$(($[w.width]/5)) -frame 1x1 \
      -mattecolor black -quality 0 xwd:- png:$[fvwm_tmp]/icon.tmp.$[w.id].png \
      && echo Nop"
  + I TestRc (Match) Test (f $[fvwm_icon]/$[w.iconfile], f $[fvwm_tmp]/icon.tmp.$[w.id].png) \
      PipeRead "composite -geometry +2+4 \
      $[fvwm_icon]/$[w.iconfile] $[fvwm_tmp]/icon.tmp.$[w.id].png \
      $[fvwm_tmp]/icon.tmp.$[w.id].png && \
      echo WindowStyle IconOverride, Icon $[fvwm_tmp]/icon.tmp.$[w.id].png || echo Nop"
  + I TestRc (NoMatch) WindowStyle IconOverride, Icon $[fvwm_tmp]/icon.tmp.$[w.id].png
  + I Iconify
  
  DestroyFunc DeThumbnail
  AddToFunc DeThumbnail
  + I PipeRead "echo WindowStyle Icon \\$\\[Icon-$[w.id]\\]"
  + I UnsetEnv Icon-$[w.id]
  + I Exec rm -f $[fvwm_tmp]/icon.tmp.$[w.id].png

These functions can be used in place of 'Iconify'. The function Thumbnail will first take a screenshot of the current window and then write it to a temp file. The temp file is put in the dir $[fvwm_tmp], so you must have that enviorment variable set. The function then looks to see if you have have an Iconfile set for the window, 'Test (f $[fvwm_home]/icons/$[w.iconfile])'. This fill will only exist if you set it using a style command, for example 'Style "Firefox-bin" Icon 48x48/firefox.png' well set $[w.iconfile] to be 48x48/firefox.png (note that I set up so my icons are all in my $[fvwm_icon] dir). If this file exists then the function will 'composite' those two pics into one icon. Either way, it then sets the new Icon to be the screenshot image we just created and Iconifies the window. The DeThumbnail function cleans things up, it sets the icon back to its original state and then removes the temp icon it created so the next time the window is Tumbnailed it will behave the same as the first. There are two ways to make sure this function is run when an window is deiconified. One way is to also add an '+ I Iconify' to this function and bind it so its ran when you deicnoify a window. Or what I prefer is set up the module FvwmEvent to run this at the time the window is deiconified. This is nice cause then it doesn't matter how the icon is deiconified, this function will still run. To do this set up FvwmEvent as follows and then load the module at startup in your StartFunction.

  #####
  # FvwmEvent
  ###########
  DestroyModuleConfig FvwmEvent: *
  *FvwmEvent: deiconify DeThumbnail

One last note about these functions is that when you 'Restart' FVWM all the Icons are converted back to their original state and you have to deiconify then iconify the windows again to get things working. One way to work around is with adding '+ I All (Iconic) ReThumbnail' to your RestartFunction, where ReThumbnail is the following function.

  DestroyFunc ReThumbnail
  AddToFunc   ReThumbnail
  + I Iconify
  + I Thumbnail

If everything is set up correctly then your Icons for your Iconified windows should look something like these two examples for firefox and gvim.

Resim:Firefox_thumbnail.png Resim:Gvim_thumbnail.png

Another function that taviso wrote, he calls FvwmExpose. This function is like the WindowList function. What it does is uses ImageMagick to take a sreenshot of all the open windows and then put them into a menu using the screenshot as the icon. Here is a copy of his function.

  #####
  # FvwmExpose
  ###########
  DestroyFunc FvwmExpose
  AddToFunc FvwmExpose
  + I AddToMenu FvwmExposeMenu "e x p o s e" Title
  + I + DynamicPopDownAction DestroyMenu FvwmExposeMenu
  + I All (!Iconic !Shaded AcceptsFocus)\
      PipeRead "echo Raise; \
          xwd -silent -id $[w.id] | convert -scale $$(($[w.width]/10)) -quality 0 xwd:- \
          png:$[fvwm_home]/tmp/icon.exp.$[w.id].png \
      && echo AddToMenu FvwmExposeMenu \
      %$[fvwm_home]/tmp/icon.exp.$[w.id].png%\\\'\"$[w.name]\"\\\' WindowID $[w.id] WarpToWindow 50 50 \
          && echo AddToMenu FvwmExposeMenu \\\"\\\" Nop \
      || Nop"
  + I Popup FvwmExposeMenu
  + I Exec exec rm -f $[fvwm_home]/tmp/icon.exp.*

Call this function from a binding, I use meta+middle mouse click, and it will popup the FvwmExposeMenu. Here is an example of what that menu will look like.

Gelişmiş Menü

Menus are useful tools and can be generated dynamically in FVWM. The FvwmExpose function on the last page is an example of that. One of the nice thing about FVWM menus is being able to create them from scripts. This is nice because you could create a menu based off the wallpapers in a directory (example already shown), or you could create a menu that list all the contents of the directory (and its subdirectories). Some places to look for more information about this is to check out the fvwm-menu-directory and fvwm-menu-headlines scripts that come with FVWM (complete with man pages). Also look up MissingSubmenuFunction, DynamicPopupAction and DynamicPopdownAction in the FVWM man page.

Debian is my distro of choice. One nice tool that comes with debian is the 'menu' package which is used to generate menus. The FVWM debian package comes with a script that takes advantage of this to generate a menu of the installed apps on your debian box. I have taken this script and modified to my own liking and use it to generate a DebianMenu on my desktop. If you have debian and are interested in this you'll need to grab the following three files: fvwm_menu, fvwm_menu.h and fvwm_menu_data.h. Then you'll have to put these files in your $[fvwm_scrpt] directory. After that you'll also need to add the following function to your fvwm2rc.

  #####
  # DebianMenu
  ###########
  DestroyFunc BuildDebianMenu
  AddToFunc   BuildDebianMenu
  + I Exec if [ -f "$[fvwm_home]/DebianMenu" ] then rm $[fvwm_home]/DebianMenu fi
  + I PipeRead 'update-menus --menumethod $[fvwm_scrpt]/fvwm_menu; \
    cat $[fvwm_home]/DebianMenu'

Though the use of the menu package this function creates a file called $HOME/.fvwm/DebianMenu. If you use another location as your $[fvwm_home] you'll have to modify the fvwm_menu script slightly. It then cats the file and uses it to create the DebianMenu. I have this set up so you have to run the function BuildDebianMenu anytime the menu needs to be updated, but the nice thing about it is all you have to do is 'Read $[fvwm_home]/DebianMenu' at startup to include this menu in your setup. To get to the menu, just add it to your FvwmRootMenu and 'Popup DebianMenu'.

For the next example, I have modified the script fvwm-menu-directory to use to create myself a MediaMenu to list my music. I suggest you first take a look at both the fvwm-menu-directory and fvwm-menu-headlines man page first. The following is an example for a modified version of fvwm-menu-directory. I have two main features I added to the script. The first one is for any directory it will look for a file called [directory_name].png and if it finds one it will use that image as the Icon for that directory in the menu (and in the title of the submenu generated by that directory), along with this feature I have set it up so you can ignore all .png files and not list them in the menu. The second feature I have added is the ability to only list parts of the directory, so the menu doesn't get too big. Before I explain how these work lets first look at the FuncFvwmMenuDirectory that is used to generate these functions and the 'MediaMenu' that spawns them.

  DestroyFunc FuncFvwmMenuDirectory
  AddToFunc   FuncFvwmMenuDirectory
  + I PipeRead '$[fvwm_scrpt]/fvwm-menu-directory --title "%d" --dir "$0" \
    --links --command-file "exec xmms \\"%f\\"" \
    --command-title "exec xmms \\"%d\\"" \
    --icon-title "$0.png" --icon-file "menu/notes.png" \
    --exclude ".png"'
  #####
  # MediaMenu
  ###########
  DestroyMenu MusicMenu
  AddToMenu   MusicMenu "Music" Title
  AddToMenu   MusicMenu MissingSubmenuFunction FuncFvwmMenuDirectory
  + "Artists A-B%menu/music.xpm%" Popup /home/music/albums/artists|[14AB]
  + "Artists C-G%menu/music.xpm%" Popup /home/music/albums/artists|[CDEFG]
  + "Artists H-K%menu/music.xpm%" Popup /home/music/albums/artists|[HIJK]
  + "Artists L-O%menu/music.xpm%" Popup /home/music/albums/artists|[LMNO]
  + "Artists P-S%menu/music.xpm%" Popup /home/music/albums/artists|[PQRS]
  + "Artists T-Z%menu/music.xpm%" Popup /home/music/albums/artists|[TUVWXYZ]
  + "Unsorted%menu/music.xpm%" Popup /home/music/albums/unsorted
  + "Assorted Music%menu/music.xpm%" Popup /home/music/assorted
  + "Collections%menu/music.xpm%" Popup /home/music/albums/collections
  + "Soundtracks%menu/music.xpm%" Popup /home/music/albums/soundtracks

How the MediaMenu works is it sets up FuncFvwmMenuDirectory as the MissingSubmenuFunction. What this does is if you try to Popup a submenu that doesn't exist, it will send the name of the submenu to the FuncFvwmMenuDirectory. That function then generates the submenu so it can be PopedUp. How my FuncFvwmMenuDirectory works is it takes a directory name followed by the list of the starting letters of the items to include. For example, 'Popup /home/music/albums/artists|[CDEFG]' will only list the files/directories in /home/music/albums/artists that start with C, D, E, F or G. Here is an example of what this will look like.

Gelişmiş FvwmDüğmeleri

FvwmButtons muhtemelen Fvwm ile gelen Modüllerden en karmaşık olanıdır. Hem 'dock' hemde 'Panel' olarak kullanılabilir, ayrıca heps içinde Transparent renk seti kullanılabilir. Taviso'nun yazdığı güzel FvwmButtons burada göreceğiz. The following is a collection of a few sample config to show you some of the neat stuff that one can do with FvwmButtons.

For the first example, I created a 'Dock' that has rounded corners, is transparent and contains an FvwmScript to create a simple clock.

  #####
  # DockButtons
  ###########
  Style "DockButtons" !Title, !Handles, Sticky, WindowListSkip, \
          CirculateSkip, BorderWidth 0, HandleWidth 0
  Colorset 15 RootTransparent, fg rgb:00/00/00, bg average, \
    Tint white 40, bgTint white 40, RootTransparent, \
    Shape dock-mask.xpm
  Colorset 16 RootTransparent, fg rgb:00/00/00, bg average, \
    Tint white 40, bgTint white 40, RootTransparent
  
  DestroyModuleConfig DockButtons: *
  *DockButtons: Geometry 600x80
  *DockButtons: Colorset 15
  *DcokButtons: Rows 2
  *DockButtons: Columns 30
  *DockButtons: (1x2, Frame 0)
  *DockButtons: (4x2, Frame 0, Icon 64x64/terminal.png, \
    Action(Mouse 1) "FvwmATerm", Action(Mouse 3) "FvwmXTerm")
  *DockButtons: (4x2, Frame 0, Icon 64x64/firefox.png, \
    Action(Mouse 1) "FvwmFireFox")
  *DockButtons: (4x2, Frame 0, Icon 64x64/xmms.png, \
    Action(Mouse 1) "FvwmXmms")
  *DockButtons: (4x2, Frame 0, Icon 64x64/gimp.png, \
    Action(Mouse 1) "FvwmGimp")
  *DockButtons: (4x2, Frame 0, Icon 64x64/editor.png, \
    Action(Mouse 1) "FvwmGVim")
  *DockButtons: (8x1, Frame 0, \
    Swallow FvwmApplet-DigitalClock `FvwmScript $[fvwm_scrpt]/DigitalClock 16`)
  *DockButtons: (2x1, Frame 0, Icon 32x32/cpumon.png)
  *DockButtons: (2x1, Frame 0, Icon 32x32/memmon.png)
  *DockButtons: (2x1, Frame 0, Icon 32x32/diskmon.png)
  *DockButtons: (2x1, Frame 0, Icon 32x32/netmon.png)
  *DockButtons: (1x2, Frame 0)

To start out with I set up the default styles for my DockButtons and then create two colorsets they will use. The one part that is different than any of the other colorsets I've used is the 'Shape' option. What this does is takes the 'shape' of an .xpm image and uses it to shape the button. How this works is I create a transparent .xpm file (as shown below), using the transparent part of the pixmap to describe the Shape of the window (Buttons). To read more on this, check out the FvwmThemes man page, and look for 'Shape', 'TitleShape' and 'AspectShape'.

Resim:Dock-mask-ss.png

The file dock-mask.xpm opened in the gimp.

Resim:Dockbuttons.jpg

DockButtons with rounded corners

The one thing you should notice in the DockButtons config is the 'DigitalClock' applet. How this works is it uses the module 'FvwmScript' which can be used to build graphical interfaces. All this simple DigitalClock script does is take the output from 'date "+%b %e, %R"', and prints it to a window. This script can take one argument which states what colorset to use. I then 'Swallow' the window into my DockButtons. This is a really nice feature because you can have FvwmButtons swallow many applications, including non dockable apps. In this case I swallow the output of the DigitalClock script, which is the date and time using the colorset sent to the script.

This next example is the FvwmButtons I use on my desktop. I have included the time, a few quick launch buttons for my favorite applications and then have swallowed the FvwmPager, xosview system monitors and an FvwmScript that takes the output from lm-sensors.

  Style "UkkostaButtons" !Title, !Handles, Sticky, WindowListSkip, \
          CirculateSkip, BorderWidth 0, HandleWidth 0
  Colorset 15 fg rgb:00/00/00, bg #e6e7d7, Shape ukkostabuttons-mask.xpm
  Colorset 16 fg rgb:00/00/00, bg #e6e7d7
  
  DestroyModuleConfig UkkostaButtons: *
  *UkkostaButtons: Geometry 110x580-20+20@1
  *UkkostaButtons: Colorset 15
  *UkkostaButtons: Pixmap $[fvwm_img]/buttons-bg.png
  *UkkostaButtons: Rows 40
  *UkkostaButtons: Columns 4
  *UkkostaButtons: Frame 0
  *UkkostaButtons: Font "Shadow=2:xft:Winks:Medium:pixelsize=24:minspace=False:antialias=True"
  *UkkostaButtons: (4x2, Frame 0, \
          Action(Mouse 1) 'All (Sticky Iconifiable) Iconify', \
          Title(Center) "ukkosta")
  *UkkostaButtons: (4x1, Frame 0, \
          Swallow FvwmApplet-DigitalClock `FvwmScript $[fvwm_scrpt]/DigitalClock 16`)
  *UkkostaButtons: (2x4, Frame 0, \
          Icon 48x48/firefox.png, \
          Action(Mouse 1) "FvwmFireFox")
  *UkkostaButtons: (2x4, Frame 0, \
          Icon 48x48/terminal.png, \
          Action(Mouse 1) "FvwmXTerm", \
          Action(Mouse 2) "Exec exec pterm", \
          Action(Mouse 3) "FvwmATerm")
  *UkkostaButtons: (2x4, Frame 0, \
          Icon 48x48/editor.png, \
          Action(Mouse 1) "FvwmGVim", \
          Action(Mouse 3) "FvwmXEmacs")
  *UkkostaButtons: (2x4, Frame 0, \
          Icon 48x48/chat.png, \
          Action(Mouse 1) "FvwmTalkbox", \
          Action(Mouse 2) "FvwmIrssi", \
          Action(Mouse 3) "FvwmGaim")
  *UkkostaButtons: (2x4, Frame 0, \
          Icon 48x48/xmms.png, \
          Action(Mouse 1) "FvwmXmms", \
          Action(Mouse 2) "FvwmMixer")
  *UkkostaButtons: (2x4, Frame 0, \
          Icon 48x48/tux.png, \
          Action(Mouse 1) "FvwmRox")
  *UkkostaButtons: (2x4, Frame 0, \
          Icon 48x48/gimp.png, \
          Action(Mouse 1) "FvwmGimp", \
          Action(Mouse 2) "FvwmXpaint", \
          Action(Mouse 3) "FvwmXfig")
  *UkkostaButtons: (2x4, Frame 0, \
          Icon 48x48/x.png, \
          Action(Mouse 1) "FvwmXlock", \
          Action(Mouse 2) "Restart", \
          Action(Mouse 3) "Quit")
  *UkkostaButtons: (4x8, Frame 0, \
          Swallow FvwmPager 'Module FvwmPager')
  *UkkostaButtons: (1x2, Frame 0, \
          Icon menu/cpumon.png, \
          Action(Mouse 1) 'FvwmTop')
  *UkkostaButtons: (3x2, Frame 0, \
          Swallow(UseOld) "cpumon" `Exec exec xosview -title cpumon +cpu`)
  *UkkostaButtons: (1x2, Frame 0, \
          Icon menu/memmon.png)
  *UkkostaButtons: (3x2, Frame 0, \
          Swallow(UseOld) "memmon" `Exec exec xosview -title memmon +mem`)
  *UkkostaButtons: (1x2, Frame 0, \
          Icon menu/diskmon.png)
  *UkkostaButtons: (3x2, Frame 0, \
          Swallow(UseOld) "diskmon" `Exec exec xosview -title diskmon +disk`)
  *UkkostaButtons: (1x2, Frame 0, \
          Icon menu/netmon.png, \
          Action(Mouse 1) "Exec exec xterm -title iptraf -e 'sudo /usr/sbin/iptraf -i all'")
  *UkkostaButtons: (3x2, Frame 0, \
          Swallow(UseOld) "netmon" `Exec exec xosview -title netmon +net`)
  *UkkostaButtons: (4x4, Frame 0, \
          Swallow FvwmApplet-Sensors `FvwmScript $[fvwm_scrpt]/Sensors 11`)
  *UkkostaButtons: (4x1, Frame 0)

These buttons have about everything I want to see on my desktop in there. On the top I have my computers name and the time, followed by a collection of 'quick launch' buttons. Next I swallow the FvwmPager so I can see what is opened on my desktop. After the pager are a collection of monitors using xosview. Xosview is a collection of system monitors that can display a graphical bar to show the current status. To set this up first I turn off all the monitors by default in .Xdefaults file. Then I swallow one for each monitor I want telling xosview what to display. For example my 'cpumon' is run by the line "Swallow(UseOld) "cpumon" `Exec exec xosview -title cpumon +cpu`". What this does is tell the FvwmButtons to swallow (and use the running app if it exists) an app by the name of cpumon. It then launches xosview, which it told to have the title of cpumon and to turn on the cpu monitor. With this I get four monitors, cpu, memory, disk and network. At the end of my buttons I swallow another FvwmScript by the name of 'Sensors', that takes the output from the sensors command (lm-sensors) and write it to the UkkostaButtons. Here is an image of what these buttons look like.

For the last example, I will share with you a collection of functions that got posted to the fvwm mailing list by Liusd that I have modified. These functions make a one button dock, that will 'Hover' the Icon above the dock when the mouse is moved over it. These functions work fairly well in 2.5.10 (though there is a little bit of choppiness in them). As a note since these functions were posted, a new patch to the CVS tree of FVWM has included HoverIcon and PressIcon support for FvwmButtons configuration. I like the visual look of this a little better than just changing the Icon on a mouse over or mouse click. Reason being is this will actually make a new transparent FvwmButton that can hover above the current button and isn't constrained to the original button's geometry. With that being said, lets look at the collection of functions.

  #####
  # FvwmDock Styles
  ###########
  Style FvwmDock* Sticky, NoTitle, NoHandles, BorderWidth 0, WindowListSkip, \
          CirculateSkip
  Style FvwmDock-* StaysOnBottom, FixedPosition, FixedSize
  Style FvwmDockA* StaysOnTop, FixedSize
  
  ################
  #
  # ButtonDock Functions. These collection of functions create
  #   single icon buttons that cause the button to hover above
  #   everything when the mouse is moved atop of it.  To get these
  #   to work it should only take copying all the five functions
  #   CreateDock, EnterHandler, LeaveHandler, RestoreButton
  #   and CreateActiveButton.  Then call the function 'CreateDock'
  #   for each button on the dock bar. The function works as follows:
  #
  # CreateDock '$0' '$1' '$2' '$3' '$4' '$5' '$6' '$7' '$8' '$9'
  #   $0 -> ButtonId
  #   $1 -> Geometry
  #   $2 -> Icon
  #   $3 -> LargeIcon
  #   $4 -> X offset (from upper left hand corner)
  #   $5 -> Y offset (from upper left hand corner)
  #   $6 -> action for Mouse 1
  #   $7 -> action for Mouse 2
  #   $8 -> action for Mouse 3
  #   $9 -> Size of LargeIcon
  #
  ###################################
  DestroyFunc CreateDock
  AddToFunc CreateDock
  + I DestroyModuleConfig FvwmDock-$0: *
  + I *FvwmDock-$0: Geometry $1
  + I *FvwmDock-$0: Font none
  + I *FvwmDock-$0: Colorset 9
  + I *FvwmDock-$0: Frame 0
  + I *FvwmDock-$0: Padding 0 0
  + I *FvwmDock-$0: (Id D$0, Icon $2)
  + I Module FvwmButtons FvwmDock-$0
  + I AddToFunc StartFunction I Module FvwmAuto 100 -menter 'EnterHandler $0 "$2" $3 $4 $5 $6 $7 $8 $9' 'LeaveHandler $0 $2'
  
  DestroyFunc EnterHandler
  AddToFunc EnterHandler
  + I ThisWindow (FvwmDock-$0) ThisWindow (!FvwmDock-*) Deschedule 35
  + I ThisWindow (FvwmDock-$0) WindowId $[last_winid] (FvwmDockA$0) Deschedule 35
  + I ThisWindow (FvwmDockA$0) Deschedule 45
  + I ThisWindow (FvwmDock-$0) SendToModule FvwmDock-$0 ChangeButton D$0 Icon "shadow.png"
  + I ThisWindow (FvwmDock-$0) CreateActiveButton $0 '$1' $2 $3 $4 $5 $6 $7 $8
  
  # Delay ms should be longer than delay in FvwmAuto
  DestroyFunc LeaveHandler
  AddToFunc LeaveHandler
  + I ThisWindow SetEnv last_winid $[w.id]
  + I ThisWindow (FvwmDockA$0) Schedule 110 35 RestoreButton $0 $1
  + I ThisWindow (FvwmDock-$0) Schedule 110 45 RestoreButton $0 $1
  
  DestroyFunc RestoreButton
  AddToFunc RestoreButton
  + I SendToModule FvwmDock-$0 ChangeButton D$0 Icon $1
  + I KillModule FvwmButtons FvwmDockA$0
  
  DestroyFunc CreateActiveButton
  AddToFunc CreateActiveButton
  + I DestroyModuleConfig FvwmDockA$0: *
  + I *FvwmDockA$0: Pixmap none
  + I *FvwmDockA$0: BoxSize fixed
  + I *FvwmDockA$0: Frame 0
  + I *FvwmDockA$0: Font none
  + I *FvwmDockA$0: Padding 0 0
  + I *FvwmDockA$0: Rows 1
  + I *FvwmDockA$0: Columns 1
  + I ThisWindow PipeRead `echo *FvwmDockA$0: Geometry $8+$(($[w.x]$3))+$(($[w.y]$4))`
  + I *FvwmDockA$0: (Icon $2, Action(Mouse 1) '$5', Action(Mouse 2) '$6', Action(Mouse 3) '$7')
  + I Module FvwmButtons FvwmDockA$0

How these functions work is all you need to do is call the CreateDock function from your StartFunction (or fvwm2rc file) for each icon you want in your dock. As seen above the CreateDock function takes 10 arguments, that tell it what size, icons, and actions you want to bind to the button. For example say you wanted to create a two icon dock with one icon above the other. What you would do is call the CreateDock function twice for both docks, and then use the geometry option to stack the two icons right next to each other. For example I added the two lines to my StartFunction;

  + I CreateDock '10' '56x56-74+62@1' '48x48/firefox.png' '64x64/firefox.png' '-20' '-30' 'FvwmFireFox' 'Nop' 'Nop' '64x64'
  + I CreateDock '11' '56x56-74+116@1' '48x48/xmms.png' '64x64/xmms.png' '+20' '-30' 'FvwmXmms' 'Nop' 'FvwmMixer' '64x64'

This creates two Docks, number 10 and number 11. Then when I move my mouse over one of the Docks, it will replace the current icon with shadow.png and then make a temporary Dock which has the large icon in it. The following three pictures should show how this effect works. Depending on your cpu this may be a little choppy, but all in all I still think it looks good.

Resim:Fvwmdock-1.png Resim:Fvwmdock-2.png Resim:Fvwmdock-3.png

One final note, is all the event handling to make all this effect happen is all setup to run via the StartFunction, so if you don't load these up by the time the StartFunction is run, you'll have to rerun the StartFunction to get it to work.

Diğer Kaynaklar

Kaynak: http://www.zensites.net/fvwm/guide/index.html