Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
correct way to launch compiz automatically?
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
ph03n1x
l33t
l33t


Joined: 06 Feb 2003
Posts: 756

PostPosted: Fri Apr 25, 2008 8:52 pm    Post subject: correct way to launch compiz automatically? Reply with quote

Hi all

I have seen several ways to start compiz automatically after login (using gnome)

None of them seems to work flawless here. What would be the correct way to automatically start compiz? I'm using

compiz --replace ccp --sm-disable &
emerald --replace

which works fine when I enter this manually after the login. ~/.xinitrc seems to be ignored somehow but I don't know why. At least it's not working.

Thx for a clean working hint ;-)
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7470

PostPosted: Fri Apr 25, 2008 8:55 pm    Post subject: Reply with quote

well i have just add /usr/bin/compiz-start in gnome session/starting programs ;)
and in my case i have change last line to compiz-start to add ccp as
Code:
compiz $COMPIZ_OPTIONS ccp gconf move resize minimize place decoration wobbly...
Back to top
View user's profile Send private message
ph03n1x
l33t
l33t


Joined: 06 Feb 2003
Posts: 756

PostPosted: Fri Apr 25, 2008 10:05 pm    Post subject: Reply with quote

krinn wrote:
well i have just add /usr/bin/compiz-start in gnome session/starting programs ;)
and in my case i have change last line to compiz-start to add ccp as
Code:
compiz $COMPIZ_OPTIONS ccp gconf move resize minimize place decoration wobbly...


Well I don't know those scripts and stuff seem to make even more mess for me ;-)

I ended up putting

compiz --replace ccp --sm-disable &
emerald --replace

Into a shell-script and launch it from the session. Probably not a very nice solution but it works more or less...

Thx anyway
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7470

PostPosted: Fri Apr 25, 2008 11:17 pm    Post subject: Reply with quote

oh i don't remember add it myself, i was thinking it was with compiz
Code:
# compiz-start script
#
# hacky autodetection of neccessary options for XGL/AIGLX/NVIDIA
#
# Hanno Boeck, http://www.hboeck.de/
#
# Licensed under the same conditions as compiz itself (MIT or GPL)

if [ ! -x /usr/bin/glxinfo ]; then
   echo "glxinfo not found, please install mesa-progs."
   exit -1
fi

GLX_WITH_DIRECT=`glxinfo|grep -c GLX_EXT_texture_from_pixmap`
GLX_WITH_INDIRECT=`LIBGL_ALWAYS_INDIRECT=1 glxinfo|grep -c GLX_EXT_texture_from_pixmap`
GLX_RENDER=`glxinfo|grep -c "OpenGL renderer string: Mesa GLX Indirect"`


COMPIZ_OPTIONS="--replace"

if [ $GLX_WITH_DIRECT -eq 3 ]; then
   if [ $GLX_RENDER -eq 0 ]; then
      echo NVIDA detected
      export __GL_YIELD="NOTHING"
   else
      echo XGL detected
   fi
elif [ $GLX_WITH_INDIRECT -eq 3 ]; then
   echo AIGLX detected
   export LIBGL_ALWAYS_INDIRECT=1
fi

if [ ! -z $KDE_FULL_SESSION ] && [ -x /usr/bin/kde-window-decorator ]; then
   echo Using KDE decorator
   kde-window-decorator --replace &
else
   echo Using GTK decorator
   gtk-window-decorator --replace &
fi

compiz $COMPIZ_OPTIONS ccp gconf move resize minimize place decoration wobbly fade cube rotate scale switcher zoom dbus
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7470

PostPosted: Fri Apr 25, 2008 11:19 pm    Post subject: Reply with quote

hey wait !
Code:
equery b /usr/bin/compiz-start
[ Searching for file(s) /usr/bin/compiz-start in *... ]
x11-wm/compiz-0.6.2-r1 (/usr/bin/compiz-start)
b


i know i'm a too lazy boy to add it myself :)
Back to top
View user's profile Send private message
ph03n1x
l33t
l33t


Joined: 06 Feb 2003
Posts: 756

PostPosted: Sat Apr 26, 2008 6:55 am    Post subject: Reply with quote

hehe, well i'm fine now with my ugly solution seems to work more stable than anything i tried previously...
Back to top
View user's profile Send private message
NaterGator
n00b
n00b


Joined: 14 Jan 2008
Posts: 69
Location: Gainesville, Fl

PostPosted: Sat Apr 26, 2008 2:53 pm    Post subject: Reply with quote

You may also consider looing at the fusion-icon package in portage.

It loads your window manager when it is first run and then allows you to switch between WMs and window decorators, restart compiz, etc once loaded. Very handy for times when compiz crashes.
Back to top
View user's profile Send private message
jcat
Veteran
Veteran


Joined: 26 May 2006
Posts: 1337

PostPosted: Sat Apr 26, 2008 3:28 pm    Post subject: Reply with quote

Yup, I use Fusion-Icon added to Gnome's session manager. Never had a problem, and Fusion-Icon is a handy little tool to have in your sys tray.



Cheers,
jcat
Back to top
View user's profile Send private message
SeaTiger
l33t
l33t


Joined: 22 Nov 2007
Posts: 603
Location: Toronto, Ontario, Canada

PostPosted: Sun Apr 27, 2008 12:01 am    Post subject: Modify /usr/bin/gnome-wm Reply with quote

/usr/bin/gnome-wm actually has build in support for starting compiz automatically. However it seems no one update it to support the latest compiz version and need modification to make it work. Look for lines in red below, that's all you need to change.

/usr/bin/gnome-wm
Quote:

#!/bin/sh

# The user can specify his prefered WM by setting the WINDOW_MANAGER
# environment variable.
#
# If this is not set, we search a list of known windowmanagers and use
# the first one that is found in the users's PATH
#

# sm-client-id value
SMID=
# default-wm value
DEFWM=

#read in the arguments
GET=
for n in "$@" ; do
case "$GET" in
smid)
SMID=$n
GET=
;;
defwm)
DEFWM=$n
GET=
;;
*)
case "$n" in
--sm-client-id)
GET=smid
;;
--default-wm)
GET=defwm
;;
esac
;;
esac
done

# WINDOW_MANAGER overrides all
WINDOW_MANAGER="compiz"

if [ -z "$WINDOW_MANAGER" ] ; then
# Create a list of window manager we can handle, trying to only use the
# compositing ones when it makes sense

xdpyinfo 2> /dev/null | grep -q "^ *Composite$" 2> /dev/null
IS_X_COMPOSITED=$?

KNOWN_WM="sawfish sawmill enlightenment icewm wmaker fvwm2 qvwm fvwm twm kwm"
if [ $IS_X_COMPOSITED -eq 0 ] ; then
KNOWN_WM="compiz beryl $KNOWN_WM"
fi
# metacity is still the default wm in GNOME
KNOWN_WM="metacity $KNOWN_WM"

OLDIFS=$IFS
if [ -z "$DEFWM" -o "x$DEFWM" = "xgnome-wm" ]; then
for wm in $KNOWN_WM ; do
IFS=":"
for dir in $PATH ; do
if [ -x "$dir/$wm" ] ; then
WINDOW_MANAGER="$dir/$wm"
break 2
fi
done
IFS=$OLDIFS
done
else
WINDOW_MANAGER=$DEFWM
fi
IFS=$OLDIFS
fi

# If no window manager can be found, we default to xterm

if [ -z "$WINDOW_MANAGER" ] ; then
echo "WARNING: No window manager can be found."
WINDOW_MANAGER=xterm
fi

# Now create options OPT1, OPT2 and OPT3 based on the windowmanager used
OPT1=
OPT2=
OPT3=
OPT4=
if [ ! -z "$SMID" ] ; then
case `basename $WINDOW_MANAGER` in
sawfish|sawmill|metacity)
OPT1=--sm-client-id=$SMID
;;
openbox|enlightenment|e16)
OPT1=--sm-client-id
OPT2=$SMID
;;
twm)
OPT1=-clientId
OPT2=$SMID
;;
lwm)
OPT1=-s
OPT2=$SMID
;;
fvwm)
OPT1=-i
OPT2=$SMID
;;
compiz)
OPT1=--sm-client-id
OPT2=$SMID
;;
beryl)
OPT1=--sm-client-id
OPT2=$SMID
;;
#FIXME: add all other windowmanagers here with their proper options
esac
fi

case `basename $WINDOW_MANAGER` in
compiz)
# export LIBGL_ALWAYS_INDIRECT=1
# gtk-window-decorator &
# OPT3=glib
# OPT4=gconf
OPT3=ccp

;;
beryl)
emerald &
;;
esac

exec $WINDOW_MANAGER $OPT1 $OPT2 $OPT3 $OPT4

echo "ERROR: No window manager could run!"


PS1: The draw back is that everytime gdm(I think it is gdm) package get updated, one have to re-do the above modification.
PS2: To make it work also do the following:
(1) In Compiz config manger -> Preference -> Backend, select Flat-file Configuration Backend
(2) In Compiz config manger -> Effects -> Window Decoration -> Command, put emerald --replace

Logout, login and enjoy :wink:
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum