AfterStep Wharf Tutorial

From AfterWiki
Jump to: navigation, search

Introduction

This article includes an actual Wharf configuration script. Cut, paste into a text editor, and 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
#|
#|You can also automatically create a folder and pull-in items using the
#|	CategoryTree function.  This option searches *.desktop files in the
#|	/usr/share/applications directory. Valid Categories include: 
#|
#|		AudioVideo, Development, Education, Emulator, Game, Graphics,
#|		Network, Office, System, TextEditor, and Utility. 
#|
#|	The following example will mimic and draw-in the applications listed in
#|	the AfterStep Menu (left-click on the Desktop): Applications -> Office.
#|
#|	*Wharf Office - CategoryTree "Office"
#|
#|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		logos/Unicode Exec "-" urxvt &
*Wharf Term		logos/Unicode Exec "-" mlterm &
*Wharf Term		logos/aterm2 Exec "-" aterm &
*Wharf Term		logos/Eterm Exec "-" Eterm -P ~/.afterstep/non-configurable/0_background -f white &
*Wharf Term		normal/Monitor3DBlue Exec "-" rxvt -bg black -fg grey70 -sl 500 -vb &
*Wharf Term		logos/XWindow3 Exec "-" xterm &

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

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

# First available GUI text editor :
*Wharf TextEditor	medit.png Exec "medit" medit &
*Wharf TextEditor	normal/Pen1 Exec "nedit" nedit &
*Wharf TextEditor 	normal/Pen1 Exec "cooledit" cooledit --look next &
*Wharf TextEditor 	xemacs.png Exec "xemacs" xemacs &
*Wharf TextEditor 	normal/Pen1 Exec "VIM" gvim &
*Wharf TextEditor	normal/Pen1 ExecInTerm "nano" -title "Nano text editor" -e nano &

# Pull-in office applications from /usr/share/applications :
*Wharf Office - CategoryTree "Office"

# One of the few mixers that works with Alsa and Pulse :
*Wharf mixer - Swallow "AlsaMixer.app" AlsaMixer.app -1 Master -2 Master -3 Master &
*Wharf mixer - Exec "r" alsamixergui &
*Wharf mixer - ExecInTerm "r" -title "Alsa Mixer" -e alsamixer &

# One of the system temp apps - first available :
# wmsorsen and wmcpum are a couple of apps that actually work with lm_sensors 3.0+
# You'll need lm_sensors activated. As root/su run "sensors-detect". 
*Wharf cputemp - Swallow "wmsorsen" wmsorsen &
*Wharf cputemp - Swallow "wmcpum" wmcpum -p /sys/devices/platform/f71882fg.2560 &
*Wharf cputemp - Exec "r" xsensors &

# 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

# First available clock :
# 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 -24 -theme Stone &
*Wharf clock - Swallow "wmclockmon" wmclockmon -w &
*Wharf clock - Swallow "hvclock" hvclock &
*Wharf clock - Swallow "wmitime" wmitime &
*Wharf clock - Swallow "Time.app" Time.app -D -t 24 &
*Wharf clock - MaxSwallow "xclock" xclock -geometry 64x32 -digital -brief -bg gray10 -fg cyan -update 1 &
*Wharf clock - Exec "r" evolution &
*Wharf clock - Exec "r" korganizer &

# 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

#
# END *Wharf Applets/Icons