In Win10 settings "Power & sleep" you can define Sleep (PC goes to sleep after x minutes or hours). The sleep is triggered if there is no user interaction for the specified time. Is there some variable or something that contains the countdown towards sleep? I want to make a countdown timer display that shows how many seconds there is time left until sleep starts if there's not user interaction. And I want to create a warning that triggers if I have 5 minutes until sleep etc.

I know AutoHotkey has a variable %A_TimeIdlePhysical%, which is pretty close, but I suspect another, more proper timer might exist. Because this AutoHotkey's timer is about idle, not exactly about a countdown torwards sleep.

I know powercfg /query shows "Current AC Power Setting Index", which is the specified sleep after time in hex (but I want the actual timer which isn't just guessing the "time left" but is the actual variable for "time left" until sleep).