Auto-run a service on user log-in Ubuntu 20.04

cn flag

I want to restart the desktop manager service automatically every time the user logs into the PC. I don't need it just on startup, but more importantly on each log in after that, such as after hibernating or after locking the screen.

How I assume I will make it work is by running a script on every login that will automatically restart the desktop manager.

Any help is appreciated!

Sadaharu Wakisaka avatar
pl flag
Welcome to AskUbuntu, `~/.profile` would execute after login, hibernate / suspend see and
user535733 avatar
cn flag
I'm not sure what you mean by a "desktop manager service." And a login is very different from an unlock. We can provide better advice if your question is more clear, or if you describe your actual problem that had led you to this preferred solution.

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.