-1

I am trying to find how in c ++ whitch add current application at Startup on linux programmaticaly from inside program code. Suppose we have the "Hello world" as a program that opens in Mint user session. When Hello World starts, must find if there is link in startup applications, and if is not to add link, so next time opening user his profile to see the "Hello world". Is it possible to do this without system scripts, only with c++ std library?

fluter
  • 13,238
  • 8
  • 62
  • 100
jim kaip
  • 1
  • 5

1 Answers1

2

The problem is not a C or C++ problem, rather you should consult the session manager's documentation of your distro, for example, if you are using gnome, you could create a startup file under $HOME/.config/autostart, and put the program path in the startup file.

There is a wiki listing how to manager autostart programs for many desktop environment:

https://wiki.archlinux.org/index.php/autostarting

fluter
  • 13,238
  • 8
  • 62
  • 100
  • Yes, but say that i use Ubuntu or Mint. Must be a way that inside c++ to add link at start-up folder, like we do with hand, and without be root. Program has the property to add start-up user folder. – jim kaip Dec 03 '16 at 16:01