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 it cairo.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.
if [ "$DESKTOP_SESSION" = "gnome-classic" ]; then
cairo-dock
fi
Then close the file. Right Click on it, Select Properties.
Then create another file in the same directory, i.e ~/.config/autostart
with name cairo
. (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
[Desktop Entry]
Type=Application
Exec=/home/<name of user>/.config/autostart/cairo.sh
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name[en]=Cairo
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:
if [ "$DESKTOP_SESSION" = "ubuntu" ]; then
cairo-dock
fi
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:
[Desktop Entry]
Type=Application
Exec=/home/<name of user>/.config/autostart/cairo2.sh
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name[en]=Cairo
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.