Scroll to navigation

PBBCMD(1) General Commands Manual PBBCMD(1)

NAME

pbbcmd - command line tool to communicate with pbbuttonsd.

SYNOPSIS

pbbcmd [-hvi] <command>
pbbcmd [-hvi] query <tag>
pbbcmd [-hvi] config <tag> <data>

DESCRIPTION

pbbcmd 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.

OPTIONS

pbbcmd accepts the following options:

Show summary of options.
Show version of pbbcmd.
With this option given pbbcmd will not wait for answers from the server after a config command has been sent. It returns immediately.

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:


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.

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.

Receiving this command pbbuttonsd will return a list of currently attached clients. Pbbcmd will print a table containg useful information of these clients.

Save current configuration to disc. This works only if all security conditions were fulfilled and pbbuttond has config writing enabled.

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.

Eject the CDROM.

Suspend the machine to RAM.

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.

TAGS to use with ´config´ or ´query´

Not every tag could be used with config and query operations. The 'List of Tags' below shows how each tag could be used. The structure of this list is described as follows:

<TAGNAME> <datatype> <usable with>

<description>

The <datatype> field shows what sort of data is returned or expected. Following datatypes are defined:

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.
String of characters. The string must be quoted if it contains white spaces.
32-bit integer values. The description would say if the value range was restricted.
A boolean value. A '0' means false and a '1' means true. Any other values are invalid.
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 showkey.
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.

LIST OF TAGS for query and config


Enable or disable periodically scan of event devices to detect new or lost keyboards automatically.

Get version string of the server

Get or set the timeout for launched scripts or helper programs.

Get the current time in seconds the battery will last.

Get the time until the batteries are fully charged.
This option would only be available, if pbbuttonsd was compiled with IBaM support.

Get the current power source the machine is running on. '0' represents battery and '1' stands for AC.

Check if the machine supports sleep mode. The result is '0' if not.

Get or set the pmu device. This is only useful on Apple PowerBooks and compatible.

Get or Set the ADB device. This is only useful on Apple PowerBooks and compatible.

Get or set keycode used for trackpad mode up.

Get or Set modifier used with TPMODEUPKEY.

Get or set keycode used for trackpad mode down.

Get or set modifier used with TPMODEDOWNKEY.

Get or set trackpad mode. Supported modes are: 0=notap, 1=tap, 2=drag. All other values are invalid.

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.

Get or set the keyboard mode. Supported values are 0=disabled, 1=fkeyslast and 2=fkeysfirst. All other values are invalid.


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'. PBButtonsd will force this setting to 'fkeyslast' if necessary.


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.

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.

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.

Get or set keycode used for increasing display brightness.

Get or set modifier used with LCDILLUMUPKEY.

Get or set keycode used for decreasing display brightness.

Get or set modifier used with LCDILLUMDOWNKEY.

Get or set current brightness level as percentage.

Enable or disable automatic brightness control for the display and set the operating mode.

Get or set keycode used for increasing keyboard brightness.

Get or set modifier used with KBDILLUMUPKEY.

Get or set keycode used for decreasing keyboard brightness.

Get or set modifier used with KBDILLUMDOWNKEY.

Get or set keycode used to switch keyboard illumination on or off.

Get or set modifier used with KBDILLUMONKEY.

Get or set current brightness level as percentage.

Get or set default ON status brightness level as percentage.

Enable or disable automatic brightness control for the keyboard illumination and set the operating mode.

Get or set the framebuffer device.

Disable or enable framebuffer display blanking. If this option was enabled the framebuffer would be switched off when the backlight goes invisibly dark.

Normally the display is dimmed down to minimum level. With this option set dimming goes down to complete darkness.

Get the raw value from the ambient light sensor. This works only on machines that have an ambient light sensor.

Get the max value of the ambient light sensor. This works only on machines that have an ambient light sensor.

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.


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.


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.


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.


Get or set OSS or ASLA sound mixer device, depending on the currently active driver.

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.


Every channel combination is valid nevertheless the setting makes sense. For possible ALSA element names ask amixer.


Get or set keycode used for sound volume up.

Get or set modifier used with VOLUMEUPKEY.

Get or set keycode used for sound volume down.

Get or set modifier used with VOLUMEDOWNKEY.

Get or set keycode used for mute sound volume.

Get or set modifier used with MUTEKEY.

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.

Get or set sound volume. The valid value range is from 0 (silent) to 100 (loud). Higher values will be clipped.

Mute/unmute the speakers.

Get or set the CDROM device.

Get or set keycode used for ejecting the CDROM.

Get or set modifier used with EJECTCDKEY.

Disable or enable the eject key response delay.

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.

Get or set the IBAM data directory where statistics about battery charge and discharge cycles are stored.
This option would only be available, if pbbuttonsd was compiled with IBaM support.

Get or set the keycode used for triggering sleep mode.

Get or set the modifier used with SLEEPKEY

Disable or enable the sleep key response delay.

Get or set time in seconds for the first battery warn level.

Get or set time in seconds for the second battery warn level.

Get or set time in seconds for the last battery warn level.

Get the current battery warn level.

Disable or enable the CPU sleep lock.

Get or set the minimum CPU load to activate the sleep lock.

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.

Disable or enable the net sleep lock.

Get or set the minimum net load to activate the sleep lock.

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.

Get or set the network device to be supervised for the net sleeplock.

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.

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.

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

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

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

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.

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.

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.

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

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

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

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.

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.

Enable or disable the heartbeat beep if the computer is running with closed lid. 0=disable beep, 1=enable beep.

Get or set the current power policy Following values are valid: 0=nochange, 1=powersave, 2=custom and 3=performance.

Get the machine's identity string.

SEE ALSO

pbbuttons.cnf (5), showkey (1)

AUTHOR

Matthias Grimm <matthiasgrimm@users.sourceforge.net>.

February 7, 2007