.\" hey, Emacs: -*- nroff -*- .\" pbbuttons is free software; you can redistribute it and/or modify .\" it under the terms of the GNU General Public License as published by .\" the Free Software Foundation; either version 2 of the License, or .\" (at your option) any later version. .\" .\" This program is distributed in the hope that it will be useful, .\" but WITHOUT ANY WARRANTY; without even the implied warranty of .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the .\" GNU General Public License for more details. .\" .\" You should have received a copy of the GNU General Public License .\" along with this program; see the file COPYING. If not, write to .\" the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. .\" .TH PBBCMD 1 "February 07, 2007" .\" Please update the above date whenever this man page is modified. .\" .\" Some roff macros, for reference: .\" .nh disable hyphenation .\" .hy enable hyphenation .\" .ad l left justify .\" .ad b justify to both left and right margins (default) .\" .nf disable filling .\" .fi enable filling .\" .br insert line break .\" .sp insert n+1 empty lines .\" for manpage-specific macros, see man(7) .SH NAME pbbcmd \- command line tool to communicate with pbbuttonsd. .SH SYNOPSIS .B pbbcmd .RI [\-hvi]\ .br .B pbbcmd .RI [\-hvi]\ query\ .br .B pbbcmd .RI [\-hvi]\ config\ \ .SH DESCRIPTION \fBpbbcmd\fP is a tool to communicate with pbbuttonsd. It is possible to send single commands to the daemon or ask it for certain information. It is useful for scripts or for debugging and therefore the results of queries and arguments for config operations are very basic and raw. Pbbcmd won't interpret the results for you. .SH OPTIONS \fBpbbcmd\fP accepts the following options: .TP .B \-h, \-\-help Show summary of options. .TP .B \-v, \-\-version Show version of \fBpbbcmd\fP. .TP .B \-i, \-\-ignore With this option given pbbcmd will not wait for answers from the server after a config command has been sent. It returns immediately. .PP The command tells pbbcmd what should be done. Only the commands \'query\' and \'config\' needs additional arguments. All other stand for themselves. Pbbcmd supports following commands: .TP .B query .br Reads parameters from the server and print them to terminal. This command needs the name of the desired parameter as argument. Multiple names are possible. See chapter TAGS for possible parameter names. .TP .B config .br Change server options on the fly. This command needs the parameter name and the new value as command. Multiple parameters can be changed at once. See chapter TAGS for possible parameter names. .TP .B listclients .br Receiving this command pbbuttonsd will return a list of currently attached clients. Pbbcmd will print a table containg useful information of these clients. .TP .B saveconfig .br Save current configuration to disc. This works only if all security conditions were fulfilled and pbbuttond has config writing enabled. .TP .B reinit .br This command triggers reinitialization setting of hardware components under control of pbbuttonsd (for example the trackpad and keyboard on PowerBooks). The PMCS script to set the power policy will also be lauched after this command. .TP .B ejectcd .br Eject the CDROM. .TP .B sleep .br Suspend the machine to RAM. .TP .B hibernate .br Suspend the machine to Disk. This will trigger the kernel to write the memory and all necessary process data to swap space on disk and shut the machine down. After next reboot, the system should be restored in state the system had at the time this command was triggered. This might not work on all machines. Please read the kernel documentation for more details. .SH "TAGS to use with \'config\' or \'query\'" Not every tag could be used with \fIconfig\fP and \fIquery\fP operations. The 'List of Tags' below shows how each tag could be used. The structure of this list is described as follows: .TP .br .PP The field shows what sort of data is returned or expected. Following datatypes are defined: .TP .B command This tag is a command and the argument wouldn't be evaluated. Nevertheless the config operation expected one and 0 would be ok in this cases. .TP .B string String of characters. The string must be quoted if it contains white spaces. .TP .B integer 32-bit integer values. The description would say if the value range was restricted. .TP .B bool A boolean value. A '0' means false and a '1' means true. Any other values are invalid. .TP .B keycode A keycode is an 8-bit integer. Each keycode has it's equivalent key on the keyboard. Don't confuse this with ASCII code. You could get keycodes with the program \fIshowkey\fP. .TP .B modifier A modifier is an bit-field with one bit for each modifier key: Bit 0 = 1 = shift, bit 1 = 2 = alt and bit 2 = 4 = ctrl. The three modifiers cold be combined through adding their single values. In result we get an value between 0 and 7. .SH "LIST OF TAGS" for query and config .TP TAG_AUTORESCAN bool config/query .br Enable or disable periodically scan of event devices to detect new or lost keyboards automatically. .TP TAG_VERSION string query .br Get version string of the server .TP TAG_TIMEFORCMD integer config/query .br Get or set the timeout for launched scripts or helper programs. .TP TAG_TIMEREMAINING integer query .br Get the current time in seconds the battery will last. .TP TAG_CHARGETIME integer query .br Get the time until the batteries are fully charged. .br This option would only be available, if pbbuttonsd was compiled with IBaM support. .TP TAG_POWERSOURCE bool query .br Get the current power source the machine is running on. '0' represents battery and '1' stands for AC. .TP TAG_SLEEPSUPPORTED bool query .br Check if the machine supports sleep mode. The result is '0' if not. .TP TAG_PMUDEVICE string config/query .br Get or set the pmu device. This is only useful on Apple PowerBooks and compatible. .TP TAG_ADBDEVICE string config/query .br Get or Set the ADB device. This is only useful on Apple PowerBooks and compatible. .TP TAG_TPMODEUPKEY keycode config/query .br Get or set keycode used for trackpad mode up. .TP TAG_TPMODEUPMOD modifier config/query .br Get or Set modifier used with TPMODEUPKEY. .TP TAG_TPMODEDOWNKEY keycode config/query .br Get or set keycode used for trackpad mode down. .TP TAG_TPMODEDOWNMOD modifier config/query .br Get or set modifier used with TPMODEDOWNKEY. .TP TAG_TPMODE integer config/query .br Get or set trackpad mode. Supported modes are: 0=notap, 1=tap, 2=drag. All other values are invalid. .TP TAG_NOTAPTYPING bool config/query .br Enable or disable trackpad configuration while typing. Normally the trackpad would stay in it's current mode if key on the keyboard were hit. With this option enabled the trackpad will be configured to \'notap\' while the keyboard is used. .TP TAG_KBDMODE integer config/query .br Get or set the keyboard mode. Supported values are 0=disabled, 1=fkeyslast and 2=fkeysfirst. All other values are invalid. .PP .in +7 Fn can only be disabled on PowerBooks with an USB keyboard. If you own a machine with a ADB keyboard you have to choose 'fkeyslast' or 'fkeysfirst'. \fBPBButtonsd\fP will force this setting to 'fkeyslast' if necessary. .TP TAG_BATLOG integer config/query .br Get or set the battery logging mode. Supported values are 0=none, 1=cycle and 2=log. See pbbuttonsd.cnf (5) man-page for detailed description. .TP TAG_BATCYCLE integer query .br Get the current battery cycle. A return value of \-1 shows that the battery cycle is not available. This happens if batlog has been disabled. .TP TAG_BATTERYPRESENT integer query .br Get the batteries currently present. The return value is bit-oriented. Bit 0 shows left battery and bit 1 shows the right battery. A value of 1 means only the left battery is plugged in, a value of 3 means both batteries are available. .TP TAG_LCDILLUMUPKEY keycode config/query .br Get or set keycode used for increasing display brightness. .TP TAG_LCDILLUMUPMOD modifier config/query .br Get or set modifier used with LCDILLUMUPKEY. .TP TAG_LCDILLUMDOWNKEY keycode config/query .br Get or set keycode used for decreasing display brightness. .TP TAG_LCDILLUMDOWNMOD modifier config/query .br Get or set modifier used with LCDILLUMDOWNKEY. .TP TAG_LCDBRIGHTNESS integer config/query .br Get or set current brightness level as percentage. .TP TAG_LCDAUTOADJUST integer config/query .br Enable or disable automatic brightness control for the display and set the operating mode. .TP TAG_KBDILLUMUPKEY keycode config/query .br Get or set keycode used for increasing keyboard brightness. .TP TAG_KBDILLUMUPMOD modifier config/query .br Get or set modifier used with KBDILLUMUPKEY. .TP TAG_KBDILLUMDOWNKEY keycode config/query .br Get or set keycode used for decreasing keyboard brightness. .TP TAG_KBDILLUMDOWNMOD modifier config/query .br Get or set modifier used with KBDILLUMDOWNKEY. .TP TAG_KBDILLUMONKEY keycode config/query .br Get or set keycode used to switch keyboard illumination on or off. .TP TAG_KBDILLUMONMOD modifier config/query .br Get or set modifier used with KBDILLUMONKEY. .TP TAG_KBDBRIGHTNESS integer config/query .br Get or set current brightness level as percentage. .TP TAG_KBDONBRIGHTNESS integer config/query .br Get or set default ON status brightness level as percentage. .TP TAG_KBDAUTOADJUST integer config/query .br Enable or disable automatic brightness control for the keyboard illumination and set the operating mode. .TP TAG_FRAMEBUFFERDEVICE string config/query .br Get or set the framebuffer device. .TP TAG_BLANKFRAMEBUFFER bool config/query .br Disable or enable framebuffer display blanking. If this option was enabled the framebuffer would be switched off when the backlight goes invisibly dark. .TP TAG_DIMFULLYDARK bool config/query .br Normally the display is dimmed down to minimum level. With this option set dimming goes down to complete darkness. .TP TAG_AMBIENTLIGHT integer query .br Get the raw value from the ambient light sensor. This works only on machines that have an ambient light sensor. .TP TAG_AMBIENTLIGHTMAX integer query .br Get the max value of the ambient light sensor. This works only on machines that have an ambient light sensor. .TP TAG_LCDFADINGSPEED integer config/query .br Set the time in miliseconds a full LCD backlight dim (from lowest to highest brightness level) should last. Pbbuttonsd will adjust its internal timing accordingly. A value of '0' disables smooth brightness changes. .PP .in +7 If this option is queried, pbbuttonsd will return the current setting of the internal timing. This value may differ from the originally set value because the timer could only be programmed with limited precision. .TP TAG_KBDFADINGSPEED integer config/query .br Set the time in miliseconds a full keyboard backlight dim (from lowest to highest brightness level) should last. Pbbuttonsd will adjust its internal timing accordingly. A value of '0' disables smooth brightness changes. .PP .in +7 If this option is queried, pbbuttonsd will return the current setting of the internal timing. This value may differ from the originally set value because the timer could only be programmed with limited precision. .TP TAG_MIXERDEVICE string config/query .br Get or set OSS or ASLA sound mixer device, depending on the currently active driver. .TP TAG_MIXERCHANNELS string config/query .br Get or set a comma separated list of OSS mixer channels or ALSA elements pbbuttonsd should control. Which one is expected depends on the currently active mixer driver. .PP .in +7 Every channel combination is valid nevertheless the setting makes sense. For possible ALSA element names ask amixer. .TP TAG_VOLUMEUPKEY keycode config/query .br Get or set keycode used for sound volume up. .TP TAG_VOLUMEUPMOD modifier config/query .br Get or set modifier used with VOLUMEUPKEY. .TP TAG_VOLUMEDOWNKEY keycode config/query .br Get or set keycode used for sound volume down. .TP TAG_VOLUMEDOWNMOD modifier config/query .br Get or set modifier used with VOLUMEDOWNKEY. .TP TAG_MUTEKEY keycode config/query .br Get or set keycode used for mute sound volume. .TP TAG_MUTEMOD modifier config/query .br Get or set modifier used with MUTEKEY. .TP TAG_MIXERINITDELAY bool config/query .br Disable or enable the soft start of the mixer. If this option was enabled the mixer device would be initialized with it's first use and not immediately after daemon's startup. .TP TAG_VOLUME integer config/query .br Get or set sound volume. The valid value range is from 0 (silent) to 100 (loud). Higher values will be clipped. .TP TAG_MUTE command config .br Mute/unmute the speakers. .TP TAG_CDROMDEVICE string config/query .br Get or set the CDROM device. .TP TAG_EJECTCDKEY keycode config/query .br Get or set keycode used for ejecting the CDROM. .TP TAG_EJECTCDMOD modifier config/query .br Get or set modifier used with EJECTCDKEY. .TP TAG_EJECTCDKEYDELAY bool config/query .br Disable or enable the eject key response delay. .TP TAG_SCRIPTPMCS string config/query .br Get or set the template for the script which would be called at certain events. This events are change of power policy, change of power source, change of suspend state and at emergency condition if battery is critically low. But the emergency call is only done, if configured. Up to two '%s' are allowed in the template and will be replaced by the action and the power source. .TP TAG_IBAMDATADIR string config/query .br Get or set the IBAM data directory where statistics about battery charge and discharge cycles are stored. .br This option would only be available, if pbbuttonsd was compiled with IBaM support. .TP TAG_SLEEPKEY keycode config/query .br Get or set the keycode used for triggering sleep mode. .TP TAG_SLEEPMOD modifier config/query .br Get or set the modifier used with SLEEPKEY .TP TAG_SLEEPKEYDELAY bool config/query .br Disable or enable the sleep key response delay. .TP TAG_BWLFIRST integer config/query .br Get or set time in seconds for the first battery warn level. .TP TAG_BWLSECOND integer config/query .br Get or set time in seconds for the second battery warn level. .TP TAG_BWLLAST integer config/query .br Get or set time in seconds for the last battery warn level. .TP TAG_CURRENTBWL integer query .br Get the current battery warn level. .TP TAG_CPULOADSLEEPLOCK bool config/query .br Disable or enable the CPU sleep lock. .TP TAG_CPULOADMIN integer config/query .br Get or set the minimum CPU load to activate the sleep lock. .TP TAG_CPULOADPERIOD integer config/query .br Get or set the time in seconds how long the CPU load have to be dropped below the minimum until the lock will be released. .TP TAG_NETLOADSLEEPLOCK bool config/query .br Disable or enable the net sleep lock. .TP TAG_NETLOADMIN integer config/query .br Get or set the minimum net load to activate the sleep lock. .TP TAG_NETLOADPERIOD integer config/query .br Get or set the time in seconds how long the net load have to be dropped below the minimum until the lock will be released. .TP TAG_NETLOADDEV string config/query .br Get or set the network device to be supervised for the net sleeplock. .TP TAG_EMERGENCYACTION integer config/query .br Get or set the emergency action that should be performed if battery was running low. Three values are valid: 0=sleep, 1=signal to init and 2=command. All other values are invalid. .TP TAG_ONAC_POLICY integer config/query .br Get or set the power policy that should be activated if power source changes to AC. Following values are valid: 0=nochange, 1=powersave, 2=custom and 3=performance. .TP TAG_ONAC_TIMERACTION integer config/query .br Get or set the action that should be performed if a timer event occurs with active AC profile. The timout value for this timer event could be set with TAG_ONAC_TIMESUSPEND. Following values are possible: 0=none, 1=suspend-to-ram, 2=suspend-to-disk, 3=blank screen .TP TAG_ONAC_COVERACTION integer config/query .br Get or set the action that should be performed if the cover of the laptop was closed with active AC profile. Following values are possible: 0=none, 1=suspend-to-ram, 2=suspend-to-disk, 3=blank screen .TP TAG_ONAC_KEYACTION integer config/query .br Get or set the action that should be performed if the sleepkey was triggered with active AC profile. Following values are possible: 0=none, 1=suspend-to-ram, 2=suspend-to-disk, 3=blank screen .TP TAG_ONAC_TIMESUSPEND integer config/query .br Get or set the time until suspend is triggered. This value will only be used if AC power profile is active. Set this value to 0 and suspend timeout is disabled. .TP TAG_ONAC_TIMEDIM integer config/query .br Get or set the time until the backlight would be dimmed. This value will only be used if AC power profile is active. Set this value to 0 and screen dimming is disabled. .TP TAG_ONBATT_POLICY integer config/query .br Get or set the power policy that should be activated if power source changes to BATTERY. Following values are valid: 0=nochange, 1=powersave, 2=custom and 3=performance. .TP TAG_ONBATT_TIMERACTION integer config/query .br Get or set the action that should be performed if a timer event occurs with active BATTERY profile. The timout value for this timer event could be set with TAG_ONBATTERY_TIMESUSPEND. Following values are possible: 0=none, 1=suspend-to-ram, 2=suspend-to-disk, 3=blank screen .TP TAG_ONBATT_COVERACTION integer config/query .br Get or set the action that should be performed if the cover of the laptop was closed with active BATTERY profile. Following values are possible: 0=none, 1=suspend-to-ram, 2=suspend-to-disk, 3=blank screen .TP TAG_ONBATT_KEYACTION integer config/query .br Get or set the action that should be performed if the sleepkey was triggered with active BATTERY profile. Following values are possible: 0=none, 1=suspend-to-ram, 2=suspend-to-disk, 3=blank screen .TP TAG_ONBATT_TIMESUSPEND integer config/query .br Get or set the time until suspend is triggered. This value will only be used if BATTERY power profile is active. Set this value to 0 and suspend timeout is disabled. .TP TAG_ONBATT_TIMEDIM integer config/query .br Get or set the time until the backlight would be dimmed. This value will only be used if BATTERY power profile is active. Set this value to 0 and screen dimming is disabled. .TP TAG_HEARTBEATBEEP boolean config/query .br Enable or disable the heartbeat beep if the computer is running with closed lid. 0=disable beep, 1=enable beep. .TP TAG_POLICY integer config/query .br Get or set the current power policy Following values are valid: 0=nochange, 1=powersave, 2=custom and 3=performance. .TP TAG_IDENTITY string query .br Get the machine's identity string. .SH "SEE ALSO" pbbuttons.cnf (5), showkey (1) .SH AUTHOR Matthias Grimm .