菜鸟 设置 twm/vtwm 的心得
终于把vtwm的设置搞定了呵呵其实twm/vtwm设置好了还是蛮好看的 :mrgreen:
下面分享一下心得
要想配置twm/vtwm
只要在/root (/home/username/)下新建一个 文件即可 (twm是.twmrcvtwm是.vtwmrc)
如果配置失误,删除这个文件就可以了,这样系统 将使用默认配置文件
默认配置文件的路径可以用 man twm 察看
下面是我的配置文件 .vtwmrc
(注:由于 twm和vtwm细小差别.部分配置选项可能在twm中出现异常,这个文件在vtwm中运行正常####表示vtwm专有的)
#
# Variables
#
NoGrabServer
RestartPreviousState
NoDefaults
ShowIconManager
SortIconManager
IconifyByUnmapping
RightHandSidePulldownMenus
NaturalAutoPanBehavior
NotVirtualGeometries
FixManagedVirtualGeometries
FixTransientVirtualGeometries
ButtonColorIsFrame
ShallowReliefWindowButton
SunkFocusWindowTitle
MoveDelta 3
ResizeRegion "NorthEast"
BorderWidth 6
BorderBevelWidth 2
ButtonBevelWidth 1
DoorBevelWidth 1
IconBevelWidth 2
IconManagerBevelWidth 1
InfoBevelWidth 2
MenuBevelWidth 2
TitleBevelWidth 1
VirtualDesktopBevelWidth 1
ClearBevelContrast 40
DarkBevelContrast 40
VirtualDesktop "5x2-0-0" 16
PanDistanceX 100
PanDistanceY 100
PanResistance 750
AutoPan 100
#字体设定 改成 -simsun-medium-r-*-*-14-*-*-*-*-*-*-* 应该可以显示中文 没试过:-(
TitleFont "-adobe-helvetica-bold-r-normal--*-120-*-*-*-*-*-*"
ResizeFont "-adobe-helvetica-bold-r-normal--*-120-*-*-*-*-*-*"
MenuFont "-adobe-helvetica-bold-r-normal--*-120-*-*-*-*-*-*"
MenuTitleFont "-adobe-helvetica-bold-r-normal--*-120-*-*-*-*-*-*"
DoorFont "-adobe-helvetica-bold-r-normal--*-100-*-*-*-*-*-*"
IconFont "-adobe-helvetica-bold-r-normal--*-100-*-*-*-*-*-*"
InfoFont "-adobe-helvetica-bold-r-normal--*-100-*-*-*-*-*-*"
IconManagerFont "-adobe-helvetica-bold-r-normal--*-100-*-*-*-*-*-*"
VirtualDesktopFont "-adobe-helvetica-medium-r-normal--*-75-*-*-*-*-*-*"
#
# Lists
#
SqueezeTitle
WarpCursor
#####下面的是vtwm专用的,因为vtwm比twm多了个虚拟桌面
#####这里设置的是移动虚拟桌面时,不一起移动的程序
NailedDown
{
"VTWM *"
"xclock"
"xload"
}
#这里是不显示标题的程序
NoTitle
{
"VTWM *"
"xclock"
"xload"
"Panel"
}
#####不在任务管理器里显示的程序
DontShowInDisplay
{
"VTWM *"
"xclock"
"xload"
}
#不在图标管理器里显示的程序
IconManagerDontShow
{
"VTWM *"
"xclock"
"xload"
}
#颜色设置我想这是大多数人想要的吧
#粉红色=maroon
#gray是灰色,后面的数字是深浅
Color
{
DefaultBackground "maroon"#默认背景颜色
DefaultForeground "gray85"#默认前景颜色
BorderColor "grey70"#边框颜色
BorderTileBackground "gray60"#窗口标题边框背景颜色
BorderTileForeground "gray60"#窗口标题边框前景颜色
DoorBackground "maroon"
DoorForeground "gray85"
TitleBackground "maroon"#窗口标题背景颜色
TitleForeground "gray85"#窗口标题前景颜色
MenuBackground "gray85"#菜单背景
MenuForeground "black" #菜单前景
MenuTitleBackground "gray70"
MenuTitleForeground "black"
IconBackground "maroon"#图标背景
IconForeground "gray85"#图标前景
IconBorderColor "gray85"#图标边框
IconManagerBackground "gray60"#图标管理器背景
IconManagerForeground "black" #图标管理器前景
VirtualBackground "white" ####虚拟桌面背景
VirtualForeground "black" ####虚拟桌面前景
DesktopDisplayBackground "grey60"
DesktopDisplayForeground "grey85"
}
Monochrome
{
DefaultBackground "gray50"
DefaultForeground "gray85"
BorderColor "grey70"
BorderTileBackground "gray60"
BorderTileForeground "gray60"
DoorBackground "gray50"
DoorForeground "gray85"
TitleBackground "gray50"
TitleForeground "gray85"
MenuBackground "gray50"
MenuForeground "gray85"
MenuTitleBackground "gray70"
MenuTitleForeground "gray50"
IconBackground "gray50"
IconForeground "gray85"
IconBorderColor "gray85"
IconManagerBackground "gray50"
IconManagerForeground "gray85"
VirtualBackground "gray50"
VirtualForeground "black"
DesktopDisplayBackground "grey60"
DesktopDisplayForeground "grey85"
}
#
# Functions and Bindings
#
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 }
LeftTitleButton ":xpm:bar" = f.menu "arrange"
RightTitleButton ":xpm:dot" = f.iconify
RightTitleButton ":xpm:resize" = f.resize
#Button1 = : root : f.version #左键单击桌面引发的操作
Button3 = : root : f.menu "main"#右键单击桌面引发的操作
Button1 = : title : f.function "move-or-raise"
Button3 = : title : f.lower
Button1 = : frame : f.function "move-or-raise"
Button2 = : frame : f.resize
Button3 = : frame : f.iconify
Button1 = : door : f.enterdoor
Button2 = : door : f.namedoor
Button3 = : door : f.deletedoor
Button1 = : icon : f.function "move-or-iconify"
Button3 = : icon : f.menu "arrange"
Button1 = : iconmgr : f.iconify
Button3 = : iconmgr : f.warp
Button1 = : virtual | desktop : f.movescreen
#
# 菜单
#
#主菜单
menu "main"
{
"VTWM" f.title #标题
"System tools" f.menu "tools" #菜单项
"Multimedia" f.menu "media"
"Internet" f.menu "internet"
"Programming" f.menu "pro"
"Office" f.menu "office"
"File manager" f.menu "fm"
"Editor" f.menu "editor"
"Games" f.menu "game"
"" f.separator #分隔符
"mnt" f.menu "mnt"
"" f.separator
"Operations" f.menu "ops"
"Arrange" f.menu "arrange"
"" f.separator
"Power" f.menu "power"
"" f.separator
"Restart" f.restart #重起桌面
"Exit" f.quit #退出桌面
}
#子菜单项
menu "internet"
{
"Opera" f.exec "opera &" #执行命令 (注意:一定要加 &)
"Mozilla" f.exec "mozilla &"
}
menu "editor"
{
"Gedit" f.exec "gedit &"
}
menu "game"
{
"Lines" f.exec "glines &"
"Same GNOME" f.exec "same-gnome &"
"Mines" f.exec "gnomine &"
}
menu "fm"
{
"Rox" f.exec "rox &"
}
menu "office"
{
"AbiWord" f.exec "abiword &"
}
menu "tools"
{
#"Tools" f.title
"Xclock" f.exec "xclock -d &"
"Xload" f.exec "xload &"
"Xterm" f.exec "xterm &"
"System monitor" f.exec "gnome-system-monitor &"
"Stardict" f.exec "stardict &"
}
menu "media"
{
#"Multimedia" f.title
"Realplay" f.exec "realplay &"
"Xmms" f.exec "xmms &"
"CD player" f.exec "gnome-cd &"
}
menu "pro"
{
#"Programming" f.title
"Glade-2" f.exec "glade-2 &"
}
menu "mnt"
{
"mount U" f.exec "mount_msdosfs /dev/da0s1 /mnt/u"
"umount U" f.exec "umount /mnt/u"
"" f.separator
"mount floppy" f.exec "mount_msdosfs /dev/fd0 /mnt/floppy"
"umount floppy" f.exec "umount /mnt/floppy"
}
menu "power"
{
"Notice!" f.title
"reboot" f.exec "reboot"
"halt -p" f.exec "halt -p"
}
menu "ops"
{
#"Operations" f.title
"Auto Pan" f.autopan
"New Door" f.newdoor
"Snap Screen" f.snaprealscreen
"Static Icons" f.staticiconpositions
"Warp Snug" f.warpsnug
"Warp Visible" f.warpvisible
"" f.separator
"Show Icon Mgr" f.showiconmgr
"Hide Icon Mgr" f.hideiconmgr
"Show Desktop" f.showdesktopdisplay
"Hide Desktop" f.hidedesktopdisplay
"" f.separator
"Refresh" f.refresh
}
menu "arrange"
{
#"Arrange" f.title
"Autoraise" f.autoraise
"Raise" f.raise
"Lower" f.lower
"Nail" f.nail
"" f.separator
"Move" f.move #移动
"Size" f.resize #调整大小
"Iconify" f.iconify
"" f.separator
"Full Zoom" f.fullzoom
"Horiz Zoom" f.horizoom
"Vert Zoom" f.zoom #缩放
"" f.separator
"Left Title" f.squeezeleft
"Center Title" f.squeezecenter
"Right Title" f.squeezeright
"" f.separator
"Identify" f.identify #程序ID
"" f.separator
"Delete" f.delete #关闭
"Destroy" f.destroy #杀死
}
第一次写心得
希望大家 勘错 什么是twm?? 帮你顶 顶.... :mrgreen: 什么是twm??
一个很好用 很高效的窗口管理器 不错,我也想用的,可就是不会配置。 我也在用twm,有几个问题
1 标题栏怎样让他与窗口一样长?
2 怎样让图标不显示问号?
3 能不能一直显示一个菜单,可以随时点击,功能象正常桌面上的图标?
4 功能键的设置不明白,组合键怎么表示? 还有下面的"mod5" "window|icon|frame|title"
不知道什么意思,望指教
"<F10>" = mod5 : all : f.backiconmgr
Button1 = m : window|icon|frame|title : f.lower 我修改的一个.twmrc
#**********************************************************************
#
# .twmrc
#
#**********************************************************************
#IconDirectory "/users/jim/icons" # use *bitmapFilePath instead.
#
# Use the SHAPE extension to make titles use as little space as possible.The
# location of the titles is specified as a fraction of the distance from the
# left (numerator positive) or right edge (numerator negative).A denominator
# of 0 indicates that the numerator is measured in pixels.The title is then
# justified over the indicated spot (note special cases are made for center on
# 0/0 and right on 0/0 to indicate the center and right edge of the titlebar).
#
SqueezeTitle # also sets default to Squeeze all Titles
{
# name justify num denom
"oclock" center 00 # centered over middle of title
"XTerm" left 00 # left edge of title
"xlogo" right 00 # for kicks
}
DontSqueezeTitle
{
"XLogout" # make it stand out when mapped
}
#oDefaults # turn off iconify and resize button
LeftTitleButton "menu12" = f.delete # add a menu to each window
LeftTitleButton "menu13" = f.fullzoom
TitleButtonBorderWidth 1 # don't want to see box around button
ButtonIndent 1 # button doesn't have to be smaller
UsePPosition "on" # use program-specified size hints accepted
NoHighlight # do not flash borders on enter events
OpaqueMove # actually move window instead of outline
AutoRelativeResize # don't require resize to cross border to start
RestartPreviousState # reiconify iconified things on startup
ClientBorderWidth # use the application border width on frame
BorderWidth 2 # width of top level windows created by twm
NoGrabServer # don't grab server during menus, etc.
NoRaiseOnMove # allow moving under other windows
NoRaiseOnResize # allow resizing under other windows
NoTitleFocus # avoid keystrokes in wrong window cause of lag
DecorateTransients # put titlebars on transients
TitleFont "-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-*-*-*"
ResizeFont "-adobe-helvetica-bold-r-normal--*-120-*-*-*"
NoSaveUnders # faster to just repaint then save
XORvalue 1 # tend to use visually distinct adjacent colors
ConstrainedMoveTime 0 # turn off horizontal/vertical only moving
NoCaseSensitive # turn off case-sensitivity in sorting icons
WarpUnmapped # allow warping to unmapped windows
###############################################################################
# #
# Declare some nice colors #
# #
###############################################################################
Pixmaps
{
# TitleHighlight "solid4x4" # make it stand out
}
Color
{
DefaultBackground "black"
DefaultForeground "wheat"
BorderColor "gray70"
TitleBackground "maroon"
TitleForeground "gray85"
MenuBackground "maroon"
MenuForeground "gray85"
MenuTitleBackground "gray70"
MenuTitleForeground "maroon"
IconBackground "maroon"
IconForeground "gray85"
IconBorderColor "gray85"
IconManagerBackground "maroon"
IconManagerForeground "gray85"
}
Monochrome
{
IconManagerHighlight"white"
BorderColor "black"
}
###############################################################################
# #
# Define key bindings #
# #
###############################################################################
MoveDelta 3 # need to move this much before takes effect
Function "move-or-raise" # simulate uwm action
{
f.move
f.deltastop
f.raise
}
DefaultFunction f.nop # ignore extraneous events
Button1 = : root : f.menu "twmroot"
Button2 = : root : f.menu "windowops"
Button3 = : root : f.menu "TwmWindows"
Button1 = : title : f.function "move-or-raise"
Button1 = : icon : f.iconify
Button1 = : iconmgr : f.iconify
Button1 = m : window|icon|frame|title : f.lower
Button2 = m : window : f.resize
Button3 = m : window|icon|frame|title : f.function "move-or-raise"
Button1 = c|m|s : all : f.menu "twmops"
#Button1 = c|m|s : root : f.refresh
#"F20" = : all : f.warptoscreen "next"
"F1" = : all : f.warpring "next"
"F2" = : all : f.warpring "prev"
"F3" = : all : f.warpto "xterm"
"F4" = : all : f.warpto "emacs"
"F5" = : all : f.warptoiconmgr ""
"F6" = : all : f.raiselower
"<F7>" = mod5 : all : f.colormap "prev"
"<F8>" = mod5 : all : f.colormap "next"
"<F9>" = mod5 : all : f.colormap "default"
"<F10>" = m : all : f.backiconmgr
"<F11>" = m : all : f.forwiconmgr
"<F12>" = m : all : f.upiconmgr
"Down" = m : all : f.downiconmgr
"Left" = mod5 : all : f.warpring "prev"
"Right" = mod5 : all : f.warpring "next"
###############################################################################
# #
# Display an icon manager across the top of the screen.Don't manage #
# the windows for which you don't show a title. #
# #
###############################################################################
SortIconManager # keep them in alphabetic order
ShowIconManager # start with iconmgr up
IconManagerGeometry "700x50+246+2" 14 # strip across top
IconRegion "200x300+950+2" North East 50 50
IconifyByUnmapping # just use icon manager
IconManagerDontShow # but ignore these windows
{
"xclock"
"xbiff"
"xload"
"oclock"
"xcutsel"
}
DontIconifyByUnmapping # don't lose them (still in TwmWindows menu)
{
"xclock"
"xbiff"
"xload"
"oclock"
"xcutsel"
"Untitled"
}
NoTitle # little programs that look like icons
{
"xclock"
"xbiff"
"xload"
"TWM Icon Manager"
"xcutsel"
}
NoStackMode # prevent hostile clients from hosing display
{
"saber"
}
WindowRing # f.warpring acts along these windows
{
"XTerm"
"emacs"
"Xmh"
}
###############################################################################
# #
# Define some useful menus. #
# #
###############################################################################
menu "twmroot"
{
"System" f.title
"xterm" !"xterm -bg black -fg wheat -fn a14&"
"mozilla" !"/usr/bin/mozilla &"
"gaim" !"/usr/bin/gaim &"
"emacs" !"/usr/bin/emacs -bg black -fg wheat&"
"relplay" !"/usr/bin/realplay &"
"gimp" !"/usr/bin/gimp &"
"gthumb" !"/usr/bin/gthumb &"
"june" f.title
"windowops" f.menu "windowops"
"Restart Twm" f.restart
"Exit Twm" f.quit
"Logout" f.warpto "xlogout"
}
menu "windowops"
{
"Windows" f.title
"Kill" f.menu "kill"
"Save" f.saveyourself
"Restart twm" f.restart
"june" f.title
"xterm" !"xterm -bg black -fg wheat -fn a14 &"
"Resize" f.resize
"Move" f.move
"exit twm" f.quit
"Lower" f.lower
"Info" f.identify
"Focus" f.focus
"Unfocus" f.unfocus
}
menu "windowmenu"
{
"Iconify" f.iconify
"fullzoom" f.fullzoom
"Resize" f.resize
"exit" f.delete
"Kill" f.menu "kill"
}
menu "kill"
{
"Send Delete" f.delete
"Kill Window" f.destroy
}
页:
[1]