Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

A bit Be-like twm

40 views
Skip to first unread message

SUZUKI Hisao

unread,
Nov 11, 2002, 9:40:54 AM11/11/02
to
鈴木です

知らない人は知らないが,知っている人はよく知っていることの一つとして,
X11 の古顔の twm も設定ファイルでかなりの程度カスタマイズ可能です。
もちろん,より複雑なウィンドウマネージャに匹敵する可変性はありませんし,
いまさら twm という話もありますが,どの程度まで「今風」:-) に出来るか,
少し試してみました。

たとえば,Cygwin の X11 をインストールしたが,素の twm はあまりに貧相,
かといって他のウィンドウマネージャはごちゃごちゃしていたり,趣味がケバ
かったりで,お気に召さない場合,これをホームディレクトリに ~/.twmrc と
して置いて twm を使うだけで,それなりに環境が整います ;-)。

Look & Feel がそこはかとなく BeOS のそれに似ているのは決して偶然では
ありません。もちろん,twm の限界により,似せるのは「そこはかとなく」
レベルが精一杯ですし,使いやすさの点では実際かなり劣ります。
それでも水準程度にはなっていると思いますので,是非お試しください。
各設定項目の詳細については twm の man ページを御覧下さい。

使用,修正,流用,再配布は自由です。全くの無保証です。

-------------きりとりせん-------------きりとりせん-------------
NoDefaults

TitleFont "-adobe-helvetica-medium-r-normal--10-*-*-*-p-*-*-*"
MenuFont "-adobe-helvetica-medium-r-normal--12-*-*-*-p-*-*-*"
IconFont "-adobe-helvetica-medium-r-normal--10-*-*-*-p-*-*-*"
IconManagerFont "-adobe-helvetica-medium-r-normal--10-*-*-*-p-*-*-*"
ResizeFont "-adobe-helvetica-bold-r-normal--12-*-*-*-p-*-*-*"

ShowIconManager
UsePPosition "on"
RandomPlacement
NoRaiseOnMove
#NoTitleHighlight
NoGrabServer
RestartPreviousState
DecorateTransients
BorderWidth 3
#ClientBorderWidth

SqueezeTitle
Zoom

Color {
BorderColor "rgb:0/4/4"
BorderTileForeground "grey60"
BorderTileBackground "grey60"
IconBorderColor "grey60"
TitleBackground "grey40"
IconBackground "grey40"
MenuTitleBackground "grey40"
TitleForeground "rgb:e/e/c"
IconForeground "rgb:e/e/c"
MenuTitleForeground "rgb:e/e/c"
IconManagerHighLight "rgb:e/e/c"
MenuBackground "grey75"
IconManagerBackground "grey75"
DefaultBackground "grey75"
DefaultForeground "black"
MenuForeground "black"
IconManagerForeground "black"
}

Pixmaps {
TitleHighlight "black"
}

#
# 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 }

LeftTitleButton "icon" = f.delete
RightTitleButton "xlogo11" = f.iconify
RightTitleButton "grid8" = f.zoom

#
# 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 = : frame : f.resize
Button3 = : frame : f.raise

Button1 = : title : f.function "move-or-raise"
Button2 = : title : f.raiselower
Button3 = : title : f.raiselower

Button1 = : icon : f.function "move-or-iconify"
Button2 = : icon : f.iconify

Button1 = : iconmgr : f.iconify
Button2 = : iconmgr : f.iconify
Button3 = : iconmgr : f.raiselower

#
# And a menus with the usual things
#
menu "defops"
{
"Twm" f.title
"Identify" f.identify
"Iconify" f.iconify
"Resize" f.resize
"Move" f.move
"Raise" f.raise
"Lower" f.lower
"" f.nop
"Focus" f.focus
"Unfocus" f.unfocus
"" f.nop
"Xterm" f.exec "exec xterm &"
"Kterm" f.exec "exec kterm &"
"" f.nop
"Delete" f.delete
"" f.nop
"Restart" f.restart
"Exit" f.quit
}
-------------きりとりせん-------------きりとりせん-------------

-- SUZUKI Hisao

SUZUKI Hisao

unread,
Dec 15, 2002, 4:49:08 AM12/15/02
to
鈴木です

twm をちょっとだけ BeOS のようにする ~/.twmrc ファイルの rootless モード
X サーバ向け改訂版です。

Cygwin の X サーバを XWin -rootless として起動しているときでも使えるように
TWM アイコンマネージャ上のボタン3でメニューを出すようにしました。
アイコンマネージャからアプリケーションの起動と終了もコントロールできるわけで、
BeOS の Deskbar により近付いたといえなくもないです ;^)

アイコンマネージャを画面右上に置いていますが、少し下にさがっているのは、
右上すみに
xclock -geometry 85x85-0+0 -bg AntiqueWhite &
として時計を置いているからです。
座標は ~/.twmrc の IconManagerGeometry の設定で変更できますので、適当に
調整してください。

ちなみに試してみたのは Windows 2000 & XP 上の Cygwin だけです。
# たとえば MacOS X の rootless X サーバ用ウィンドウマネージャとしては
# OroborOSX を使う以上に合理的な選択を知りません :-)
# BeOS 用の rootless X サーバがあったら、とは思います。

------------8<------------8<------------8<------------8<------------
# -*- shell-script -*-
# cf. <XRoot>/lib/X11/twm/system.twmrc

NoDefaults

TitleFont "-adobe-helvetica-medium-r-normal--10-*-*-*-p-*-*-*"
MenuFont "-adobe-helvetica-medium-r-normal--12-*-*-*-p-*-*-*"
IconFont "-adobe-helvetica-medium-r-normal--10-*-*-*-p-*-*-*"
IconManagerFont "-adobe-helvetica-medium-r-normal--10-*-*-*-p-*-*-*"
ResizeFont "-adobe-helvetica-bold-r-normal--12-*-*-*-p-*-*-*"

OpaqueMove
ShowIconManager
IconifyByUnmapping
NoTitle {
"TWM Icon Manager"
}
IconManagerGeometry "85x85-0+120"
UsePPosition "on"
RandomPlacement
NoRaiseOnMove


NoGrabServer
RestartPreviousState
DecorateTransients
BorderWidth 3

SqueezeTitle
Zoom

Pixmaps {
TitleHighlight "black"
}

Button1 = : iconmgr : f.iconify
Button2 = : iconmgr : f.raiselower
Button3 = : iconmgr : f.menu "defops"

#
# And a menus with the usual things
#
menu "defops"
{

#"Twm" f.title
"Identify" f.identify
"Iconify" f.iconify
#"Resize" f.resize
#"Move" f.move


"Raise" f.raise
"Lower" f.lower
"" f.nop
"Focus" f.focus
"Unfocus" f.unfocus
"" f.nop

"Delete" f.delete


"" f.nop
"Xterm" f.exec "exec xterm &"
"Kterm" f.exec "exec kterm &"

"Restart" f.restart
"Exit" f.quit
}
------------8<------------8<------------8<------------8<------------

-- SUZUKI Hisao


0 new messages