D-Bus Documentation

ActiveContainerId

Description

Returns the ID associated with the current active container.

Return Value

container_id - The UUID as a UTF-8 encoded string.

Examples

from pydbus import SessionBus
bus = SessionBus()
layout = bus.get(bus_name='org.way-cooler', object_path='/org/way_cooler/Layout')
active_id = layout.ActiveContainerId()
print("The active container id is %s" % active_id)

ActiveWorkspace

Description

Gets the name of the current active workspace.

Return Value

name - A UTF-8 encoded string representing the current workspace name.

Examples

from pydbus import SessionBus
bus = SessionBus()
layout = bus.get(bus_name='org.way-cooler', object_path='/org/way_cooler/Layout')
current_workspace = layout.ActiveWorkspace()
print("The current workspace is %s" % current_workspace)

CloseView

Description

Closes the View that is associated with the given UUID.

If no such view exists an error is returned.

If the UUID does not point to a View then an error is returned and no action is taken.

Parameters

view_id - The UUID as a UTF-8 string of the view you want to remove.

Return Value

success - Unused boolean value, always returns True

Examples

from pydbus import SessionBus
bus = SessionBus()
layout = bus.get(bus_name='org.way-cooler', object_path='/org/way_cooler/Layout')
active_id = layout.ActiveContainerId()
layout.CloseView(active_id)

ContainerInActiveWorkspace

Description

Determines whether or not the container associated with the UUID is in the active workspace or not.

If the container is on a workspace that is on another output that is not focused, this method will return false. The only criteria for active workspace is if the user is focused on a container in that workspace.

Do not rely on this method to tell if a container is visible to the user or not.

Parameters

container_id - The UUID as a UTF-8 string of the container you think is in the active workspace.

Return Value

success - Boolean value that is true if the container is in the active workspace, false otherwise.

Examples

from pydbus import SessionBus
bus = SessionBus()
layout = bus.get(bus_name='org.way-cooler', object_path='/org/way_cooler/Layout')
active_id = layout.ActiveContainerId()
is_in_active = layout.ContainerInActiveWorkspace(active_id)
assert(is_in_active)

Debug

Description

This method is deprecated

It is purposely undocumented in order to discourage use. This will be removed in a future version. Do not attempt to parse the terribly formatted JSON that this method returns.

Focus

Description

Focuses on the container associated with the given UUID.

If the container is already focused then no action will be taken and no error will be returned.

If the container cannot be focused on then no action will be taken and an error will be returned.

Parameters

container_id - The UUID as a UTF-8 string of the container you want to focus on.

Return Value

success - Unused boolean value, always returns True

Examples

from pydbus import SessionBus
bus = SessionBus()
layout = bus.get(bus_name='org.way-cooler', object_path='/org/way_cooler/Layout')
active_id = layout.ActiveContainerId()
layout.Focus(active_id)
new_active_id = layout.ActiveContainerId()
assert(active_id == new_active_id)

FocusDir

Description

Focuses on the container relative to the active container. The direction is based on the given relative direction.

Parameters

direction - A UTF-8 encoded string representing one of the four cardinal directions:

  • "up"
  • "down"
  • "left"
  • "right"

Return Value

success - Unused boolean value, always returns True

Examples

from pydbus import SessionBus
bus = SessionBus()
layout = bus.get(bus_name='org.way-cooler', object_path='/org/way_cooler/Layout')
active_id = layout.ActiveContainerId()
layout.FocusDir("right")

FullScreen

Description

Sets a container to be fullscreen / not fullscreen.

A fullscreen container is no longer tiled according to its parent container, and use the entire screen.

If a container is toggled to be in a state it is already in then no error is returned and no action is taken.

Parameters

container_id - The UUID as a UTF-8 string of the container you want to move.

toggle - Boolean value. If true, the container is made fullscreen. If false the container is set to no longer be fullscreen.

Return Value

success - Unused boolean value, always returns True

Examples

from pydbus import SessionBus
bus = SessionBus()
layout = bus.get(bus_name='org.way-cooler', object_path='/org/way_cooler/Layout')
active_id = layout.ActiveContainerId()
layout.FullScreen(active_id)

GrabAtCorner

Description

This method is deprecated

It is purposely undocumented in order to discourage use. This will be removed in a future version.

MoveContainer

Description

Moves a tiled container in the desired direction. This only works on non-floating containers.

Parameters

container_id - The UUID as a UTF-8 string of the container you want to move.

direction - A UTF-8 encoded string representing one of the four cardinal directions:

  • "up"
  • "down"
  • "left"
  • "right"

Return Value

success - Unused boolean value, always returns True

Examples

from pydbus import SessionBus
bus = SessionBus()
layout = bus.get(bus_name='org.way-cooler', object_path='/org/way_cooler/Layout')
active_id = layout.ActiveContainerId()
layout.MoveContainer(active_id, "right")

SendToWorkspace

Description

Sends the container associated with the UUID to the named workspace.

If the workspace does not yet exist, a new one is created on the active output and the container is then sent there.

Note that this does not switch to the workspace, but focus will shift to the next available container in the current workspace.

Parameters

container_id - The UUID as a UTF-8 string of the container you want to move.

w_name - A UTF-8 encoded string representing the name of the workspace to switch to.

Return Value

success - Unused boolean value, always returns True

Examples

from pydbus import SessionBus
bus = SessionBus()
layout = bus.get(bus_name='org.way-cooler', object_path='/org/way_cooler/Layout')
first_active_id = layout.ActiveContainerId()

# Note that this can be ANY string, 
# including one not specified in the configuration file
layout.SendToWorkspace(first_active_id, "a different workspace")
second_active_id = layout.ActiveContainerId()
assert(first_active_id != second_active_id)

SetPointerPos

Description

Sets the absolute position of the pointer to the given coordinates.

If the values are beyond the range of the output, then they are clamped to the edge of the screen.

E.g on a 800x600 screen, an input of x = 700 and y = 700 will result in the pointer being set at 700x600.

Parameters

x - The x value of the coordinates, as a signed 32 bit number.

y - The y value of the coordinates, as a signed 32 bit number.

Return Value

success - Unused boolean value, always returns True

Examples

from pydbus import SessionBus
bus = SessionBus()
layout = bus.get(bus_name='org.way-cooler', object_path='/org/way_cooler/Layout')
layout.SetPointerPos(100, 100)

SplitContainer

Description

Changes how a container will layout its children.

If the container is a View, it creates a new sub-container with the only child being that view.

If the container is a Container, then that container’s tile layout changes to the provided layout.

Parameters

container_id - The UUID as a UTF-8 string of the container you want to change the layout of.

split_axis - A UTF-8 encoded string representing one of the following layout styles:

  • "vertical"
  • "horizontal"
  • "tabbed"
  • "stacked"

Return Value

success - Unused boolean value, always returns True

Examples

from pydbus import SessionBus
bus = SessionBus()
layout = bus.get(bus_name='org.way-cooler', object_path='/org/way_cooler/Layout')
active_id = layout.ActiveContainerId()
layout.SplitContainer(active_id, "vertical")

SwitchWorkspace

Description

Switches to a named workspace. If the named workspace is on a different output, both the focused workspace and the focused output is changed.

If the workspace does not exist yet, a new one is created on the currently focused output.

Parameters

w_name - A UTF-8 encoded string representing the name of the workspace to switch to.

Return Value

success - Unused boolean value, always returns True

Examples

from pydbus import SessionBus
bus = SessionBus()
layout = bus.get(bus_name='org.way-cooler', object_path='/org/way_cooler/Layout')
first_active_id = layout.ActiveContainerId()

# Note that this can be ANY string, 
# including one not specified in the configuration file
layout.SwitchWorkspace("a different workspace")
second_active_id = layout.ActiveContainerId()
assert(first_active_id != second_active_id)

ToggleCardinalTiling

Description

Toggles how a container will layout its children between horizontal and vertical.

If the container is neither horizontal or vertical, it will default to horizontal.

Parameters

container_id - The UUID as a UTF-8 string of the container you want to change the layout of.

Return Value

success - Unused boolean value, always returns True

Examples

from pydbus import SessionBus
bus = SessionBus()
layout = bus.get(bus_name='org.way-cooler', object_path='/org/way_cooler/Layout')
active_id = layout.ActiveContainerId()
layout.ToggleCardinalTiling(active_id)

ToggleFloat

Description

Toggles a floating container to be tiled, or a tiled container to be floating.

Parameters

container_id - The UUID as a UTF-8 string of the container you want to float/ground.

Return Value

success - Unused boolean value, always returns True.

Examples

from pydbus import SessionBus
bus = SessionBus()
layout = bus.get(bus_name='org.way-cooler', object_path='/org/way_cooler/Layout')
active_id = layout.ActiveContainerId()
layout.ToggleFloat(active_id)