device-nokia-n900: switch to more robust locking script (MR 4988)

This is an adaptation of craftguy's improved script [1]

[1] https://gitlab.com/postmarketOS/pmaports/-/tree/n900-screen-locker

Co-authored-by: Clayton Craft <clayton@craftyguy.net>
This commit is contained in:
Sicelo A. Mhlongo 2024-04-01 10:26:40 +02:00 committed by Stefan Hansson
parent d5ee14fc28
commit 4ac671b055
No known key found for this signature in database
GPG key ID: 8A700086A9FE41FD
2 changed files with 16 additions and 13 deletions

View file

@ -2,7 +2,7 @@
# Maintainer: Sicelo <absicsz@gmail.com>
# Co-Maintainer: Danct12 <danct12@disroot.org>
pkgname=device-nokia-n900
pkgver=15
pkgver=16
pkgrel=0
pkgdesc="Nokia N900"
url="https://postmarketos.org"
@ -208,7 +208,7 @@ dc585e11bf4e06e36c5c62bcc024eaacecc30437d9da5257df14be05e247a2f2bc208874be3058ed
082a5166e38296b097e873b0b4aeaf007e594d3bf4470c74e91ee3efedcf28ad25cd55c23dd63e460339898ae08e77e111b0e1092fa5e661db90bb40732103a1 rx51_it.map
6e4e8b10a41d0957968736f5d780f14c7070b03913d80859cb07180e9cec9a36bbc9c639748765e48962772640974f5491627520cc36bd3d6c9d01748f9ddaff rx51_ptes.map
e440ed7a3070c17e003b86b72dbe6d8194d01b577ca8dd56dd066f216b6dda32bb965c780950f1789a66f7c948290016b048da9f1cf63aba9e11d7e7fd6873ba rx51_us.map
caf9f4c45d11c28e1a6681255fafe5a286b0c417737fac1ca0ee37d3f82fd65c1712f5180375d7813fa308dfdca91d96876b5ce5b05b55ac14cfc31303b1ea5f lock.sh
6cb3ad1253ceb682d5241e6661a4313cb88b16cbf855f45513b7320584cab062e6c6f472b4ba89ccf76c66493ea76dc3a7bed516b403e324a6fa5657621c7a09 lock.sh
157b27feebcfddf800a1ffd8c6e369d2b58e5db25b1a44b4443dada8d9fe74abb91d036b9f0e97769bbafbdc72020b5637313682c6932fe7b0bddb9ebebbad42 modem-load.conf
695feac7f69a0ec8c5e007cdb651adcc3492f1c6236e7fd183edec2a5e25cb957d3ace630ea5fdb87fd703e35ac368f1d097c2f881ecb52c9cfd433564db2a6c modem-opts.conf
862ebc7cd2d7a1b3d41b10701b8418308c89eb0732eb99c42ec1091d48e08db9421727f67a3272b7309549798d59afb1b8d7d2fa48d1447b208fcb2329472d4d modules.blocklist

View file

@ -1,14 +1,17 @@
#!/bin/sh
FILE=~/.screenoff
if [ -f $FILE ]; then
xinput set-prop 8 "Device Enabled" 1
xset dpms force on
rm "$FILE"
else
xinput set-prop 8 "Device Enabled" 0
# Turn screen off twice (sometimes it does not work on first run)
xset dpms force off
xset dpms force off
touch "$FILE"
display=off
if xset q | grep -iq "monitor is on"; then
display=on
fi
case "$display" in
off)
xinput enable "TSC2005 touchscreen"
xset dpms force on
;;
on)
xinput disable "TSC2005 touchscreen"
xset dpms force off
;;
esac