tps.hooks

Functions that execute the appropriate hooks.

tps.hooks.get_graphicsl_user()
tps.hooks.main_dock_hook()

Entry point for thinkpad-dock-hook.

It interprets the key values from the caller and start up another interpreter with the actual thinkpad-dock script.

tps.hooks.main_rotate_hook()

Entry point for thinkpad-rotate-hook.

It interprets the key values from the caller and start up another interpreter with the actual thinkpad-rotate script.

tps.hooks.parse_graphical_user(lines)

Determine the graphical user from the output of who -u.

tps.hooks.postdock(state, config)

Executes postdock hook if it exists.

Parameters:
  • state (bool) – Whether new state is on
  • config (configparser.ConfigParser) – Global config
Returns:

None

tps.hooks.postrotate(direction, config)

Executes postrotate hook if it exists.

Parameters:
  • direction (tps.Direction) – Desired direction
  • config (configparser.ConfigParser) – Global config
Returns:

None

tps.hooks.predock(state, config)

Executes predock hook if it exists.

Parameters:
  • state (bool) – Whether new state is on
  • config (configparser.ConfigParser) – Global config
Returns:

None

tps.hooks.prerotate(direction, config)

Executes prerotate hook if it exists.

Parameters:
  • direction (tps.Direction) – Desired direction
  • config (configparser.ConfigParser) – Global config
Returns:

None