Thursday, April 10, 2008

Curious Photo

This is what the sprinkler head looks like in a room at the Holiday Inn.

Wednesday, April 9, 2008

Ideal Compiz Settings

My friend Mike asked me to post a tutorial explaining how I configure my Compiz and why I make the choices I do. I'm not going to explain how to install compiz, as there are plenty of other sites out there explaining this process already.

My choices are intended to leverage Compiz to improve the level of usability, while at the same time remaining visually impressive. A lot of thought has gone to my keybinding choices to make them logical and optimal. Window Manager tasks will be performed using the Super (Windows) key as a modifier. This includes commands to launch a new window. Desktop Cube tasks will be performed using the Control+Alt modifiers. Control and Alt (when used individually as modifiers) are left for controlling applications. As you set some of the keys below, you'll run into some conflicts and need to choose something like "Set Anyway" but we will change the conflicting keys as we proceed further into the setup.

To get started, the first thing you need to do is install the preferences panel for "Advanced Desktop Effects Settings":

sudo apt-get install compizconfig-settings-manager

Lets begin by configuring the General Options. Enter all values excluding the quotes.

General Options

"Command line 0" = "/usr/bin/gnome-screensaver-command --lock"
"Command line 1" = "gedit" Or the graphical text editor of your choice.

Desktop Size:
"Horizontal Virtual Size" = 4
"Vertical Virtual Size" = 1
"Number of Desktops" = 1

Display Settings: These are fairly ordinary, but I repeat them here because having them properly configured will ensure a smooth display.
"Texture Filter" = "Good"
"Detect Refresh Rate" = Checked
"Lighting" = Checked
"Refresh Rate" = 60 (Or your screen's redraw Hz at the current resolution.)
"Sync to VBlank" = Checked
"Detect Outputs" = Checked

Actions: I'm only listing the ones I changed from the defaults.
"General: Run Dialog" = "r"
"General: Hide all windows and focus desktop" = "d"
"General: Toggle Window Maximized" = "x"
"General: Toggle Window Shaded" = "Up"
"General: Open a Terminal" = "c"
"Commands: Run command 0" = "l"
"Commands: Run command 1" = "e"

Now I will cover each and every plug-in which I have enabled. I recommend disabling all the other plug-ins by removing the tick from the check-box, unless you have a specific use for them.


ADD Helper
ADD helper is a quick way to subdue all the windows except the one currently focused by fading them out to dark gray.

Misc. options:
"Brightness" = 30
"Saturation" = 50
"Opacity" = 100

"Toggle ADD Helper" = "p"


Being a true geek, I often use my computer at night, sometimes while other people are trying to watch movies which aren't interesting enough to keep my attention. Negative is great when computing in the dark, to reduce eye-strain and to reduce the amount of light emitted from the screen which may disturb others.

"Toggle Window Negative" = "n"
"Toggle Screen Negative" = "m"


Desktop Cube
This is the foundation for perhaps the most famous eye-candy provided by compiz.

"Mipmap" = Checked

"Inside Cube" = Not Checked
"Acceleration" = 4.0000
"Speed" = 1.5000
"Timestep" = 1.2000

Transparent Cube:
"Opacity During Rotation" = 75.0000
"Opacity When Not Rotating" = 100.0000
"Fade Time" = 1.0000
"Transparency Only on Mouse Rotate" = Checked.

"Unfold" = "space"
"Next Slide" = "space"
"Prev Slide" = ""


"Reflection" = Checked. I like the look of this plug-in better when the reflection is enabled, but if it runs slowly, you can turn it off.

"Expo" = "Down"

Rotate Cube
Here we make some minor adjustments to sweeten the animation.

"Edge Flip Move" = Checked.
"Edge Flip DnD" = Checked.
"Flip Time" = 350
"Pointer Sensitivity" = 1.0000
"Acceleration" = 1.0000
Snap to Top Face = Checked.
Speed = 2.0000
Timestep = 1.0000
Zoom = 0.0000

"Initiate", Key = "None", Button = "Button1"
"Rotate Left" = "Left"
"Rotate Right" = "Right"
"Rotate Left with Window" = "Left"
"Rotate Right with Window" = "Right"


Fading Windows

Window Decoration

I will finish this post soon and revise it. I wanted to post it now because it is useful even as is, and the new compiz settings manager (available in Ubuntu Hardy Heron) is slightly different so I need to go back through and update it for that.

Windows+L to Lock Screen.

Aka L or L. For the past several releases Gnome/Metacity have an issue with setting certain keyboard binding shortcuts involving the WinKey.

There are really normally two bugs involved. The first bug is that Gnome doesn't think the Win key is a modifier, so it registers as Super_L (meaning the Left Super Key as a standalone) whenever you try to bind a shortcut using that key. This can be fixed through System -> Preferences -> Keyboard -> Layout Options -> Alt/Win Key Behavior. Choose the option labeled "Super is mapped to the Win-keys (default)" Yes, I know it says default, but it isn't really. You'll notice that one or two other options in the same series are also labeled default.

The second bug is that there are two separate shortcut managers, metacity and gnome-settings-daemon, and one of them (gnome-settings-daemon) happens before gnome does its magic modifier mappings, the other happens after. Basically this means that when you set the key bindings under Keyboard Shortcuts in preferences, you are using a certain key layout when you make your selection, but when the keys actually get interpreted, they are using a different (and defective) layout, which lacks certain keys -- such as the Windows key. So far, there's not really a good way to fix the problem, but there is a way to work around it. Instead of letting gnome-settings-daemon handle the task you are trying to assign, find an alternate way to perform the task using metacity (or compiz). Open up gconf-editor from a terminal, then go to /apps/metacity/global_keybindings where you will find a series of run_command_X options from 1 to 12. Fill in one of them with the value l (you actually type it like that, with the angle brackets, etc.) then fill in the corresponding command_X item in /apps/metacity/keybinding_commands with the command you are trying to launch, which - if you are trying to bind Windows+L is most likely:

/usr/bin/gnome-screensaver-command --lock

This will launch the gnome screensaver and lock the screen.

I know this isn't perfect, but a workaround is better than nothing. I hope it was helpful!