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:

-h, --help
    Show summary of options.

-v, --version
    Show version of pbbcmd.

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

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:

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

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

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

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

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

ejectcd
    Eject the CDROM.

sleep
    Suspend the machine to RAM.

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:

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.

string
    String of characters. The string must be quoted if it contains white spaces.

integer
    32-bit integer values. The description would say if the value range was restricted.

bool
    A boolean value. A '0' means false and a '1' means true. Any other values are invalid.

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

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.

LIST OF TAGS for query and config

TAG_AUTORESCAN         bool        config/query
    Enable or disable periodically scan of event devices to detect new or lost keyboards automatically.

TAG_VERSION            string      query
    Get version string of the server

TAG_TIMEFORCMD         integer     config/query
    Get or set the timeout for launched scripts or helper programs.

TAG_TIMEREMAINING      integer     query
    Get the current time in seconds the battery will last.

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

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

TAG_PMUDEVICE          string      config/query
    Get or set the pmu device. This is only useful on Apple PowerBooks and compatible.

TAG_ADBDEVICE          string      config/query
    Get or Set the ADB device. This is only useful on Apple PowerBooks and compatible.

TAG_TPMODEUPKEY        keycode     config/query
    Get or set keycode used for trackpad mode up.

TAG_TPMODEUPMOD        modifier    config/query
    Get or Set modifier used with TPMODEUPKEY.

TAG_TPMODEDOWNKEY      keycode     config/query
    Get or set keycode used for trackpad mode down.

TAG_TPMODEDOWNMOD      modifier    config/query
    Get or set modifier used with TPMODEDOWNKEY.

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

TAG_NOTAPTYPING        bool        config/query
    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.

TAG_KBDMODE            integer     config/query
    Get or set the keyboard mode. Supported values are 0=fkeyslast and 1=fkeysfirst. All other values are invalid.

TAG_BATLOG             integer     config/query
    Get or set the battery logging mode. Supported values are 0=none, 1=cycle and 2=log. See pbbuttonsd.conf (5) man-page for detailed description.

TAG_BATCYCLE           integer     query
    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.

TAG_BATTERYPRESENT     integer     query
    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.

TAG_LCDILLUMUPKEY      keycode     config/query
    Get or set keycode used for increasing display brightness.

TAG_LCDILLUMUPMOD      modifier    config/query
    Get or set modifier used with LCDILLUMUPKEY.

TAG_LCDILLUMDOWNKEY    keycode     config/query
    Get or set keycode used for decreasing display brightness.

TAG_LCDILLUMDOWNMOD    modifier    config/query
    Get or set modifier used with LCDILLUMDOWNKEY.

TAG_LCDBRIGHTNESS      integer     config/query
    Get or set current brightness level. The value can't be higher than the value returned by LCDBRIGHTNESSMAX.

TAG_LCDBRIGHTNESSMAX   integer     query
    Get the maximum brightness level the display supports.

TAG_LCDAUTOADJUST      bool        config/query
    Enable or disable automatic brightness control for the display.

TAG_LCDAUTOADJMINBAT   integer     config/query
    Set minimum brightness limit for automatic adjustment, if running on battery.

TAG_LCDAUTOADJMAXBAT   integer     config/query
    Set maximum brightness limit for automatic adjustment, if running on battery.

TAG_LCDAUTOADJMINAC    integer     config/query
    Set minimum brightness limit for automatic adjustment, if running on AC.

TAG_LCDAUTOADJMAXAC    integer     config/query
    Set maximum brightness limit for automatic adjustment, if running on AC.

TAG_KBDILLUMUPKEY      keycode     config/query
    Get or set keycode used for increasing keyboard brightness.

TAG_KBDILLUMUPMOD      modifier    config/query
    Get or set modifier used with KBDILLUMUPKEY.

TAG_KBDILLUMDOWNKEY    keycode     config/query
    Get or set keycode used for decreasing keyboard brightness.

TAG_KBDILLUMDOWNMOD    modifier    config/query
    Get or set modifier used with KBDILLUMDOWNKEY.

TAG_KBDILLUMONKEY      keycode     config/query
    Get or set keycode used to switch keyboard illumination on or off.

TAG_KBDILLUMONMOD      modifier    config/query
    Get or set modifier used with KBDILLUMONKEY.

TAG_KBDBRIGHTNESS      integer     config/query
    Get or set current brightness level. The value can't be higher than the value returned by KBDBRIGHTNESSMAX.

TAG_KBDONBRIGHTNESS    integer     config/query
    Get or set default ON status brightness level. The value can't be higher than the value returned by KBDBRIGHTNESSMAX.

TAG_KBDBRIGHTNESSMAX   integer     query
    Get the maximum brightness level the keyboard supports.

TAG_KBDAUTOADJUST      bool        config/query
    Enable or disable automatic brightness control for the keyboard illumination.

TAG_FRAMEBUFFERDEVICE  string      config/query
    Get or set the framebuffer device.

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

TAG_DIMFULLYDARK       bool        config/query
    Normally the display is dimmed down to minimum level. With this option set dimming goes down to complete darkness.

TAG_AMBIENTLIGHT       integer     query
    Get the value from the ambient light sensor in percent. This works only on machines that have an ambient light sensor.

TAG_AMBIENTTHRESHOLD   integer  config/query
    Get or set the threshold for ambient light to activate the keyboard illumination.

TAG_LCDFADINGSPEED     integer     config/query
    Disable or enable the smoothly LCD brightness change. The value set the speed. '0' disables this feature. Try '3' to '5' for good results.

TAG_KBDFADINGSPEED     integer     config/query
    Disable or enable the smoothly keyboard brightness change. The value set the speed. '0' disables this feature.

TAG_MIXERDEVICE        string      config/query
    Get or set OSS sound mixer device.

TAG_MIXERCHANNELS      string      config/query
    Get or set a comma separated list of OSS mixer channels pbbuttonsd should control. Every channel combination is valid nevertheless the setting makes sense.

TAG_MIXERCARD          string      config/query
    Get or set ALSA sound card

TAG_MIXERELEMENTS      string      config/query
    Get or set a comma separated list of ALSA elements pbbuttonsd should control. For possible names ask amixer.

TAG_VOLUMEUPKEY        keycode     config/query
    Get or set keycode used for sound volume up.

TAG_VOLUMEUPMOD        modifier    config/query
    Get or set modifier used with VOLUMEUPKEY.

TAG_VOLUMEDOWNKEY      keycode     config/query
    Get or set keycode used for sound volume down.

TAG_VOLUMEDOWNMOD      modifier    config/query
    Get or set modifier used with VOLUMEDOWNKEY.

TAG_MUTEKEY            keycode     config/query
    Get or set keycode used for mute sound volume.

TAG_MUTEMOD            modifier    config/query
    Get or set modifier used with MUTEKEY.

TAG_MIXERINITDELAY     bool        config/query
    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.

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

TAG_MUTE               command     config
    Mute/unmute the speakers.

TAG_CDROMDEVICE        string      config/query
    Get or set the CDROM device.

TAG_EJECTCDKEY         keycode     config/query
    Get or set keycode used for ejecting the CDROM.

TAG_EJECTCDMOD         modifier    config/query
    Get or set modifier used with EJECTCDKEY.

TAG_EJECTCDKEYDELAY    bool        config/query
    Disable or enable the eject key response delay.

TAG_SCRIPTPMCS         string      config/query
    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.

TAG_SLEEPKEY           keycode     config/query
    Get or set the keycode used for triggering sleep mode.

TAG_SLEEPMOD           modifier    config/query
    Get or set the modifier used with SLEEPKEY

TAG_SLEEPKEYDELAY      bool        config/query
    Disable or enable the sleep key response delay.

TAG_BWLFIRST           integer     config/query
    Get or set time in seconds for the first battery warn level.

TAG_BWLSECOND          integer     config/query
    Get or set time in seconds for the second battery warn level.

TAG_BWLLAST            integer     config/query
    Get or set time in seconds for the last battery warn level.

TAG_CURRENTBWL         integer     query
    Get the current battery warn level.

TAG_CPULOADSLEEPLOCK   bool        config/query
    Disable or enable the CPU sleep lock.

TAG_CPULOADMIN         integer     config/query
    Get or set the minimum CPU load to activate the sleep lock.

TAG_CPULOADPERIOD      integer     config/query
    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.

TAG_NETLOADSLEEPLOCK   bool        config/query
    Disable or enable the net sleep lock.

TAG_NETLOADMIN         integer     config/query
    Get or set the minimum net load to activate the sleep lock.

TAG_NETLOADPERIOD      integer     config/query
    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.

TAG_NETLOADDEV         string      config/query
    Get or set the network device to be supervised for the net sleeplock.

TAG_EMERGENCYACTION    integer     config/query
    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.

TAG_ONAC_POLICY        integer     config/query
    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.

TAG_ONAC_TIMERACTION   integer     config/query
    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

TAG_ONAC_COVERACTION   integer     config/query
    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

TAG_ONAC_KEYACTION     integer     config/query
    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

TAG_ONAC_TIMESUSPEND   integer     config/query
    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.

TAG_ONAC_TIMEDIM       integer     config/query
    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.

TAG_ONBATT_POLICY      integer     config/query
    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.

TAG_ONBATT_TIMERACTION integer     config/query
    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

TAG_ONBATT_COVERACTION integer     config/query
    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

TAG_ONBATT_KEYACTION   integer     config/query
    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

TAG_ONBATT_TIMESUSPEND integer     config/query
    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.

TAG_ONBATT_TIMEDIM     integer     config/query
    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.

TAG_HEARTBEATBEEP      boolean     config/query
    Enable or disable the heartbeat beep if the computer is running with closed lid. 0=disable beep, 1=enable beep.

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

TAG_IDENTITY           string      query
    Get the machine's identity string.

SEE ALSO
pbbuttons.conf (5), showkey (1)

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