Monday, April 29, 2024
 Popular · Latest · Hot · Upcoming
6
rated 0 times [  6] [ 0]  / answers: 1 / hits: 2540  / 3 Years ago, sun, october 31, 2021, 1:34:29

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?


More From » 12.04

 Answers
1

  1. 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 → .configautostart directory.


    • Right Click on the empty space in nautilus. Select Create new documentEmpty 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.


    • On the Properties windows, in Permissions tab, Check Allow executing file as a program.


  2. 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.


  3. Then rename the file adding extension .desktop. To rename, Select the file and Press F2.


  4. 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.


  5. 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.


[#35680] Monday, November 1, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ateact

Total Points: 176
Total Questions: 130
Total Answers: 122

Location: Egypt
Member since Sun, Apr 23, 2023
1 Year ago
;