I want to make Cairo dock(with opengl) execute in the start-up only on Gnome-Classic but not on other DEs like cinnamon, unity or gnome.How to do that?
I want to make Cairo dock(with opengl) execute in the start-up only on Gnome-Classic but not on other DEs like cinnamon, unity or gnome.How to do that?
First create a script which will run
cairo-dock
based on$DESKTOP-SESSION
environment variable. We are going to create the script in~/.config/autostart
directory and naming itcairo.sh
Press Ctrl+H to let nautilus show hidden file. Then Go to your home directory →
.config
→autostart
directory.Right Click on the empty space in nautilus. Select Create new document → Empty Document. Name this file
cairo.sh
.Double click on the newly created file to open it in gedit text editor (or any other editors of your choice) and paste these lines in it.
Then close the file. Right Click on it, Select Properties.
Then create another file in the same directory, i.e
~/.config/autostart
with namecairo
. (Don't first name it with.desktop
extensions for avoiding later hussle opening it)In that file, copy these lines and paste there, changing the appropriate information like inputting the name of the user in place of "name of user". It is an .desktop file which will be called on startup
Save the file and exit gedit.
Then rename the file adding extension
.desktop
. To rename, Select the file and Press F2.After renaming it, Again make the file executable. To do so, Select the file → Select Properties. And in the new window, in Permissions tab, select the checkbox saying Allow the file to run as a program.
Logout and Login to gnome-classic session. Cairo-dock will be started automatically.
If you want to run Cairo on another desktop environment as well, such as ubuntu, you just need to repeat this process, making another set of commands just for that desktop session. First you would make another cairo.sh, naming it slightly different, such as cairo2.sh. Then you would open it with nautilus and copy the following lines:
Then you would save the file and make it executable as before.
Next, you would once again create a .desktop command, also naming it slightly different, such as cairo2. When copying the command lines, copy the following:
Don't forget to input the user name in place of "name of user" and to make sure the name of the file on the Exec= line is the same as your .sh command for ubuntu, in this case cairo2.sh.
After this just follow the steps as before and when you log in to the appropriate desktop environment, cairo dock should open atuomatically.
Have a look at the files in
/usr/share/xsessions/
.There you'll find
ubuntu.desktop
,ubuntu-2d.desktop
(if you're not on 12.10 already) andgnome-fallback.desktop
(maybe alsognome-classic.desktop
. I have gnome-shell installed maybe that's where this is from).Open one of those and you'll see they all have an
Exec=gnome-session --session=...
line. For gnome-fallback open/usr/share/gnome-session/sessions/gnome-fallback.session
.Now you can
change in
/usr/share/gnome-session/sessions/gnome-fallback.session
the lineRequiredComponents=gnome-panel;gnome-settings-daemon;
to
RequiredComponents=gnome-panel;gnome-settings-daemon;cairo-dock;
(check the executable name!)change in
/usr/share/xsessions/gnome-fallback.desktop
theExec=
line, for exampleExec=/home/<yourname>/<yourexecbashscript>
or also copy your current autostart folder
.config/autostart/
to a new placeExec=gnome-session --session=gnome-fallback -a <Newplaceofautostartfolder>
create a all new session. copy and rename both
gnome-fallback.session
andgnome-fallback.session
to their new to their respective places under a new name and adjust your new session like in 1.The first two of those work but have the disadvantage that they may or may not be overwritten on update (you will have to check, I'm not sure).
In 2. Also if you copy your autostart folder only one of those will be updated depending on which session you are logged into.
So I recommend doing it as shown in 3. Have fun.