Difference between revisions of "X11"

From NetHackWiki
Jump to navigation Jump to search
(first info)
 
(some more info)
Line 1: Line 1:
 
'''X11''' is a GUI of NetHack, mainly used on unix-type operating systems. If your copy of NetHack has that compiled in, you can enable it by setting <tt>OPTIONS=windowtype:X11</tt> in your [[config file]].
 
'''X11''' is a GUI of NetHack, mainly used on unix-type operating systems. If your copy of NetHack has that compiled in, you can enable it by setting <tt>OPTIONS=windowtype:X11</tt> in your [[config file]].
 +
 +
{{wikipedia|X resources}}
  
 
[[Image:NetHack-X11-notiles-noXresources.png|thumb|right|Without tiles or any X resources.]]
 
[[Image:NetHack-X11-notiles-noXresources.png|thumb|right|Without tiles or any X resources.]]
Line 8: Line 10:
 
If you do not have any X11 resources set for NetHack, all windows will be black text on white background, and this makes playing almost impossible, unless you turn off [[options#color|color]].  
 
If you do not have any X11 resources set for NetHack, all windows will be black text on white background, and this makes playing almost impossible, unless you turn off [[options#color|color]].  
  
{{wikipedia|X resources}}
+
You can define the X resources in a text file, for example <tt>~/.Xdefaults</tt>, with one resource per line. You can then use <tt>xrdb -merge ~/.Xdefaults</tt> to make the resources active for your X session.
  
 
List of some of the X resources NetHack accepts:
 
List of some of the X resources NetHack accepts:
Line 14: Line 16:
 
{| class="wikitable"
 
{| class="wikitable"
 
!Resource string !! Value !! Explanation
 
!Resource string !! Value !! Explanation
 +
|-
 +
|<tt>NetHack*font</tt> || font || Sets the font for all NetHack windows. Must be fixed-width font!
 +
|-
 +
|<tt>NetHack.tile_file</tt> || filename || What file contains the tiles used for the map? The file must reside in he NetHack playground. If NetHack was compiled with USE_XPM, then this can be a normal xpm-bitmap, otherwise it must be NetHack's custom format.
 +
|-
 +
|<tt>NetHack*slow</tt> || boolean || If <tt>True</tt>, the default, a popup for single character prompts such as y/n is '''not''' used.
 +
|-
 +
|<tt>NetHack*message_lines</tt> || number || The number of lines the message window will show without scrolling.
 +
|-
 +
|<tt>NetHack*message_line</tt> || boolean || If <tt>True</tt>, the message window has a line that separates old and new messages.
 +
|-
 +
|<tt>NetHack*autofocus</tt> || boolean || If <tt>True</tt>, force keyboard focus to attach to popup windows.
 
|-
 
|-
 
|<tt>NetHack*background</tt> || color || Sets the background color of all NetHack windows
 
|<tt>NetHack*background</tt> || color || Sets the background color of all NetHack windows
Line 52: Line 66:
 
|}
 
|}
  
Some good values would be for example
+
* 'boolean' can be either <tt>True</tt> or <tt>False</tt>.
 +
*'color' can be defined either with a named color, or a hexadecimal RGB number, such as <tt>#00ff00</tt>.
 +
*'font' can be any font string the X11 server knows about. Use <tt>xlsfonts</tt> or <tt>xfontsel</tt> or some such program to see the fonts.
 +
 
 +
Some good values would be, for example
  
 +
! Lines beginning with ! are comments and are ignored.
 +
NetHack*font:                  vga
 +
 
  NetHack*background:            black
 
  NetHack*background:            black
 
  NetHack*foreground:            grey
 
  NetHack*foreground:            grey
 +
 
  NetHack*map*background:        black
 
  NetHack*map*background:        black
 +
 
  NetHack*map*black:              grey25
 
  NetHack*map*black:              grey25
 
  NetHack*map*red:                red3
 
  NetHack*map*red:                red3

Revision as of 08:57, 15 April 2007

X11 is a GUI of NetHack, mainly used on unix-type operating systems. If your copy of NetHack has that compiled in, you can enable it by setting OPTIONS=windowtype:X11 in your config file.

Without tiles or any X resources.
Running on Kubuntu Linux 6.06.

X11 can do both tile-graphics and ASCII.

If you do not have any X11 resources set for NetHack, all windows will be black text on white background, and this makes playing almost impossible, unless you turn off color.

You can define the X resources in a text file, for example ~/.Xdefaults, with one resource per line. You can then use xrdb -merge ~/.Xdefaults to make the resources active for your X session.

List of some of the X resources NetHack accepts:

Resource string Value Explanation
NetHack*font font Sets the font for all NetHack windows. Must be fixed-width font!
NetHack.tile_file filename What file contains the tiles used for the map? The file must reside in he NetHack playground. If NetHack was compiled with USE_XPM, then this can be a normal xpm-bitmap, otherwise it must be NetHack's custom format.
NetHack*slow boolean If True, the default, a popup for single character prompts such as y/n is not used.
NetHack*message_lines number The number of lines the message window will show without scrolling.
NetHack*message_line boolean If True, the message window has a line that separates old and new messages.
NetHack*autofocus boolean If True, force keyboard focus to attach to popup windows.
NetHack*background color Sets the background color of all NetHack windows
NetHack*foreground color Sets the foreground color of all NetHack windows
NetHack*map*background color Sets the background color of the map
NetHack*map*black color Sets the color 'black' in map to some other color
NetHack*map*red color Sets the color 'red' in map to some other color
NetHack*map*green color Sets the color 'green' in map to some other color
NetHack*map*brown color Sets the color 'brown' in map to some other color
NetHack*map*blue color Sets the color 'blue' in map to some other color
NetHack*map*magenta color Sets the color 'magenta' in map to some other color
NetHack*map*cyan color Sets the color 'cyan' in map to some other color
NetHack*map*gray color Sets the color 'gray' in map to some other color
NetHack*map*orange color Sets the color 'orange' in map to some other color
NetHack*map*bright_green color Sets the color 'bright_green' in map to some other color
NetHack*map*yellow color Sets the color 'yellow' in map to some other color
NetHack*map*bright_blue color Sets the color 'bright_blue' in map to some other color
NetHack*map*bright_magenta color Sets the color 'bright_magenta' in map to some other color
NetHack*map*bright_cyan color Sets the color 'bright_cyan' in map to some other color
NetHack*map*white color Sets the color 'white' in map to some other color
  • 'boolean' can be either True or False.
  • 'color' can be defined either with a named color, or a hexadecimal RGB number, such as #00ff00.
  • 'font' can be any font string the X11 server knows about. Use xlsfonts or xfontsel or some such program to see the fonts.

Some good values would be, for example

! Lines beginning with ! are comments and are ignored.
NetHack*font:                   vga

NetHack*background:             black
NetHack*foreground:             grey

NetHack*map*background:         black

NetHack*map*black:              grey25
NetHack*map*red:                red3
NetHack*map*green:              green3
NetHack*map*brown:              DarkOrange3
NetHack*map*blue:               blue3
NetHack*map*magenta:            magenta3
NetHack*map*cyan:               cyan3
NetHack*map*gray:               gray70
NetHack*map*orange:             yellow
NetHack*map*bright_green:       green
NetHack*map*yellow:             yellow
NetHack*map*bright_blue:        blue
NetHack*map*bright_magenta:     magenta
NetHack*map*bright_cyan:        cyan
NetHack*map*white:              white
This page is a stub. Should you wish to do so, you can contribute by expanding this page.