Trigger Ubuntu session logout from my own script

290 Views Asked by At

I want to write a Python script to run in Ubuntu session that can under certain conditions logout the user - think screen time management for kids :)

Can someone give me a pointer where to look, how is logout done in modern Linux desktops? I suspect it may have something to do with dbus but can't find any concrete way to do it. A pointer will be enough, I can figure out the rest :)

Thanks!

1

There are 1 best solutions below

1
FrodeTennebo On

You should be able to adapt this solution to something workable for you.