0

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!

KeepLearning
  • 349
  • 2
  • 3
  • 10

1 Answers1

0

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

FrodeTennebo
  • 531
  • 3
  • 13
  • 1
    Thanks! I actually found a "proper" solution - use `loginctl kill-session ...`. It can obviously be called from my python script too. – KeepLearning May 15 '19 at 10:50