device-nokia-n900: lock.sh: query touchscreen instead of display (MR 5930)
lock.sh is only reliable when used with i3wm, where we disable gpio_keys from being handled by X/i3wm. When this is not done (e.g. when testing a different X11 UI), the script becomes unreliable since the display turns on due to the SCREENLOCK key being toggled, and therefore only the display=on case is ever run. Improve reliability of the script by basing the decision making on the enabled/disabled state of the touchscreen instead.
This commit is contained in:
parent
ccb0e43a6f
commit
86fb190a34
2 changed files with 6 additions and 9 deletions
|
|
@ -2,7 +2,7 @@
|
|||
# Maintainer: Sicelo <absicsz@gmail.com>
|
||||
# Co-Maintainer: Danct12 <danct12@disroot.org>
|
||||
pkgname=device-nokia-n900
|
||||
pkgver=35
|
||||
pkgver=36
|
||||
pkgrel=0
|
||||
pkgdesc="Nokia N900"
|
||||
url="https://postmarketos.org"
|
||||
|
|
@ -232,7 +232,7 @@ dc585e11bf4e06e36c5c62bcc024eaacecc30437d9da5257df14be05e247a2f2bc208874be3058ed
|
|||
082a5166e38296b097e873b0b4aeaf007e594d3bf4470c74e91ee3efedcf28ad25cd55c23dd63e460339898ae08e77e111b0e1092fa5e661db90bb40732103a1 rx51_it.map
|
||||
6e4e8b10a41d0957968736f5d780f14c7070b03913d80859cb07180e9cec9a36bbc9c639748765e48962772640974f5491627520cc36bd3d6c9d01748f9ddaff rx51_ptes.map
|
||||
e440ed7a3070c17e003b86b72dbe6d8194d01b577ca8dd56dd066f216b6dda32bb965c780950f1789a66f7c948290016b048da9f1cf63aba9e11d7e7fd6873ba rx51_us.map
|
||||
6cb3ad1253ceb682d5241e6661a4313cb88b16cbf855f45513b7320584cab062e6c6f472b4ba89ccf76c66493ea76dc3a7bed516b403e324a6fa5657621c7a09 lock.sh
|
||||
83374ba470dc6c34e11c62e91e90a96614d76ae7ce240dd830cb1b2f07f9a72c83e5b50e07e49885a72b9caf25fd586c4ea26452a73baf8bab1d2b4490a107ab lock.sh
|
||||
157b27feebcfddf800a1ffd8c6e369d2b58e5db25b1a44b4443dada8d9fe74abb91d036b9f0e97769bbafbdc72020b5637313682c6932fe7b0bddb9ebebbad42 modem-load.conf
|
||||
695feac7f69a0ec8c5e007cdb651adcc3492f1c6236e7fd183edec2a5e25cb957d3ace630ea5fdb87fd703e35ac368f1d097c2f881ecb52c9cfd433564db2a6c modem-opts.conf
|
||||
862ebc7cd2d7a1b3d41b10701b8418308c89eb0732eb99c42ec1091d48e08db9421727f67a3272b7309549798d59afb1b8d7d2fa48d1447b208fcb2329472d4d modules.blocklist
|
||||
|
|
|
|||
|
|
@ -1,16 +1,13 @@
|
|||
#!/bin/sh
|
||||
|
||||
display=off
|
||||
if xset q | grep -iq "monitor is on"; then
|
||||
display=on
|
||||
fi
|
||||
touch_state=$(xinput list-props "TSC2005 touchscreen" | grep "Device Enabled" | tr -d "\t" | cut -d ":" -f 2)
|
||||
|
||||
case "$display" in
|
||||
off)
|
||||
case "$touch_state" in
|
||||
0)
|
||||
xinput enable "TSC2005 touchscreen"
|
||||
xset dpms force on
|
||||
;;
|
||||
on)
|
||||
1)
|
||||
xinput disable "TSC2005 touchscreen"
|
||||
xset dpms force off
|
||||
;;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue