Customizing BadPad

I wrote badpad with the idea of supporting at least as many customizations as Notepad.  I just haven't had the time to add gui support for them, but they are there.  If you have access to the command line or can edit a text file, you should be fine.

You can change almost everything about badpad using the standard -xrm command line option or the standard user X resource file ~/.Xdefaults (or ~/.Xresources).  As a last resort, badpad will extract resources from a file called BadPad in your home directory.  If you decide to put the resources in any of these files, the format is the same as what you see in any of the files in the app-defaults directory which is probably located at /usr/X11R6/lib/X11/app-defaults or /etc/X11/app-defaults.

If you put the resources in ~/BadPad, badpad will pick them up the next time it starts.  If, however, you put the resources in ~/.Xdefaults or its equivalent, you will either need to restart the X server or run the following command before badpad can see the changes:
xrdb -merge ~/.Xdefaults
You can find more details on X resources in §4.1 of the X Window User HOWTO.


Application Class:

The application class for setting badpad resources is "BadPad".  Thus, if you specify resources using text files you should prepend this to the name of the resource.  For example, in the "Changing Foreground and Background Colors" section below, you can see how to change the foreground color using the "*XmText*foreground" resource from the command line.  To use this same resource in a file, insert a line of text into your resource file that looks like the following:
BadPad*XmText*foreground: green


Changing Foreground and Background Colors
:
badpad -xrm '*XmText*foreground: green' -xrm '*XmText*background: black'


Changing Text Editor Fonts
:

The default font is the following:
7x13bold
To change the font to a bigger monospaced font that still fits on the screen, do something like the following:
badpad -xrm '*XmText*fontList: -*-courier-*-r-*-*-18-*-*-*-*-*-iso8859-1' \
-xrm '*mainText*rows: 24' -xrm '*mainText*columns: 40'
To see what fonts are available on your system, run xfontsel or xlsfonts.  Using xfontsel, after you have a font you like, click on the "select" button to copy the font string to the primary selection.  You can then use the middle button on your mouse to paste it into your text editor.

Changing Menu Fonts:

The default font is the following:
-*-helvetica-medium-r-normal-*-*-120-*-*-p-*-iso8859-1
To make it bigger, do something like the following:
badpad -xrm '*fontList: -*-helvetica-medium-r-normal-*-18-*-*-*-*-*-iso8859-1'


Changing Startup Size:

The default start up size is 80x24.  You can change this to 40x24 as follows:
badpad -xrm '*mainText*columns: 40' -xrm '*mainText*rows: 24'


Changing from English to Your Preferred Language:

You can also change most (if not all) of the text strings that are displayed.  For example, you can change the string for the "File" menu as follows:
badpad -xrm '*fileMenu.labelString: Foobar'
A (hopefully) complete listing of string resources and their defaults is as follows:
BadPad*fileMenu.labelString: File
BadPad*fileNewMenu.labelString: New
BadPad*fileNewMenu.buffer.labelString: Buffer
BadPad*fileNewMenu.clone.labelString: Clone
BadPad*fileNewMenu.window.labelString: Window
BadPad*fileMenu.open.labelString: Open
BadPad*fileMenu.save.labelString: Save
BadPad*fileMenu.saveAs.labelString: Save As...
BadPad*fileMenu.close.labelString: Close
BadPad*fileMenu.exit.labelString: Exit
BadPad*editMenu.labelString: Edit
BadPad*editMenu.undo.labelString: Undo
BadPad*editMenu.redo.labelString: Redo
BadPad*editMenu.cut.labelString: Cut
BadPad*editMenu.copy.labelString: Copy
BadPad*editMenu.paste.labelString: Paste
BadPad*editMenu.delete.labelString: Delete
BadPad*editMenu.find.labelString: Find...
BadPad*editMenu.findNext.labelString: Find Next
BadPad*editMenu.findPrevious.labelString: Find Previous
BadPad*editMenu.findAndReplace.labelString: Replace...
BadPad*editMenu.goto.labelString: Go To...
BadPad*editMenu.selectAll.labelString: Select All
BadPad*optionsMenu.labelString: Options
BadPad*optionsMenu.readOnly.labelString: Read Only
BadPad*optionsMenu.safeSaves.labelString: Safe Save
BadPad*optionsMenu.wordWrap.labelString: Word Wrap
BadPad*helpMenu.labelString: Help
BadPad*helpMenu.about.labelString: About
BadPad*findAndReplaceDialog*workAreaForm*findLabel.labelString: Find:
BadPad*findAndReplaceDialog*workAreaForm*replaceLabel.labelString: Replace:
BadPad*findAndReplaceDialog*workAreaForm*optionsLabel.labelString: Options:
BadPad*findAndReplaceDialog*workAreaForm*caseInsensitive.labelString: "
BadPad*findAndReplaceDialog*workAreaForm*reverseSearch.labelString: "
BadPad*findAndReplaceDialog*buttonForm*find.labelString: Find
BadPad*findAndReplaceDialog*buttonForm*replace.labelString: Replace
BadPad*findAndReplaceDialog*buttonForm*replaceAll.labelString: Replace All
BadPad*findAndReplaceDialog*buttonForm*cancel.labelString: Cancel
BadPad*gotoDialog*selectionLabelString: Line Number
BadPad*dirnameMissingMessage: Error: Directory not specified
BadPad*notAregularFileMessage: Error: Expecting a regular file.
BadPad*writePermissionDeniedOnDirMessage: Error: No write permission on directory.
BadPad*writePermissionDeniedOnFileMessage: Error: No write permission on file.
BadPad*readPermissionDeniedOnFileMessage: Error: No read permission on file.