Is it possible to have sleep settings apply only after a certain time?


  1. Posts : 740
    Windows 10 x64 Pro
       #1

    Is it possible to have sleep settings apply only after a certain time?


    So i've had a few stabs at getting my pc to sleep automatically in a fashion that suits me. During the day I want it on perpetually. I want it to sleep only after ive hit the sack. I accomplished this with a scheduled task. Then my wife threw a wrench in the whole thing.

    She stays up quite a bit later than I do. Every so often she wants to watch plex. I had hoped plex streaming would signify that the pc is not idle and wouldnt shut it down. Seems thats not the case. Idle as defined by the scheduled task system is either no keyboard inputs or cpu usage >50% or some such. Plex streaming checked neither box and it cut her off mid movie.

    Normally i'd just use the conventional windows sleep system as plex certainly flags a powercfg request and will keep it awake. Unfortunately if i set a 2 hour window, that would certainly trip, sometimes multiple times a day as on busy days im often away for a stretch. I dont want it to cut-off instances where I may be seeding, or need to access something remotely etc.

    So im here to inquire if anyone knows of a way I can have my cake and eat it too in this scenario :P
      My Computer


  2. Posts : 42,992
    Win 10 Pro (22H2) (2nd PC is 22H2)
       #2

    Hi, if 'plex' means launching something - a program e.g. then consider creating a small Autohotkey script which would do something like this:

    a. Launch/initiate Plex
    b. Launch Dont Sleep (a freeware utility that - amongst other things- prevents the PC sleeping - there are other such utilities).
    Dont Sleep has some command line options which might be useful here.
    c. Loop until Plex is terminated
    (It's easy to test for existence of a process with Autohotkey)
    d. Close Dont Sleep
    e. Exit script.

    Then create a shortcut to the script with a suitable icon and name, place it in the start menu etc.

    Some utilities:
    8 Tools to Prevent Windows From Sleeping or Turning Off the Display • Raymond.CC
      My Computers


  3. Posts : 740
    Windows 10 x64 Pro
    Thread Starter
       #3

    Unfortunately it does not. Plex is always running in the background as a server process and just streams from a local hard drive to my tv on the client when called for to do so.

    Although ahk is the direction I was looking. Hoping I didnt need it, i hate needing scripts for everything but I guess this sort of thing is kind of fringe.

    I'll have to see how I can check for a stream and even perhaps send keypresses or something while its active. I dont know if streaming creates another sub process or something I can track. If not, im sure network activity in some way.
      My Computer


  4. Posts : 42,992
    Win 10 Pro (22H2) (2nd PC is 22H2)
       #4

    Thank you for your reply.


    Presumably something is initiated:
    Every so often she wants to watch plex.
    even perhaps send keypresses or something while its active.
    No need- use Dont sleep.

    The easy option- your wife simply starts Dont sleep and terminates it when finished.
      My Computers


  5. Posts : 740
    Windows 10 x64 Pro
    Thread Starter
       #5

    dalchina said:
    Thank you for your reply.


    Presumably something is initiated:



    No need- use Dont sleep.

    The easy option- your wife simply starts Dont sleep and terminates it when finished.
    not familiar with the program, will have to look it up rq. Either way it sounds like that would require her having access to my pc which she does not. Between biometrics, pins, and managed random passwords lol.. shes a layman and thats being generous :P

    still like you said, scripting it into launching closing upon whatever process plex triggers when streaming over the network ought to automate it to an acceptable degree.

    Thanks for suggesting an option. gonna google it now :)
      My Computer


  6. Posts : 42,992
    Win 10 Pro (22H2) (2nd PC is 22H2)
       #6

    Shown via URL I posted above with download link.. I sometimes use it.
      My Computers


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 02:20.
Find Us




Windows 10 Forums