2012-02-18 21:29:22| 分类: Linux | 标签:linux twm |字号 订阅
#!/bin/sh xclock -geometry 70x70+5+5 & xterm -geometry +200+200 -fn 7x13 -fg gray -bg black & exec twm
以上表示,所有的窗口的边框颜色为gray50,大致为灰色。括号中间表示特殊的情况,比如第一行意思是:如果窗口的名字为"XTerm",或者它的类名为"XTerm",它的边框颜色就为red。BorderColor "gray50" { "XTerm" "red" "xmh" "green" }
Color { MenuBackground "gray50" MenuForeground "blue" BorderColor "red" { "XTerm" "yellow" } TitleForeground "yellow" TitleBackground "blue" }
"F1" = : all : f.iconify "F2" = : all : f.raiselower "F4" = meta : all : f.delete "F11" = : all : f.fullzoom "F12" = : all : f.warpto "XTerm Icon Manager"
表示当鼠标左键在根窗口上点击的时候,弹出twmWindows菜单,twmWindows是一个菜单的标志符,将在后面说明。Button1 = : root : f.menu "twmWindows"
其中t为title的缩写,f为frame的缩写。其他的上下文也都有缩写。"F1" = shift : t|f : f.raise
LeftTitleButton表示位置,然后是按钮图标的路径,最后是按钮的动作。LeftTitleButton "/usr/X11R6/include/X11/bitmaps/xm_noenter16" = f.delete
menu "LeftClickMenu" { "my menu" f.title "fcitx" f.exec "exec fcitx &" "kill fcitx" f.exec "exec killall fcitx &" "" ("rgb:0/2/4":"rgb:4/b/f") f.nop "Xterm" f.exec "exec xterm -fn 7x13 -fg gray -bg black &" "GNOME Term" f.exec "gnome-terminal &" "FireFox" f.exec "exec firefox &" "Luma QQ" f.exec "exec ~/bin/LumaQQ/lumaqq &" "Gaim" f.exec "exec gaim &" "Time" f.exec "exec xmessage `date +\"%F %R:%S [%u]\"` &" }
Button1表示鼠标左键,root表示根窗口,可以说就是桌面。Button1 = : root : f.menu "LeftClickMenu
IconManager { "XTerm" "=100x5-10+10" 1 }
# # $HOME/.twmrc。 # NoGrabServer RestartPreviousState DecorateTransients TitleFont "-adobe-helvetica-bold-r-normal--*-120-*-*-*-*-*-*" ResizeFont "-adobe-helvetica-bold-r-normal--*-120-*-*-*-*-*-*" MenuFont "-adobe-helvetica-bold-r-normal--*-120-*-*-*-*-*-*" IconFont "-adobe-helvetica-bold-r-normal--*-100-*-*-*-*-*-*" IconManagerFont "-adobe-helvetica-bold-r-normal--*-100-*-*-*" #ClientBorderWidth Color { BorderColor "slategrey" DefaultBackground "rgb:2/a/9" DefaultForeground "gray85" TitleBackground "rgb:2/a/9" TitleForeground "gray85" MenuBackground "rgb:2/a/9" MenuForeground "gray85" MenuBorderColor "slategrey" MenuTitleBackground "gray70" MenuTitleForeground "rgb:2/a/9" IconBackground "rgb:2/a/9" IconForeground "gray85" IconBorderColor "gray85" IconManagerBackground "rgb:2/a/9" IconManagerForeground "gray85" } # # Define some useful functions for motion-based actions. # MoveDelta 3 Function "move-or-lower" { f.move f.deltastop f.lower } Function "move-or-raise" { f.move f.deltastop f.raise } Function "move-or-iconify" { f.move f.deltastop f.iconify } # # Set some useful bindings. Sort of uwm-ish, sort of simple-button-ish # Button1 = : root : f.menu "defops" Button1 = m : window|icon : f.function "move-or-lower" Button2 = m : window|icon : f.iconify Button3 = m : window|icon : f.function "move-or-raise" Button1 = : title : f.function "move-or-raise" Button2 = : title : f.raiselower Button1 = : icon : f.function "move-or-iconify" Button2 = : icon : f.iconify Button1 = : iconmgr : f.iconify Button2 = : iconmgr : f.iconify "F4" = meta : all : f.delete # # And a menus with the usual things # menu "defops" { "Twm" f.title "Iconify" f.iconify "Resize" f.resize "Move" f.move "Raise" f.raise "Lower" f.lower "" f.nop "Focus" f.focus "Unfocus" f.unfocus "Show Iconmgr" f.showiconmgr "Hide Iconmgr" f.hideiconmgr "" f.nop "Xterm" f.exec "exec xterm &" "" f.nop "Kill" f.destroy "Delete" f.delete "" f.nop "Restart" f.restart "Exit" f.quit }