x.rst
changeset 978 76aa572406cd
child 1002 234cd58cae56
equal deleted inserted replaced
977:8af50fca6c56 978:76aa572406cd
       
     1 -*- coding: utf-8 -*-
       
     2 
       
     3 ====
       
     4  X.
       
     5 ====
       
     6 
       
     7 Standard.
       
     8 =========
       
     9 
       
    10 See
       
    11 
       
    12   http://www.tronche.com/gui/x/icccm/
       
    13 
       
    14 Getting info about X window and X-related applications data.
       
    15 ============================================================
       
    16 
       
    17 Look for system registered resources::
       
    18 
       
    19   $ listres
       
    20   $ listres -all
       
    21 
       
    22   $ appres XTerm
       
    23   $ appres -name htop   # for xterm with running bash inside
       
    24 
       
    25 Look for X resources of running applications::
       
    26 
       
    27   $ xprop -root
       
    28   $ xprop -name bash    # for xterm with running bash inside
       
    29 
       
    30 Making screenshort.
       
    31 ===================
       
    32 ::
       
    33 
       
    34   $ sudo apt-get install scrot
       
    35   $ scrot -d <sec> <file>
       
    36 
       
    37 or::
       
    38 
       
    39   $ sudo apt-get install imagemagic
       
    40   $ import -quality 100 -pause <sec> -silent <file>
       
    41 
       
    42 Input method.
       
    43 =============
       
    44 
       
    45 Input method by setxkbmap.
       
    46 --------------------------
       
    47 ::
       
    48 
       
    49   $ setxkbmap ru
       
    50 
       
    51   $ setxkbmap -rules xorg -model pc104 -layout "us,ru" -option "grp:rwin_toggle,grp_led:scroll" -variant ",winkeys"
       
    52 
       
    53 Input method from xorg.conf.
       
    54 ----------------------------
       
    55 ::
       
    56 
       
    57   Section "InputDevice"
       
    58       Identifier     "Keyboard0"
       
    59       Driver         "kbd"
       
    60       Option         "XkbModel" "pc105"
       
    61       Option         "XkbLayout" "us,ru"
       
    62       Option         "XkbVariant" ",winkeys"
       
    63       Option         "XkbOptions" "grp:rwin_switch,grp_led:scroll"
       
    64   EndSection
       
    65 
       
    66 .Xdefaults
       
    67 ==========
       
    68 
       
    69 The syntax of an Xdefaults file is as follows::
       
    70 
       
    71   [client. | *][{restriction.} | *]resource: value
       
    72 
       
    73 where:
       
    74 
       
    75   client
       
    76                 The name of the application, some program allow change it by
       
    77                 '-name' option. This element is optional (can be substituated
       
    78                 with wildcard).
       
    79   restriction
       
    80 
       
    81                 Class names or name of specific class instance. The classes
       
    82                 names conventionally start with an upper-case letter.
       
    83 
       
    84   resource
       
    85                 The name of the resource whose value is to be changed.
       
    86                 Resources are typically lowercase with uppercase
       
    87                 concatenation.
       
    88   value
       
    89                 The actual value of the resource.
       
    90   delimiters
       
    91                 A period (.) is used to signify each step down into the
       
    92                 hierarchy. A colon (:) is used to separate the resource
       
    93                 declaration from the actual value.
       
    94 
       
    95 Comment start with '!' char and goes up to end of line or C-like /* */.
       
    96 
       
    97 Use xprop utility to find classes and resources used by application.
       
    98 
       
    99 To reread your .Xresources file, and throw away your old resources::
       
   100 
       
   101   $ xrdb ~/.Xdefaults
       
   102 
       
   103 To reread your .Xresources file, and keep your old resources::
       
   104 
       
   105  $ xrdb -merge ~/.Xdefaults
       
   106 
       
   107 Example::
       
   108 
       
   109   *foreground: yellow
       
   110   XClock*foreground: pink
       
   111   Xman*topBox*foreground: blue
       
   112 
       
   113 String value type.
       
   114 ------------------
       
   115 
       
   116 This can be path specification like '/usr/bin/firefox'.
       
   117 
       
   118 Colors value type.
       
   119 ------------------
       
   120 
       
   121 For color names see '/usr/lib/X11/rgb.txt'. Also you can use hex
       
   122 representation #ffffff.
       
   123 
       
   124 Font value type.
       
   125 ----------------
       
   126 
       
   127 You can use either a full name, a wildcarded specification, or a font alias::
       
   128 
       
   129   XTerm*Font: -adobe-courier-bold-r-normal--14-140-75-75-m-90-iso8859-1
       
   130   XTerm*Font: *courier-bold-r*140*
       
   131   XTerm*Font: 7x14
       
   132 
       
   133 Geometry value type.
       
   134 --------------------
       
   135 
       
   136   XCalc*geometry: 120x120-0-0
       
   137   XClock*geometry: -50+100
       
   138 
       
   139 Cursor names value type.
       
   140 ------------------------
       
   141 
       
   142 Cursor resources require the name of the file in /usr/include/X11/bitmaps that
       
   143 contains the cursor you want to use.
       
   144 
       
   145   ScoTerm*pointerShape: gumby
       
   146 
       
   147 Pixmaps value type.
       
   148 -------------------
       
   149 
       
   150 Pixmaps are patterns, like bitmaps, that are used to texture or color an area
       
   151 on your display. Pixmap resources are specified like cursors or bitmaps.
       
   152 
       
   153 Numebers value type.
       
   154 --------------------
       
   155 
       
   156   XLogo*borderWidth: 10
       
   157 
       
   158 Boolean value type.
       
   159 -------------------
       
   160 
       
   161 Some resources require a boolean value, such as 'true' or 'false', 'yes' or
       
   162 'no', or 'on' or 'off'.
       
   163 
       
   164 Wildcard matching.
       
   165 ------------------
       
   166 
       
   167 The asterisk can be used as a wildcard, making it easy to write a single rule
       
   168 that can be applied to many different applications or elements.
       
   169