Compare commits

..

6 Commits

Author SHA1 Message Date
f21d019f50 Merge branch 'release-1.2' 2022-07-30 17:32:15 +02:00
5201a35272 Update description and install instructions 2022-07-30 17:32:00 +02:00
6d54498b39 Reimplement script to temp change the timeout when locked
Script now changes the screen timeout when the screen is locked and restores the values after unlocking from the config-file.
2022-07-30 17:25:43 +02:00
71a3749079 Merge branch 'release-1.1' 2022-07-30 17:22:40 +02:00
a8cc54391c Add check if screen is still locked after timeout 2022-07-30 17:21:46 +02:00
661176befb Merge branch 'release-1.0' 2022-07-30 17:20:30 +02:00
2 changed files with 34 additions and 6 deletions

View File

@ -32,7 +32,11 @@ This script aims to fix this.
Adding a script to `notifyrc` as event makes it possible to change settings when screen-locking begins.
So after x seconds the screen will simply be forcefully turned off using `xset`.
When the screen is locked, the script will change the screen-timeout to a custom-value in the config `~/.config/powermanagementprofilesrc` (or a default of 10s).
This is done, so even after the System wakes up and activates the screens e.g. when mouse is moved, but no unlock is done, the screen begins to sleep quickly again.
After a successful unlock, the value from the config is reapplied.
<br>
@ -40,4 +44,10 @@ So after x seconds the screen will simply be forcefully turned off using `xset`.
Place the file `event_screensaver` to a bin-location, for a local user this is typically `~/.local/bin/` and make it executeable.
In Settings under `Notifications > Applications > Configure > 'Screen Saver' > Configure Events...` for event `Screen locked`, enable `Run command` and add your script-location for `event_screensaver`.
In Settings under `Notifications > Applications > Configure > 'Screen Saver' > Configure Events...` for event locked & unlocked, enable `Run command` and add your script-location for `event_screensaver` and the event triggered.
Example:
```
Screen locked
Run Command: ~/.local/bin/event_screenSaver locked
```

View File

@ -1,7 +1,25 @@
#!/bin/sh
SCREENSAVER_TIMEOUT_DEFAULT=10
NORMAL_TIMEOUT_DEFAULT=1800
# Sleep to timeout
sleep 15
case "$1" in
"locked")
# Read timeout from KDE
SCREENSAVER_TIMEOUT=$(kreadconfig5 --file powermanagementprofilesrc --group AC --group DPMSControl --key idleTime_screenSaver)
TIMEOUT="${NORMAL_TIMEOUT:-$SCREENSAVER_TIMEOUT_DEFAULT}"
;;
# Disable screens
xset dpms force off
"unlocked")
# Read timeout from KDE
NORMAL_TIMEOUT=$(kreadconfig5 --file powermanagementprofilesrc --group AC --group DPMSControl --key idleTime)
TIMEOUT="${NORMAL_TIMEOUT:-$NORMAL_TIMEOUT_DEFAULT}"
;;
*)
echo "$0 <locked|unlocked>"
exit 1
;;
esac
# Set timeout-value
xset s ${TIMEOUT} ${TIMEOUT}