From 9fd5c8af53a86553521b857929a8a3b61b09b517 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20T=C3=B3th?= Date: Tue, 18 Aug 2020 11:39:15 +0200 Subject: [PATCH] Add README --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..0cbfc3a --- /dev/null +++ b/README.md @@ -0,0 +1,12 @@ +## What? +KDE Plasma (as of 5.19.4) lacks the funcionality of hybernating your display after locking your computer. + +This hack implements Gnome-like lockscreen behaviour: it hybernates your display after a given timeout if the computer is locked. It also makes sure that the display won't turn off while you are typing your password to unlock your machine. + +## How? +This whole started as a simple bash script (`proof-of-concept.sh`) using `qdbus` and `xset` to implement this functionality. +However, it had an annoying defect: the screen would hybernate after the timeout no matter what (i.e. the display could turn off while you were typing your password to unlock the machine). +To remedy this defect I've decided to monitor keypresses via `/dev/input` and rewrite the whole thing in golang to provide proper debouncing (i.e. the timeout resets if you start typing). + +Beware this is a quick&dirty hack. Instead of calling `qdbus` and `xset` from golang, the proper dbus API should be used. +Instead of registering a go binary to execute once the lockscreen is active (`System Settings -> Notifications -> Application Settings -> Screen Saver`) the whole thing should probably be rewritten in C++ and contributed to KDE instead.