[xubuntu-users] How to get process to start with GUI login and exit on GUI logout?

Chris Green cl at isbd.net
Mon Jan 31 20:50:19 UTC 2022


On Mon, Jan 31, 2022 at 02:22:15PM -0600, Knute Johnson wrote:
> 
> 
> On 1/31/22 06:30, Chris Green wrote:
> > I have a background process that I want to start when I log into my
> > xfce session and I want it to exit when I log out of the session.
> > 
> > I thought that adding it to the list in the Session & Startup settings
> > would do this but the process doesn't exit when I log out from the
> > xfce session.  If I log out and then log back in to xfce I get
> > multiple copies of my process.
> > 
> > So, is there an easy/correct way to do this or do I need to add code
> > to my background process to manage things?
> > 
> 
> Use a .desktop file. See: https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html 
> 
> This is the simple way to start/stop a program when your desktop runs. You
> put the file in your ~/.config/autostart directory.  When you log in it runs
> and when you log out it stops.
> 
That's exactly how my background script is already run, and it doesn't
stop when I log out.


> Pretty good explanation here:
> https://wiki.archlinux.org/title/Desktop_entries
> 
Doesn't tell me how to stop the process on exit! :-)

-- 
Chris Green



More information about the xubuntu-users mailing list