Keep Windows awake when dbus is inhibited from idle, sleep
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 45/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- cpp, linux
- Área
- operating-systems
Línea de trabajo
Start by tracing how /keep-awake currently uses the systemd integration and where it could observe changes to BlockInhibited. The issue proposes responding to idle, sleep, or shutdown inhibition with SetThreadExecutionState, then clearing the state when the property is empty; no files or tests are named. Done means Windows stays awake while the relevant inhibition is active and returns to normal afterward.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Is your feature request related to a problem? Please describe.
I use Copilot CLI in WSL2 and have /keep-awake enabled. That does call the org.freedesktop.login1.Manager.Inhibit API to inhibit idle detection. This does not, however, prevent my Windows machine from going idle and eventually to sleep.
Describe the solution you'd like
Monitor for property changed to BlockInhibited and SetThreadExecutionState accordingly e.g., probably when you see any of "idle", "sleep", or "shutdown"—which can be combined e.g., "sleep:idle"—call SetThreadExecutionState(ES_SYSTEM_REQUIRED | ES_CONTINUOUS). When the new property value is empty, SetThreadExecutionState(ES_CONTINUOUS) to clear it. As a service, you also have options to "discourage" shutting down when you see dbus signal "shutdown" through SCM messages.
Describe alternatives you've considered
I could use a systemd service to monitor events and write to stdout, listening to it from a WSL plugin. I could also use a number of executables including something like pipeferry or npiperelay to establish a pipe and listen to that from Windows. More moving parts, but no code signing requirement like WSL plugins either.
Additional context
See https://gist.github.com/heaths/b155cb7120b89a2a1c626f9d1cca2a0f (Rust) for how you can filter events to avoid getting flooded. This is a simple sync example but these I would expect would be infrequent enough to warrant proper signaling over overlapped IO.
systemd integration is enabled.
- Lenguaje dominante
- C++
- Estrellas
- 34.4k
- Forks
- 1.9k
- Merge medio
- 1 d 23 h
- PR fusionados (30 d)
- 166
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de microsoft/WSL
-
feature wsl2
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
microsoft/WSL#42306 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
feature
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
microsoft/WSL#42114 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
feature kernel wsl2
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
microsoft/WSL#41107 · 3 comentarios · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
feature kernel
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
microsoft/WSL#41054 · 9 comentarios · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
feature GPU
Dificultad 1/5 1-3 horas Aptitud para principiantes 70/100
microsoft/WSL#13592 · 4 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de microsoft/WSL
Issues similares
-
[内容勘误] STL常用模式章节实战演练中代码有问题Abiertodocumentation
Dificultad 1/5 Menos de una hora Aptitud para principiantes 86/100
Awesome-Embedded-Learning-Studio/Tutorial_AwesomeModernCPP#335 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
deepseek-ai/DeepEP#830 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
google-ai-edge/LiteRT-LM#4701 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
HarperFast/rocksdb-js#1131 ·
Los mantenedores suelen responder en 1 día
-
Swapped cache lookups in ScanModelAndDecideAllDiffExpansionPosiblemente ocupada @Lian292213 la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día