With the current implementation, the only way the lock screen appears:
Manual input
Idle timers
There is no option to have it check for coming out of suspend/hibernate in general. Is this possible?
A C++ plugin can handle lid behavior. Then qml can pick this up.
Create plugin to listen to logind/elogind for lid behavior (closing or not).
Integrate into QML settings.
Add a settingswindow toggle to switch on or off lidwatch.
Have the default detect laptop battery or no battery to determine default behavior.
Test lidswitch enabled and disabled.
Must lock session before suspend occurs.
lidswitch disabled does not inhibit lock.
With the current implementation, the only way the lock screen appears:
- Manual input
- Idle timers
There is no option to have it check for coming out of suspend/hibernate in general. Is this possible?
A C++ plugin can handle lid behavior. Then qml can pick this up.
- [x] Create plugin to listen to logind/elogind for lid behavior (closing or not).
- [x] Integrate into QML settings.
- [x] Add a settingswindow toggle to switch on or off lidwatch.
- [x] Have the default detect laptop battery or no battery to determine default behavior.
- [x] Test lidswitch enabled and disabled.
- Must lock session before suspend occurs.
- lidswitch disabled does not inhibit lock.
zach
was assigned by AramJonghu2026-05-26 12:13:48 +02:00
AramJonghu
added this to the Zshell board project 2026-05-26 12:13:48 +02:00
I honestly don't know if that's possible directly from QML. If you can find a way then I'll gladly implement it, but the reason we have the lock() IPC call is so that you can lock it whenever you want it to lock, meaning you can set up whatever your equivalent of a systemd service with a trigger is to call the lock method.
I honestly don't know if that's possible directly from QML. If you can find a way then I'll gladly implement it, but the reason we have the `lock()` IPC call is so that you can lock it whenever you want it to lock, meaning you can set up whatever your equivalent of a systemd service with a trigger is to call the lock method.
Write a script on my system(s) to call lock when out of suspend/hibernate.
Write it myself into this project. This could be used for systemd, elogind (so no systemd), or anything else.
I like to write it myself if that is ok. It was suggested to write cpp, but my preference would be zig. I'd write a package like zshell-elogind-lock/ or similar. Would you be okay with zig in the project? In the end, it would be a binary that we'd end up using. What is your preference?
Edit: Python is another option indeed in our current codebase.
I did some digging. I have two main options.
- Write a script on my system(s) to call lock when out of suspend/hibernate.
- Write it myself into this project. This could be used for systemd, elogind (so no systemd), or anything else.
I like to write it myself if that is ok. It was suggested to write `cpp`, but my preference would be `zig`. I'd write a package like `zshell-elogind-lock/` or similar. Would you be okay with zig in the project? In the end, it would be a binary that we'd end up using. What is your preference?
Edit: Python is another option indeed in our current codebase.
WARN scene: @Daemons/LidService.qml[12:-1]: TypeError: Cannot read property 'lock' of undefined
WARN scene: @Daemons/LidService.qml[12:-1]: TypeError: Cannot read property 'lock' of undefined
@zach if you can assist.
Current issue I am facing is:
```
WARN scene: @Daemons/LidService.qml[12:-1]: TypeError: Cannot read property 'lock' of undefined
WARN scene: @Daemons/LidService.qml[12:-1]: TypeError: Cannot read property 'lock' of undefined
```
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
With the current implementation, the only way the lock screen appears:
There is no option to have it check for coming out of suspend/hibernate in general. Is this possible?
A C++ plugin can handle lid behavior. Then qml can pick this up.
I honestly don't know if that's possible directly from QML. If you can find a way then I'll gladly implement it, but the reason we have the
lock()IPC call is so that you can lock it whenever you want it to lock, meaning you can set up whatever your equivalent of a systemd service with a trigger is to call the lock method.I did some digging. I have two main options.
I like to write it myself if that is ok. It was suggested to write
cpp, but my preference would bezig. I'd write a package likezshell-elogind-lock/or similar. Would you be okay with zig in the project? In the end, it would be a binary that we'd end up using. What is your preference?Edit: Python is another option indeed in our current codebase.
In the end, it will be a
cppplugin which can be enabled or disabled. I will update the original issue to show criteria.lid-switch-behaviorto lid-switch-behavior@zach if you can assist.
Current issue I am facing is: