Sunday, 9 May 2010

Ensure Compiz starts with --loose-binding upon login with a handy script


Previously talked about was the massive perfomance enhancement systems using Nvidia cards and Compiz enjoy when Compiz is started with the '--loose-binding' option. To ensure that this happens properly upon every login i've found that deploying a quick little bash script is easiest.

To create the script:

gedit compiz-start.sh
Copy and pase the following into it
#!/bin/bash

compiz --replace --loose-binding
gtk-window-decorator --replace
Save and close gedit.

Make the script executable: 
 chmod 700 compiz-start.sh
At this point you can test the script using './compiz-start.sh' from your home directory.

To add this script to your list of startup applications: 

In Ubuntu, go to 'System > Preferences > Startup Applications' and add the line:
/home/yourusername/compiz-start.sh
So that it is one of the entries. At this stage, you're done, however, i've found the script works best when combined with the delay script mentioned previously.

So with that, the line to run the compiz script after five seconds would be:
 /home/yourusername/delay.sh 5 "/home/yourusername/compiz-start.sh"
Done!

No comments:

Post a Comment