Solution to Keeping Compiz Rotate Cube Active

In a previous post I gave a solution to keeping the Compiz cube (Rotate Cube Plugin) zoomed out from the desktop. I thought it was a shame that you only really see it briefly when switching between desktops. The Cube really shows off Compiz with it’s ability to keep digital TV or video playing live within the 3D environment.

I used a hack using mouse button definitions in the X setup file, but now I’ve found the “right” way of doing this ! It involves sending a message to Compiz using the Dbus system

dbus-send –type=method_call –dest=org.freedesktop.compiz /org/freedesktop/compiz/rotate/allscreens/initiate_button org.freedesktop.compiz.activate string:’root’ int32:`xwininfo -root | grep id: | awk ‘{ print $4 }’`

Executing that at the command line will immediately go into rotate cube mode “free rotate” using the mouse. To return back to the normal desktop press the escape key (Esc). The command can be linked to a keypress, or, as I have done, linked to a GUI button.

screenshot-compiz-ui1

#!/usr/bin/wish

# Tk is the GUI language. Tcl is the programming language.
# See http://www.tkdocs.com/tutorial/intro.html

package require Tk

wm title . “Compiz UI”
frame .clipaste_frame -relief raised -bd 1
label .1 -text “Compiz Window Manager”
button .a -text “Mouse Particles” -command { exec /home/djbarney/compiz/showmouse }
button .b -text “Expo” -command { exec /home/djbarney/compiz/expo }
button .c -text “Rotate” -command { exec /home/djbarney/compiz/rotatecube }
pack .1 -side left
pack .a -side left
pack .b -side left
pack .c -side left

The Dbus command is contained in an external executable text file.

Advertisements

3 thoughts on “Solution to Keeping Compiz Rotate Cube Active

  1. The zoomed out Compiz Cube or Cylinder should become the default interface. Users should be able to manipulate windows directly on this interface, and select to focus on one particular desktop when they’re using a specific application. This interface can be coupled with webcam headtracking to produce a 3D environment that will be much easier to organise than a standard desktop.

    Note that the syntax for the dbus command given in the original post needs slight modification to work in Compiz 0.8.4

    I used the following command in CCSM>Commands and then I can bind any key/button/edge to keep the Compiz Cube or Cylinder zoomed out.

    dbus-send –type=method_call –dest=org.freedesktop.compiz /org/freedesktop/compiz/rotate/allscreens/initiate_button org.freedesktop.compiz.activate string:’root’ int32:`xwininfo -root | grep id: | awk ‘{ print $4 }’`

    I also use 2 more commands to adjust the zoom level of the Cube in (somewhat delayed) real-time:

    dbus-send –type=method_call –dest=org.freedesktop.compiz /org/freedesktop/compiz/rotate/screen0/zoom org.freedesktop.compiz.set double:`dbus-send –print-reply –type=method_call –dest=org.freedesktop.compiz /org/freedesktop/compiz/rotate/screen0/zoom org.freedesktop.compiz.get | grep double | awk ‘{print $2+0.1}’`

    dbus-send –type=method_call –dest=org.freedesktop.compiz /org/freedesktop/compiz/rotate/screen0/zoom org.freedesktop.compiz.set double:`dbus-send –print-reply –type=method_call –dest=org.freedesktop.compiz /org/freedesktop/compiz/rotate/screen0/zoom org.freedesktop.compiz.get | grep double | awk ‘{print $2-0.1}’`

    The zoom would ideally be controlled smoothly by a scrolling wheel or touchpad scroll, but I haven’t had the time to attempt it.

  2. Thanks. I’ll give that a go.

    I agree that Compiz could be improved to provide use of 3D top organise the desktop. I think it’s still stuck in it’s effects and prettifying stage. Good as that is there could be a more “usability” focus. Amazing project.

  3. Thanks for the tip!
    Please notice that the straight quote, or apostrophe (‘, or '), is rendered as a curved one. Also, double dashes (- -) are shown as single long dashes (–). The commands don’t work when pasted like that on a terminal.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s