1

I have Ubuntu16 and I have ui application which I want to start automatically once the user logs in. For this I have created a script which has below commands:

#!/bin/sh

cd /home/super/Documents/

./app

Running this script launches the UI application. Now I have added the application to launch automatically in startup applications in ubuntu. I have added below command

/bin/bash /home/super/Documents/start_app.sh

So at startup, it runs the above command which starts the script and then the UI application also starts normally. This all is working fine.

But I was wondering if there is any command available which when run can automatically add the script in the list of start up applications. I am actually preparing a script file setup.sh which will install and configure the whole application on clients machine. I will have to give this script to client so that he can run it and install the software, so I was wondering if there is any command available which can add the application in startup application, then I can also add those commands in setup.sh

Can any give some good suggestions. Thanks

EDIT:

desktop entry file:

[Desktop Entry]
Version=1.0
Name=OPC
Comment=OPC Client Application
Exec=/home/super/Documents/app
Icon=/home/super/Documents/img/ch_logo.jpeg
Path=/home/super/Documents
Terminal=false
Type=Application
Categories=Utility;Application;

1 Answer 1

1

One possibility is to install a desktop file so that it is automatically started. Create a file named app.desktop in /etc/xdg/autostart, containing

[Desktop Entry]
Version=1.0
Type=Application
Name=Your application
Path=/home/super/Documents
Exec=/home/super/Documents/app
6
  • Actually I already have desktop file but I didnt knew that if I put it in /etc/xdg/autostart, it will start the application automatically. I will try it and will update soon
    – S Andrew
    Commented Oct 13, 2020 at 5:13
  • I have placed my desktop file in the directory you mentioned but its not starting on boot. I have also updated the question with contents of desktop entry file. Can you please check. Is there any command we need to run in order to make it start on boot.
    – S Andrew
    Commented Oct 13, 2020 at 5:52
  • On boot, or when users log in? Commented Oct 13, 2020 at 5:53
  • Appologies for confusion, I meant to say after the user logs in.
    – S Andrew
    Commented Oct 13, 2020 at 6:04
  • Oh, did you get it to work? Commented Oct 13, 2020 at 13:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .