Detect enter/exit session under KDE/Gnome with FreePascal
-
05-07-2019 - |
Question
I'm asking this question after I got a very good answer to: How do I detect the 2 states of “Switch User” in Windows
My intention is to find out if the Switch User under KDE/Gnome has a similar API call I can monitor with FreePascal.
If not with FreePascal, at least the respective lib entry used in C/C++
Solution
Yes, a dbus package is installed, and afaik I ran the examples end of last year.
See /packages/dbus/examples/busexample.pp for an example
OTHER TIPS
I'm pretty sure that monitoring DBUS messages you can catch messages about session enter and exit. Actually i don't know if FreePascal provide DBUS apis.
A dirty solution can be execution and parse /usr/bin/dbus-monitor output.
Good luck
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow