1TPB(1)                      General Commands Manual                     TPB(1)
2
3
4

NAME

6       tpb - program to use the IBM ThinkPad (tm) special keys
7

SYNOPSIS

9       tpb [options]
10

DESCRIPTION

12       With  TPB  it is possible to bind a program to the ThinkPad, Mail, Home
13       and Search button.  TPB can also run a callback program on  each  state
14       change  with  the changed state and the new state as options.  So it is
15       possible to trigger several actions on different  events.   TPB  has  a
16       on-screen display (OSD) to show volume, mute, brightness and some other
17       informations.  Furthermore TPB supports a  software  mixer,  as  the  R
18       series ThinkPads have no hardware mixer to change the volume.
19

OPTIONS

21       -h, --help
22               Display help.
23
24       -d, --daemon
25               Startup as daemon.
26
27       -c, --config=FILE
28               Read FILE as additional configuration file.
29
30       -A, --apm=STATE
31               Some  ThinkPads  generate  mouse  and keyboard events or have a
32               high CPU load when polling /proc/apm.  You may enable this,  if
33               you want the AC connected/AC disconnected messages.  Default is
34               off.
35
36       -P, --powermgt=STATE
37               The program apmiser (part of tpctl package) switches the  power
38               management  mode  according  to  the  needs  of the user.  This
39               results in lots of changes displayed in OSD.   To  avoid  this,
40               the  power  management  messages can be turned off.  Default is
41               auto.
42
43       -x, --xevents=STATE
44               Some of the special keys generate X11 events instead of  chang‐
45               ing  the  nvram.   TPB  is  able  to grab those keys and run an
46               application.  In general events are only grabbed for  keys  for
47               which  a  command is assigned or if the callback script is con‐
48               figured.  However some  people  like  to  use  the  X11  events
49               through  xmodmap  or the like.  This option turns off the grab‐
50               bing of all events regardless if they are  configured  or  not.
51               Affected keys are HOME, SEARCH, MAIL, FAVORITES, RELOAD, ABORT,
52               BACKWARD, FORWARD and FN.  Default is on.
53
54       -m, --mixer=STATE
55               Use OSS mixer to  change  volume  and  for  mute/unmute.   This
56               should be use on models with no hardware mixer (volume and mute
57               buttons show no effect).  R31 is reported to have  no  hardware
58               mixer.   To  use this you must enable write access to the NVRAM
59               device (possibly dangerous).  Possible values are on  and  off.
60               Default is off.
61
62       -o, --osd=STATE
63               Show on-screen display for volume, mute and brightness.  Possi‐
64               ble values are on and off.  Default is on.
65
66       -p, --poll=DELAY
67               Set delay between polls in microseconds.  Default is 200000.
68
69       -t, --thinkpad=CMD
70               String with command and options that should  be  executed  when
71               ThinkPad button is pressed.  It is possible to execute any pro‐
72               gram.  The program needs to include the complete  path  to  the
73               executable.  By default no command is executed.
74
75       -H, --home=CMD
76               String  with  command  and options that should be executed when
77               Home button is pressed.  By default no command is executed.
78
79       -S, --search=CMD
80               String with command and options that should  be  executed  when
81               Search button is pressed.  By default no command is executed.
82
83       -M, --mail=CMD
84               String  with  command  and options that should be executed when
85               Mail button is pressed.  By default no command is executed.
86
87       -W, --wireless=CMD
88               String with command and options that should  be  executed  when
89               Wireless button is pressed.  By default no command is executed.
90
91       -C, --callback=CMD
92               String  with  command  and options that should be executed each
93               button press and state change.  tpb  passes  an  identifier  as
94               first  argument  and  the  new  state as second argument to the
95               callback.  So you can do fancy things :) By default no  command
96               is executed.
97
98       -v, --verbose
99               Print information about pressed keys.
100

CONFIGURATION FILE

102       The default values of tpb can be overridden using a configuration file.
103       The priority of the configuration options is:
104
105       ·      builtin defaults
106
107       ·      configuration in /etc/tpbrc
108
109       ·      configuration in $HOME/.tpbrc
110
111       ·      configuration in file given with '--config' command line option
112
113       ·      command line options
114
115       tpb searches for the file '~/.tpbrc'.  The  configuration  consists  of
116       lines of the form:
117
118              # COMMENT
119
120              KEYWORD ARGUMENT # COMMENT
121
122       Keywords are:
123
124
125       NVRAM   Should define the nvram device from where the information about
126               the key states is read. Default is to try /dev/nvram,  followed
127               by /dev/misc/nvram.
128
129       POLLTIME
130               Defines  the  delay  between polls in microseconds.  Default is
131               200000.
132
133       THINKPAD
134               String with command and options that should  be  executed  when
135               ThinkPad button is pressed.  It is possible to execute any pro‐
136               gram.  By default no command is executed.
137
138       HOME    String with command and options that should  be  executed  when
139               Home  button is pressed (only available on A and S series).  By
140               default no command is executed.
141
142       SEARCH  String with command and options that should  be  executed  when
143               Search  button  is  pressed (only available on A and S series).
144               By default no command is executed.
145
146       MAIL    String with command and options that should  be  executed  when
147               Mail  button  is pressed(only available on A and S series).  By
148               default no command is executed.
149
150       FAVORITES
151               String with command and options that should  be  executed  when
152               Favorites  button  is pressed (only available on A series).  By
153               default no command is executed.
154
155       RELOAD  String with command and options that should  be  executed  when
156               Reload  button  is  pressed  (only  available on A series).  By
157               default no command is executed.
158
159       ABORT   String with command and options that should  be  executed  when
160               Abort  button  is  pressed  (only  available  on A series).  By
161               default no command is executed.
162
163       BACKWARD
164               String with command and options that should  be  executed  when
165               Backward  button  is  pressed (only available on A series).  By
166               default no command is executed.
167
168       FORWARD String with command and options that should  be  executed  when
169               Forward  button  is  pressed  (only available on A series).  By
170               default no command is executed.
171
172       FN      String with command and options that should be executed when Fn
173               button is pressed.  This is only triggered, when Fn is released
174               again and it was not used for a key combination.  By default no
175               command is executed.
176
177       CALLBACK
178               String  with  command  and options that should be executed each
179               button press and state change.  tpb  passes  an  identifier  as
180               first  argument  and  the  new  state as second argument to the
181               callback.  So you can do fancy things :) By default no  command
182               is executed.  Supported identifiers and states are:
183
184               IDENTIFIER        STATES/VALUE
185               thinkpad          pressed
186               home              pressed
187               search            pressed
188               mail              pressed
189               favorites         pressed
190               reload            pressed
191               abort             pressed
192               backward          pressed
193               forward           pressed
194               fn                pressed
195               zoom              on, off
196               thinklight        on, off
197               display           lcd, crt, both
198               expand            on, off
199               brightness        PERCENT
200               volume            PERCENT
201               mute              on, off
202               ac_power          connected, disconnected
203               powermgt_ac       high, auto, manual
204               powermgt_battery  high, auto, manual
205
206
207       MIXER   Use  OSS  mixer  to  change  volume  and for mute/unmute.  This
208               should be use on models with no hardware mixer (volume and mute
209               buttons  show  no effect).  R31 is reported to have no hardware
210               mixer.  To use this you must enable write access to  the  NVRAM
211               device  (possibly  dangerous).  Possible values are on and off.
212               Default is off.
213
214       MIXERSTEPS
215               Defines how much steps should be available when using  the  OSS
216               mixer.   Default  is  14.  If an other number of steps is used,
217               tpb needs write access to the nvram device.
218
219       MIXERDEV
220               Defines the mixer device to use for OSS mixer support.  Default
221               is /dev/mixer.
222
223       APM     Some  ThinkPads  generate  mouse  and keyboard events or have a
224               high CPU load when polling /proc/apm.  You may enable this,  if
225               you want the AC connected/AC disconnected messages.  Default is
226               off.
227
228       POWERMGT
229               The program apmiser (part of tpctl package) switches the  power
230               management  mode  according  to  the  needs  of the user.  This
231               results in lots of changes displayed in OSD.   To  avoid  this,
232               the  power  management  messages can be turned off.  Default is
233               auto.
234
235       XEVENTS Some of the special keys generate X11 events instead of  chang‐
236               ing  the  nvram.   TPB  is  able  to grab those keys and run an
237               application.  In general events are only grabbed for  keys  for
238               which  a  command is assigned or if the callback script is con‐
239               figured.  However some  people  like  to  use  the  X11  events
240               through  xmodmap  or the like.  This option turns off the grab‐
241               bing of all events regardless if they are  configured  or  not.
242               Affected keys are HOME, SEARCH, MAIL, FAVORITES, RELOAD, ABORT,
243               BACKWARD, FORWARD and FN.  Default is on.
244
245       OSD     Show on-screen display for volume, mute and brightness.  Possi‐
246               ble values are on and off.  Default is on.
247
248       OSDZOOM Specific  switch for showing on-screen display for zoom button.
249               Possible values are on and off.  Default is unset, follows  the
250               OSD option.
251
252       OSDTHINKLIGHT
253               Specific  switch  for  showing on-screen display for thinklight
254               button.  Possible values are on and  off.   Default  is  unset,
255               follows the OSD option.
256
257       OSDDISPLAY
258               Specific  switch for showing on-screen display for display out‐
259               put button.  Possible values are on and off.  Default is unset,
260               follows the OSD option.
261
262       OSDHVEXPANSION
263               Specific  switch for showing on-screen display for HV expansion
264               button.  Possible values are on and  off.   Default  is  unset,
265               follows the OSD option.
266
267       OSDBRIGHTNESS
268               Specific  switch  for  showing on-screen display for brightness
269               buttons.  Possible values are on and off.   Default  is  unset,
270               follows the OSD option.
271
272       OSDVOLUME
273               Specific  switch  for showing on-screen display for ivolume and
274               mute buttons.  Possible values are  on  and  off.   Default  is
275               unset, follows the OSD option.
276
277       OSDPOWERMGT
278               Specific  switch  for showing on-screen display for ipower man‐
279               agement changes.  Possible values are on and off.   Default  is
280               unset, follows the OSD option.
281
282       OSDFONT Defines  the  font  for  the  on-screen  display.   You may use
283               "xfontsel" to choose one.  Default is the default font  of  the
284               xosd library.
285
286       OSDCOLOR
287               Defines the color of the on-screen display.  You may use "xcol‐
288               ors" to choose one.  Default is BLUE.
289
290       OSDTIMEOUT
291               Defines how long (in seconds) the on-screen  display  is  shown
292               after the last keys was pressed.  Default is 3.
293
294       OSDOFFSET
295               For backward compatibility.  Same as OSDVERTICAL.
296
297       OSDSHADOW
298               Defines the offset of the font shadow in pixels.  Default is 2.
299
300       OSDSHADOWCOLOR
301               Defines  the  color of the shadow of the on-screen display. You
302               may use "xcolors" to choose one.  Default is BLACK.
303
304       OSDOUTLINE
305               Defines the width of the font outline in pixels.  Default is 1.
306
307       OSDOUTLINECOLOR
308               Defines the color of the outline of the on-screen display.  You
309               may use "xcolors" to choose one.  Default is BLACK.
310
311       OSDVERTICAL
312               Defines the offset from the top or bottom of the screen in pix‐
313               els.  Default is 25.
314
315       OSDHORIZONTAL
316               Defines the offset from the left or right of the screen in pix‐
317               els.  Only supported by xosd 2.0.0 and above.  Default is 25.
318
319       OSDPOS  Defines  where the osd is shown.  Possible values are top, mid‐
320               dle and bottom.  The value middle is  only  supported  by  xosd
321               2.0.0 and above.  Default is bottom.
322
323       OSDALIGN
324               Defines  the  alignment  of the osd.  Possible values are left,
325               center and right.  Default is left.
326

NOTES

328       Requires NVRAM device /dev/nvram.  This must be enabled in your kernel.
329       Although  the device file must exist.  The device file could be created
330       with ´mknod /dev/nvram c 10 144´
331
332       This program was developed on a Thinkpad Model T21.
333

EXAMPLE

335       tpb --osd=off --verbose --thinkpad="xterm -T ntpctl -e ntpctl"
336
338       Copyright 2002-2005, Markus Braun <markus.braun@krawel.de>
339
340       Licensed under GNU GPL version 2 or later.  This is free software;  see
341       the  source for copying conditions.  There is NO warranty; not even for
342       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
343

AUTHOR

345       Written by Markus Braun
346
347
348
3490.6.4                            25 Juli 2005                           TPB(1)
Impressum