deragon / autopoweroff

Manage automatic poweroff and other actions (suspend / custom) when specific conditions are reunited.
GNU General Public License v2.0
52 stars 7 forks source link

[Feature Request] Detect X Session activity #11

Open mgutt opened 4 years ago

mgutt commented 4 years ago

I know it's on the to do list, but now you have an official user request, too ;)

I'm using autopoweroff for energy saving. I start a VM every hour on my remote Unraid server and let autopoweroff stop the VM after several minutes. Sadly it does not detect my remote activity through Google Chrome Remote Desktop and stops the VM after several minutes.

deragon commented 4 years ago

Thank you for your suggestion. Would you have any idea how one could detect activity through a Google Chrome Remote Desktop or if such a connection has been done? I have no clue. If you can express in Bash or in some other form a way to detect such a remote connection, I could implement it easily.

mgutt commented 4 years ago

Sorry, I'm not a linux dev. I'm not sure if I can help you.

Something I found interesting is, that I'm not able to open the autopowerof GUI while I'm connected through Chrome Remote Desktop (CRD). I click on the entry in the start menu, but it does nothing. If I'm connected locally through NoVNC it asks for my login and then opens the GUI.

Maybe monitoring specific process names could be solution!? This is htop inside of a CRD session: 2020-07-25 18_06_34

And this is htop directly logged into the machine (I opened a noVNC session through the browser while I was connected through CRD): 2020-07-25 18_05_47

Next time I'm connected through Teamviewer I can post htop results, too.

deragon commented 4 years ago

Mmm... I searched the web but found not quick solution. Google Chrome Remote Desktop uses a proprietary protocol and thus nobody on the web knows the inner works. I will leave you bug report open, but I must admit it will not be resolved quickly, I am afraid.

As for your GUI not starting, try starting it from the terminal by calling /usr/sbin/autopoweroff-gui. Probably some error message will show explaining the problem.

mgutt commented 4 years ago

As for your GUI not starting, try starting it from the terminal by calling /usr/sbin/autopoweroff-gui. Probably some error message will show explaining the problem.

This was returned while using the Terminal through CRD session: 2020-07-26 13_06_11

And this when I used root: 2020-07-26 13_06_59

EDIT: Hmm if I do the same while connected locally through NoVNC it returns the same errors. So its nothing specific to the CRD session.

deragon commented 4 years ago

Regarding the autopoweroff-gui problem, you say that the GUI works in any session if started from a terminal. It only fails to start on CRD and when clicking on the Autopoweroff icon. The icon does work when using VNC. I have no clue. It is bizarre and should work all the time.