GithubHelp home page GithubHelp logo

Comments (5)

MoshiMoshi0 avatar MoshiMoshi0 commented on July 26, 2024

This is a good idea. Unfortunately I tried to implement this but I cant find a way to detect user idle time/screensaver from a service.
Unless someone knows a way to do this I think the only way is to write a small app that runs in user space and sends that info to the service via IPC. The IPC trigger would be implemented with #46

from ttcontroller.

Echaleon avatar Echaleon commented on July 26, 2024

Yeah. From my quick googling it seems services are barred form interacting with login sessions, and detecting idle state of the user falls under that umbrella. I found a couple things having the same issue, perhaps there's some insight there?

https://social.msdn.microsoft.com/Forums/vstudio/en-US/4cdb1251-da4b-4693-a58f-841c64c8f8bc/screen-saver-notifications?forum=netfxbcl

https://stackoverflow.com/questions/248186/service-needs-to-detect-if-workstation-is-locked-and-screen-saver-is-active

https://www.codeproject.com/Articles/13384/Getting-the-user-idle-time-with-C

https://stackoverflow.com/a/59400162

Don't know if any of these are helpful or not, cause, at best, it seems it'd have to be done as a workaround basically.

A small program over IPC would work easy enough maybe. Could double as a small GUI for turning off the service, restarting, etc. perhaps. The other suggestion I saw googling was to change the program to run as a background task in task scheduler, but I'm not sure it's as easy to translate a service like that, or what sorts of issues you run into doing it that way. My experience writing C# or windows services is nil.

from ttcontroller.

MoshiMoshi0 avatar MoshiMoshi0 commented on July 26, 2024

Unfortunately I tried many things but I think there is no way to get user idle time, or even if the screensaver is running.
Like I said this would be doable with the IPC trigger.

PR is welcome if anyone manages to do this.

from ttcontroller.

MoshiMoshi0 avatar MoshiMoshi0 commented on July 26, 2024

Just to update, I merged IPC feature in this build. It should allow you to write a small app that checks for screensaver/display off events in user space and send it to the service using websockets. Should be documented on next release, for now you can check the code to figure out how to enable it and what data to send.

from ttcontroller.

Echaleon avatar Echaleon commented on July 26, 2024

So I know it has been while, but I ran across this project, and am actually using it to control my LG TV. From a Windows service, it;s able to detect idle state, and when the displays are turned off, though I am not sure how. I could dig into it further and figure out exactly how, though I am not much of a Windows programmer.

https://github.com/JPersson77/LGTVCompanion

Food for thought perhaps?

from ttcontroller.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.