Persist screen brightness, enable universal evdev key/lid wake, and add *+# screenshot combo
This commit is contained in:
1 parent
eef8584a8d
commit
2e2adcc7f2
38 files changed
+574
-161
No files matched your search
@@ -16,8 +16,9 @@ threshold="${SXMO_THRESHOLD:-0.15}"
|
||||
# all wake and unlock the phone, so execute immediately without waiting 300ms.
|
||||
STATE_FILE="${SXMO_STATE:-$XDG_RUNTIME_DIR/sxmo.state}"
|
||||
if [ -r "$STATE_FILE" ]; then
|
||||
read -r cur_state < "$STATE_FILE" 2>/dev/null || cur_state=""
|
||||
if [ "$cur_state" != "unlock" ]; then
|
||||
cur_state=""
|
||||
read -r cur_state < "$STATE_FILE" 2>/dev/null || true
|
||||
if [ -n "$cur_state" ] && [ "$cur_state" != "unlock" ]; then
|
||||
case "$identifier" in
|
||||
powerbutton|pickup)
|
||||
rm -f "$XDG_RUNTIME_DIR"/sxmo.multikey.count."$identifier"
|
||||
@@ -30,13 +31,14 @@ fi
|
||||
count_file="$XDG_RUNTIME_DIR"/sxmo.multikey.count."$identifier"
|
||||
|
||||
if [ -f "$count_file" ]; then
|
||||
read -r old_counter < "$count_file" 2>/dev/null || old_counter=0
|
||||
old_counter=0
|
||||
read -r old_counter < "$count_file" 2>/dev/null || true
|
||||
counter="$((old_counter+1))"
|
||||
else
|
||||
counter=1
|
||||
fi
|
||||
|
||||
printf %s "$counter" > "$count_file"
|
||||
printf '%s\n' "$counter" > "$count_file"
|
||||
|
||||
shift "$counter"
|
||||
if [ "$#" -eq 0 ]; then
|
||||
@@ -45,7 +47,8 @@ fi
|
||||
|
||||
sleep "$threshold"
|
||||
|
||||
read -r new_counter < "$count_file" 2>/dev/null || new_counter="$counter"
|
||||
new_counter="$counter"
|
||||
read -r new_counter < "$count_file" 2>/dev/null || true
|
||||
if [ "$counter" != "$new_counter" ] && [ "$#" -ne 1 ]; then # Only the last count can overflow
|
||||
exit
|
||||
fi
|
||||
|
||||
Reference in new issue
Block a user