I've generated a debian package that contains some libraries and an executable (GUI application). I would like that the executable start automatically in the context of the user session who launch the debian package at the end of the installation process.
I want my application to run permanently in the background (it implements an app indicator and provides user notifications). I have succeeded to start it automatically on login by installing a .desktop script in /etc/xdg/autostart/ directory.
However, after a long time of searching, I still haven't found a solution to start my application automatically after installing it. I've tried a lot of things in postinstall script like running sudo -u $SUDO_USER <executable name>
, but since the postinstall script runs in the context of root, all the user context is lost and the GUI app fails to start on the user active session.