TPB(1)
π TPB(1) β the ThinkPad special keys bestie π
General Commands Manual Β· TPB(1)
β¨ NAME β¨
tpb β the program you use to make the IBM ThinkPad (tm) special keys actually do stuff π
πΈ SYNOPSIS πΈ
tpb [options]
π¦ DESCRIPTION π¦
okay so picture this: you've got a ThinkPad and it has all these cute lil buttons β ThinkPad, Mail, Home, Search β and by default they're just... there. TPB fixes that. With TPB you can bind a program to the ThinkPad, Mail, Home and Search button. Obsessed.
And it gets better. TPB can also run a callback program on each state change, passing the changed state and the new state as options. So yeah, you can trigger several actions on different events, no cap. π
TPB also has an on-screen display (OSD) to show volume, mute, brightness and some other information. Iconic. β¨
AND β hear me out β TPB supports a software mixer, because the R series ThinkPads have no hardware mixer to change the volume. So if your volume buttons are giving nothing, that's why, and TPB is the fix. π«Ά
π OPTIONS π
-h,--helpβ Display help. literally the "what do I do" button π₯Ί-d,--daemonβ Startup as daemon. she runs in the background, main character energy, no notes π-c,--config=FILEβ Read FILE as additional configuration file. extra config? yes bestie, we love options π-A,--apm=STATEβ So some ThinkPads generate mouse and keyboard events, or have a high CPU load when polling/proc/apm. π You may enable this if you want the AC connected/AC disconnected messages. Default is off.-P,--powermgt=STATEβ The programapmiser(part of thetpctlpackage) switches the power management mode according to the needs of the user. Which sounds great until you realize it results in lots of changes displayed in OSD π. To avoid this, the power management messages can be turned off. Default is auto.-x,--xevents=STATEβ Some of the special keys generate X11 events instead of changing the nvram. TPB is able to grab those keys and run an application. In general, events are only grabbed for keys for which a command is assigned, or if the callback script is configured. However some people like to use the X11 events throughxmodmapor the like, so this option turns off the grabbing of all events regardless if they are configured or not. Affected keys areHOME,SEARCH,MAIL,FAVORITES,RELOAD,ABORT,BACKWARD,FORWARDandFN. Default is on.-m,--mixer=STATEβ Use OSS mixer to change volume and for mute/unmute. This should be used on models with no hardware mixer (volume and mute buttons show no effect).R31is reported to have no hardware mixer. To use this you must enable write access to the NVRAM device (possibly dangerous π¨). Possible values areonandoff. Default is off.
ngl bestie, that NVRAM write access thing is giving "proceed with caution". She said possibly dangerous and she MEANT it. π
-o,--osd=STATEβ Show on-screen display for volume, mute and brightness. Possible values areonandoff. Default is on. β¨-p,--poll=DELAYβ Set delay between polls in microseconds. Default is200000. yeah, microseconds. she's precise like that π-t,--thinkpad=CMDβ String with command and options that should be executed when the ThinkPad button is pressed. It is possible to execute any program. The program needs to include the complete path to the executable. By default no command is executed.-H,--home=CMDβ String with command and options that should be executed when the Home button is pressed. By default no command is executed. π-S,--search=CMDβ String with command and options that should be executed when the Search button is pressed. By default no command is executed. π-M,--mail=CMDβ String with command and options that should be executed when the Mail button is pressed. By default no command is executed. π§-W,--wireless=CMDβ String with command and options that should be executed when the Wireless button is pressed. By default no command is executed. πΆ-C,--callback=CMDβ String with command and options that should be executed each button press and state change.tpbpasses an identifier as first argument and the new state as second argument to the callback. So you can do fancy things :) By default no command is executed. the callback one is the moment fr fr π-v,--verboseβ Print information about pressed keys. she's telling you EVERYTHING, no secrets between us π
okay that's the whole option list, but the page keeps going... πΈ
πΎ CONFIGURATION FILE πΎ
okay so bestie, you can totally override all the default values of tpb with a config file. and the priority of the config options goes like this, top to bottom, later ones win:
- builtin defaults
- configuration in
/etc/tpbrc - configuration in
$HOME/.tpbrc - configuration in file given with the
--configcommand line option - command line options
tpb goes looking for the file ~/.tpbrc. the config is literally just lines that look like this:
# COMMENT
KEYWORD ARGUMENT # COMMENT
and the keywords are... girl, there's a lot, let's go:
NVRAMβ should define the nvram device from where the info about key states gets read. default is to try/dev/nvram, then/dev/misc/nvramafter that.POLLTIMEβ defines the delay between polls in microseconds. default is200000.THINKPADβ a string with the command and options that should be run when the ThinkPad button is pressed. you can execute literally any program here. by default, no command is executed.HOMEβ string with command and options to run when the Home button is pressed (only available on A and S series). by default, nothing happens.SEARCHβ string with command and options to run when the Search button is pressed (only available on A and S series). by default, no command.MAILβ string with command and options to run when the Mail button is pressed (only available on A and S series). default: no command.FAVORITESβ string with command and options to run when the Favorites button is pressed (only available on A series). default: no command.RELOADβ string with command and options to run when the Reload button is pressed (only available on A series). default: no command.ABORTβ string with command and options to run when the Abort button is pressed (only available on A series). default: no command.BACKWARDβ string with command and options to run when the Backward button is pressed (only available on A series). default: no command.FORWARDβ string with command and options to run when the Forward button is pressed (only available on A series). default: no command.FNβ string with command and options to run when the Fn button is pressed. this only gets triggered when Fn is released again and it wasn't used for a key combination. default: no command.CALLBACKβ string with command and options that should be executed on each button press and state change. tpb passes an identifier as the first argument and the new state as the second argument to the callback. so you can do fancy things :) by default no command is executed. the supported identifiers and states are:thinkpadβpressedhomeβpressedsearchβpressedmailβpressedfavoritesβpressedreloadβpressedabortβpressedbackwardβpressedforwardβpressedfnβpressedzoomβon,offthinklightβon,offdisplayβlcd,crt,bothexpandβon,offbrightnessβPERCENTvolumeβPERCENTmuteβon,offac_powerβconnected,disconnectedpowermgt_acβhigh,auto,manualpowermgt_batteryβhigh,auto,manual
MIXERβ use OSS mixer to change volume and for mute/unmute. this should be used on models with no hardware mixer (where the volume and mute buttons show no effect). R31 is reported to have no hardware mixer. to use this you must enable write access to the NVRAM device (possibly dangerous β οΈ). possible values areonandoff. default isoff.MIXERSTEPSβ defines how much steps should be available when using the OSS mixer. default is14. if another number of steps is used, tpb needs write access to the nvram device.MIXERDEVβ defines the mixer device to use for OSS mixer support. default is/dev/mixer.APMβ some ThinkPads generate mouse and keyboard events or have a high CPU load when polling/proc/apm. you may enable this if you want the AC connected/AC disconnected messages. default isoff.POWERMGTβ the program apmiser (part of the tpctl package) switches the power management mode according to the needs of the user. this results in lots of changes displayed in the OSD. to avoid this, the power management messages can be turned off. default isauto.XEVENTSβ some of the special keys generate X11 events instead of changing the nvram. TPB is able to grab those keys and run an application. in general events are only grabbed for keys that have a command assigned or if the callback script is configured. however some people like to use the X11 events throughxmodmapor the like. this option turns off the grabbing of all events regardless of whether they're configured or not. affected keys areHOME,SEARCH,MAIL,FAVORITES,RELOAD,ABORT,BACKWARD,FORWARDandFN. default ison.OSDβ show on-screen display for volume, mute and brightness. possible values areonandoff. default ison.OSDZOOMβ specific switch for showing the on-screen display for the zoom button. possible values areonandoff. default is unset, follows theOSDoption.OSDTHINKLIGHTβ specific switch for showing the on-screen display for the thinklight button. possible values areonandoff. default is unset, follows theOSDoption.OSDDISPLAYβ specific switch for showing the on-screen display for the display output button. possible values areonandoff. default is unset, follows theOSDoption.OSDHVEXPANSIONβ specific switch for showing the on-screen display for the HV expansion button. possible values areonandoff. default is unset, follows theOSDoption.OSDBRIGHTNESSβ specific switch for showing the on-screen display for the brightness buttons. possible values areonandoff. default is unset, follows theOSDoption.OSDVOLUMEβ specific switch for showing the on-screen display for the volume and mute buttons. possible values areonandoff. default is unset, follows theOSDoption.OSDPOWERMGTβ specific switch for showing the on-screen display for power management changes. possible values areonandoff. default is unset, follows theOSDoption.OSDFONTβ defines the font for the on-screen display. you may use"xfontsel"to choose one. default is the default font of the xosd library.OSDCOLORβ defines the color of the on-screen display. you may use"xcolors"to choose one. default isBLUE.OSDTIMEOUTβ defines how long (in seconds) the on-screen display is shown after the last key was pressed. default is3.OSDOFFSETβ for backward compatibility. same asOSDVERTICAL.OSDSHADOWβ defines the offset of the font shadow in pixels. default is2.OSDSHADOWCOLORβ defines the color of the shadow of the on-screen display. you may use"xcolors"to choose one. default isBLACK.OSDOUTLINEβ defines the width of the font outline in pixels. default is1.OSDOUTLINECOLORβ defines the color of the outline of the on-screen display. you may use"xcolors"to choose one. default isBLACK.OSDVERTICALβ defines the offset from the top or bottom of the screen in pixels. default is25.OSDHORIZONTALβ defines the offset from the left or right of the screen in pixels. only supported by xosd 2.0.0 and above. default is25.OSDPOSβ defines where the osd is shown. possible values aretop,middleandbottom. the valuemiddleis only supported by xosd 2.0.0 and above. default isbottom.OSDALIGNβ defines the alignment of the osd. possible values areleft,centerandright. default isleft.
π NOTES
requires the NVRAM device /dev/nvram. this must be enabled in your kernel. although the device file must exist. the device file could be created with mknod /dev/nvram c 10 144 π
this program was developed on a Thinkpad Model T21.
π EXAMPLE
tpb --osd=off --verbose --thinkpad="xterm -T ntpctl -e ntpctl"
βοΈ COPYRIGHT
Copyright 2002-2005, Markus Braun <markus.braun@krawel.de>
Licensed under GNU GPL version 2 or later. this is free software; see the source for copying conditions. there is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
βοΈ AUTHOR
Written by Markus Braun
okay that's the whole vibe, bestie π«Ά this page is from version 0.6.4, dated 25 Juli 2005, and it lives under the name TPB(1) β iconic, legendary, vintage ThinkPad excellence, no cap πβ¨π
π¦ where this page comes from
- debian bookworm: tpb 0.6.4-11
- ubuntu jammy: tpb 0.6.4-11
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms