AfterStep Wharf Tutorial

From AfterWiki
Revision as of 12:02, 25 January 2008 by Vaevictus (talk | contribs) (New page: == Introduction == This article includes an actual Wharf configuration script. You can download this script [http://wiki.afterstep.org/images/5/51/Wharf.tutorial.txt HERE]. Copy or save ...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Introduction

This article includes an actual Wharf configuration script. You can download this script HERE. Copy or save this script as "wharf" to the ".afterstep/" folder in you $HOME directory (~/.afterstep/). Once installed, you can stop the current default Wharf via the Menu (Left click on the Desktop):

Modules --> Stop Running Module --> Wharf

Then restart Wharf via the Menu (Left click on the Desktop):

Modules --> Wharf

Once installed and running, you can edit the script, stop and restart as done above, and familiarize yourself with Wharf.

If you make an error or things quit working, just delete the file ~/.afterstep/wharf, and restart again, letting the system default Wharf script run.

Example AfterStep Wharf Configuration

# Welcome to the Wharf Example Configuration Script!  This is a an actual
# functioning wharf configuration file; it provides a detailed tour of fuctions
# within wharf.  Use it and the examples contained within to create your own
# customized configurations.
#
# Copy the file "wharf" located in /usr/share/afterstep or
# /usr/local/share/afterstep to ~/.afterstep/ (the .afterstep/ directory
# created in your home folder by AfterStep when it started). You can edit the
# file once it's placed in that directory.  Edit the new script in ~/.afterstep/
# to your heart's content.
#
# You can have as many "Wharfs" as you like (subject to display limitations) in
# this script. Each Wharf must have its own name (*Wharf, *MonitorWharf,
# *ApplicationsWharf, etc.) and is comprised of three parts: a View/Behaviors
# area, a Styles area, and an Applets/Icons area.
#
# View/Behaviors - The basic visual look and behavior of the Wharf as it sits on
#	the desktop.
#
# Styles -  More detailed visual functions including the wharf tiles and fonts.
#
#
# Applets/Icons - The applications displaying information and/or allowing
#	control while sitting in the Wharf; buttons displaying icons that
#	launch applications when pressed with a mouse pointer.
#
# To have the indiviual Wharfs (*Wharf, *MonitorWharf, etc.) launch when
# starting AfterStep, edit the autoexec file copied to the ~/.afterstep/ and
# ensure that each Wharf is added.

################################################################################
# BEGIN *Wharf View/Behaviors
#+------------------------------------------------------------------------------
#|Animate - Opening and closing of Folders will be animated, rather than drawn
#|	in one frame. Disabling Animate disables AnimateDelay and AnimateSteps.
#|
#|	AnimateDelay - Delay in milliseconds that the animation will pause
#|		between each move when opening or closing a folder.
#|
#|	AnimateSteps - Steps a Folder takes in animating while opening or
#|		closing. This translates into the  Folder button moving
#|		button-size/steps pixels each step.
#+------------------------------------------------------------------------------
*WharfAnimate
	*WharfAnimateDelay	100
	*WharfAnimateSteps	10

#+------------------------------------------------------------------------------
#|AnimateMain - Full-length Wharf withdraws will be animated. Disabling
#|	AnimateMain disables AnimateStepsMain.
#|
#|	AnimateStepsMain - Number of steps the main Wharf takes in iconification
#|		or de-iconification upon mouse button 3 being pressed. This
#|		translates into the main Wharf moving <button-size>/steps pixels
#|		each step.
#+------------------------------------------------------------------------------
*WharfAnimateMain
	*WharfAnimateStepsMain	10

#+------------------------------------------------------------------------------
#|Balloons - Turns on the balloon feature. A "balloon" is displayed showing the
#|	name of the button the pointer is resting on in the Wharf. The balloon
#|	background and text are configured with the MyStyle "*WharfBalloon".
#|	Disabling Balloons disables all the aforementioned balloon features.
#|
#|	BalloonXOffset - The balloon window is positioned to be horizontally
#|		centered against the Wharf button it is describing. The
#|		horizontal position may be offset. Negative offsets of -N are
#|		placed N pixels left of the Wharf window, positive offsets of
#|		+N are placed N pixels right of the window. Defaults to +2.
#|
#|	BalloonYOffset - The balloon window is positioned to be vertically
#|		centered against the Wharf button it is describing. The
#|		vertical position may be offset. Negative offsets of -N are
#|		placed N pixels above the Wharf window, positive offsets of +N
#|		are placed N pixels below. Defaults to +2.
#|
#|	BalloonDelay - Period in milliseconds to delay the appearance of the
#|		balloon when touching the button with the mouse.
#|
#|	BalloonCloseDelay - Period in milliseconds to delay the disappearance
#|		of the balloon when leaving the button with the mouse.
#|
#|	BalloonStyle - MyStyle to be used to draw balloon. Note that balloons
#|		can be shaped (BackPixmap 125 and 126).
#|
#|	BalloonBorderHilite - Bevel to be drawn around balloons - replaces the
#|		BorderWidth setting.
#+------------------------------------------------------------------------------
*WharfBalloons
	*WharfBalloonXOffset		10
	*WharfBalloonYOffset		-15
	*WharfBalloonDelay		120
	*WharfBalloonCloseDelay		1200
	*WharfBalloonStyle		"*WharfBalloon"
	*WharfBalloonBorderHilite	Right,Bottom

#+------------------------------------------------------------------------------
#|WithdrawStyle - Circumstances under which the 3rd mouse button will cause the
#|	Wharf to withdraw to a corner. If style is 0, button 3 will do nothing.
#|	If style is 1 (the default), a click on any button in the toplevel bar
#|	will cause Wharf to withdraw to the nearest corner. If style is 2, a
#|	click on either the first or the last button in the toplevel bar will
#|	cause the withdrawal.
#+------------------------------------------------------------------------------
#*WharfWithdrawStyle 0

#+------------------------------------------------------------------------------
#|CompositionMethod - Algorithm used to blend all the icons and Wharf background
#|	to form the button's image. Valid values are 130-145 (check the MyStyles
#|	section in the on-line docs). Default value is 131 (alpha-blending).
#+------------------------------------------------------------------------------
#*WharfCompositionMethod

#+------------------------------------------------------------------------------
#|Bevel -OR- NoBorder - If both are active, Wharf uses the last listed.
#|
#|Bevel - Exact size and shape of the 3D bevel drawn around each button. This
#|	option is somewhat synonymous to NoBorder. Options are:
#|	Left, Top, Right, Bottom, Extra, NoOutline
#|
#|NoBorder - Beveled borders are not drawn around the button frame and titlebar.
#+------------------------------------------------------------------------------
*WharfBevel		Bottom,Right,NoOutline,Extra
#*WharfNoBorder

#+------------------------------------------------------------------------------
#|FitContents & ShapeToContents, -OR- AlignContents
#|
#|FitContents - Draw each button so that it fits its contents perfectly (icon
#|	or swallowed applet). That will cause some of the Wharf's buttons to
#|	differ in size from others. Use in conjunction with  ShapeToContents .
#|
#|ShapeToContents - Use X-Shaped extentions and have a non-rectangular shaped
#|	button. Shape is composed from the overall geometry of buttons (see
#|	FitContents), shape of the MyStyle used to draw Wharf background (if
#|	BackPixmap 126 or 125 is used), contents of each button - such as
#|	swallowed app's shape, label and icons.
#|
#|AlignContents - Force contents of each Wharf's button to be aligned to either
#|	side of the button, when FitContents is not used. Options are:
#|	Left, Top, Right, Bottom, HTiled, VTiled, HScaled, VScaled, HCenter,
#|	VCenter
#+------------------------------------------------------------------------------
#*WharfFitContents
#*WharfShapeToContents
#*WharfAlignContents Left

#+------------------------------------------------------------------------------
#|ShowLabel - Render a label on each of its buttons, effectively immitating the
#|	behaviour of the discontinued Zharf module .
#|
#|	LabelLocation - Location of the label. Correct values are integers from
#|		0-32. Label can be drawn on each side of the button and just on
#|		top of the icon. It can also be aligned to different sides.
#|
#|	FlipLabel - Will cause Wharf to draw vertical label text.
#+------------------------------------------------------------------------------
#*WharfShowLabel
#	*WharfLabelLocation
#	*WharfFlipLabel

#+------------------------------------------------------------------------------
#|ForceSize - Forces the Wharf buttons to a specified size rather than the
#|	default size of 64x64.  Note that this does not re-size the actual icon
#|      image; the image is cropped to the dimensions specified by ForceSize.
#+------------------------------------------------------------------------------
#*WharfForceSize 32x32

#+------------------------------------------------------------------------------
#|Rows -OR- Columns - Only Rows or Columns should be specified
#|
#|Rows - Number of rows of buttons to be created. This will give your Wharf a
#|	horizontal layout, with the number of rows equal to the number specified
#|	in rows. If unspecified, the number of rows will be set to 1. If the
#|	rows are set to a number greater than 1, then there will be that number
#|	of rows with enough columns to satisfy the requested number of buttons.
#|
#|Columns - Number of columns of buttons to be created. This will give your
#|	Wharf a vertical layout, with the number of columns equal to the number
#|	specificed in columns. If unspecified, the number of columns will be set
#|	to 1. If the columns are set to a number greater than 1, then there will
#|	be that number of columns with enough rows to satisfy the requested
#|	number of buttons.
#+------------------------------------------------------------------------------
*WharfRows		1
#*WharfColumns		1

#+------------------------------------------------------------------------------
#|Geometry - Wharf window location and/or size. If the size is not specified,
#|	Wharf will auto-size itself in a reasonable manner. The geometry is a
#|	standard X11 window geometry specification. Options:
#|	+x+y, +x-y, -x+y, -x-y
#|
#|	+x (+y) means from the left (top) x (y) pixels
#|	-x (-y) means from the right (bottom) x (y) pixels
#+------------------------------------------------------------------------------
*WharfGeometry		+5+30
#
# END *Wharf View/Behaviors

################################################################################
# BEGIN *Wharf Styles
#
# VERY IMPORTANT STUFF!!!  MyStyle information is generally located in a
# ~/.afterstep/looks/look.anyname file, where look.anyname is a file
# created with font and visual information for wharf, winlist, pager, menus,
# and other AfterStep configurations.  Putting this information in the look file
# is a great way of creating themes that can change an entire desktop
# on-the-fly.  The look file is the preferred location for MyStyle data.
#
# Putting MyStyle information directly in wharf will over-ride the look file
# wharf options.  Why do it?  If you desire wharf to consistently look a certain
# way with a certain font or tile, this is the place to keep MyStyle data for
# wharf. 
#
# The information provided in this example is rather "light" concerning the
# MyStyle specification.  Please consult the AfterStep documentation either
# included with the AfterStep distribution or the on-line docs at
# www.afterstep.org.
#
# Each MyStyle begins with "MyStyle" and ends with "~MyStyle".  Edit
# the lines between these statements.
#
#+------------------------------------------------------------------------------
#!Balloon - This refers to the previuosly listed "Balloons", specifically
#!	"*WharfBalloonStyle".
#!
#!	Inherit - Specifies a MyStyle to inherit options from. Options from
#!		style_name will override previously specified options for this
#!		style. Inherit is a good way to save memory and network
#!		bandwidth if the same BackPixmap is used for several styles, as
#!		the pixmap will only be loaded for the inherited style.
#+------------------------------------------------------------------------------
#MyStyle "*WharfBalloon"
#	Inherit "TitleButtonBalloon"
#~MyStyle

#+------------------------------------------------------------------------------
#!Tile - Specifies the style of the wharf button tiles, including background
#!	color, background pixmap (which may be transparent), and background
#!	gradient. This method of specifying the background is preferred over the
#!	BgColor, MaxColors, Pixmap, TextureColor, and TextureType options,
#!	although those (older) options do still work. See MyStyle format for
#!	details.
#!
#!FocusedTile - Specifies the style of the wharf button tile under the mouse
#!	pointer, including background color, background pixmap (which may be
#!	transparent), and background gradient. See MyStyle format for details.
#!
#!	Font - Specifies the font associated with this style. font could be
#!		either a standard X11 font definition, or a filename of the
#!		TrueType font that could be found in FontPath. To specify the
#!		size of the TrueType font - use a format like:
#!
#!		FontName.ttf-Size.
#!
#!	ForeColor - Specifies the text color associated with this style. "Color"
#!		is color definition in one of the color formats supported by
#!		AfterStep.
#!
#!	BackColor - Specifies the background color associated with this style.
#!		"Color" is color definition in one of the color formats
#!		supported by AfterStep.
#!
#!		BackColor is also used to calculate bevel colors used to draw a
#!		border around a widget.
#!
#!	BackGradient - Specifies that a gradient should be used as a background
#!		instead of a solid color. The gradient colors start at "from"
#!		and end at "to". "From" and "to" are color definition in one of
#!		the supported color formats. If gradient includes at least one
#!		transparent color (alpha value set to be below FF), gradient
#!		will be alpha -blended over the root background image. type can
#!		be 1, 2, 3, 4, or 5:
#+------------------------------------------------------------------------------
#MyStyle "*WharfTile"
#	Font 	       DefaultSansOblique.ttf-12
#	ForeColor      InactiveText2
#	BackColor      Inactive2
#	BackGradient   6 alpha(20,Inactive2Dark) alpha(30,Inactive2Light)
#~MyStyle
#
#MyStyle "*WharfFocusedTile"
#	Font 	       DefaultSansOblique.ttf-12
#	ForeColor      ActiveText
#	BackColor      Active
#	BackGradient   6 ActiveDark ActiveLight
#~MyStyle
#
# END *Wharf Styles

################################################################################
# BEGIN *Wharf Applets/Icons
#+------------------------------------------------------------------------------
#|Applets/Icons
#|
#|The basic format for for launching applications from a given is:
#|	*Wharf buttonname iconname Exec "windowname" application options &
#|
#|The basic format for "swallowing" an Applet is:
#|	*Wharf buttonname - Swallow "windowname" applet options &
#|
#|A given Wharf can only one button with a given name. When Wharf sees more than
#|	one button with a given name, it only uses the first it finds. This is a
#|	benefit as shown below. To avoid this behavior, either change the button
#|	name or change the order to that which is preferable.
#|
#|The basic format for folders within Wharf is:
#|	*Wharf foldername iconname Folder
#|		*Wharf 	applet/iconbutton
#|		*Wharf 	applet/iconbutton
#|	*Wharf ~Folder
#|
#|Custom Icons should be placed in the user's home directory in:
#|	~/.afterstep/desktop/icons
#|
#|Give the icons unique names (names other than those installed by AfterStep).
#|	Appending -custom.png to the end of the name works nicely.
#|
#|Separate actions can be bound to different mouse buttons:
#|	"l" - left, "m" - middle, "r" - right, "4" and "5" for other buttons.
#|
#|	On the following example, left click opens docs, while right click opens
#|		StartMenu : 
#|
#|		*Wharf afterstepdoc large/AfterStep3 Exec  "l" afterstepdoc &
#|		*Wharf afterstepdoc -                PopUp "r" 0
#+------------------------------------------------------------------------------

# First available Terminal : 
*Wharf term aterm Exec "-" aterm &
*Wharf term rxvt  Exec "-" rxvt  -tr -fg yellow -bg black &
*Wharf term eterm Exec "-" Eterm -O --tint blue -fg yellow -bg black &
*Wharf term xterm Exec "-" xterm -fg yellow -bg blue &

# First available GUI Web Browser :
*Wharf WebBrowser normal/WWW    Exec x-www-browser &
*Wharf WebBrowser logos/Firefox Exec "Firefox" firefox &
*Wharf WebBrowser logos/Firefox Exec "Firefox2" mozilla-firefox &
*Wharf WebBrowser logos/mozilla Exec "Mozilla" mozilla &
*Wharf WebBrowser logos/Opera   Exec "Opera Web Browser" opera &
*Wharf WebBrowser normal/WWW    Exec sensible-browser &

# First available GUI e-mail client :
*Wharf Mail normal/MailBox2 Exec "mozilla-mail" mozilla --mail &
*Wharf Mail normal/MailBox2 Exec "mozilla-thunderbird"  mozilla-thunderbird &
*Wharf Mail normal/MailBox2 Exec "kmail" kmail &
*Wharf Mail normal/MailBox2 Exec "balsa" balsa &
*Wharf Mail normal/MailBox2 ExecInTerm "Pine" -title "Pine e-mail and news reader" -e pine &
*Wharf Mail normal/MailBox2 ExecInTerm "Mutt" -title "Mutt e-mail reader" -geometry 120x36 -e mutt -y &

# First available GUI text editor :
*Wharf TextEditor Text.xpm Exec "NEdit" nedit &
*Wharf TextEditor Text.xpm Exec "cooledit" cooledit --look next &
*Wharf TextEditor logos/GNU Exec "XEmacs" xemacs &
*Wharf TextEditor Text.xpm Exec "VIM" gvim &

# Left and right mouse buttons perform different task. Both are bound to the
# 	same button, "afterstepdoc"
*Wharf afterstepdoc large/AfterStep3 Exec  "l" afterstepdoc &
*Wharf afterstepdoc -                PopUp "r" 0

#Another Mouse binding example.
*Wharf xeyes - Swallow "xeyes" xeyes -geometry -100-100 &
*Wharf xeyes - PopUp   "r" Window

# Folder example. You can have folders within folders.  Sky's the limit.
# Each folder will need the lines with "Folder" and "~Folder".
*Wharf ToolsFolder normal/Desktop,normal/HammerBrown,normal/HammerRed,dots/3_dots Folder
	*Wharf 	ASWallpaper normal/Desktop 		Exec "" ASWallpaper &
	*Wharf 	GWCommand   normal/RemoteControl 	Exec "" GWCommand &
*Wharf ~Folder

# Another example of mouse button bindings.
*Wharf xeyes - Swallow "xeyes" xeyes -geometry -100-100 &
*Wharf xeyes - PopUp   "r" Window

# Another example of a Folder
*Wharf QuitFolder normal/RedLight,dots/3_dots Folder
	*Wharf 	Recycler normal/Recycle Restart "" afterstep -r
	*Wharf 	Quit normal/Stopsign Quit "" afterstep
*Wharf ~Folder

# First available GUI text editor :
# Note how this works - only one of the first 4 listings is grabbed.
# With the last two listings, a right-clight on the above found clock will
#	launch evolution (or korganizer, if evolution isn't found).
*Wharf clock - Swallow "asclock" asclock -shape -24 -position +1+1 &
*Wharf clock - Swallow "wmclockmon" wmclockmon &
*Wharf clock - Swallow "wmitime" wmitime &
*Wharf clock - Swallow "xclock" xclock -bg gray10 -fg cyan -digital -brief &
*Wharf clock - Exec "r" evolution &
*Wharf clock - Exec "r" korganizer &

#
# END *Wharf Applets/Icons