Use unit instead of nanoseconds

This commit is contained in:
Willow Barraco
2023-02-24 19:21:21 +01:00
parent 75c34e3f10
commit 7af66e1ea8
7 changed files with 8 additions and 8 deletions

View File

@@ -6,6 +6,6 @@
# shellcheck source=scripts/core/sxmo_common.sh
. sxmo_common.sh
sxmo_wakelock.sh lock stay_awake "${SXMO_UNLOCK_IDLE_TIME:-120}000000000"
sxmo_wakelock.sh lock stay_awake "${SXMO_UNLOCK_IDLE_TIME:-120}s"
# Add here whatever you want to do

View File

@@ -11,7 +11,7 @@
sxmo_log "transitioning to stage unlock"
printf unlock > "$SXMO_STATE"
sxmo_wakelock.sh lock stay_awake "${SXMO_UNLOCK_IDLE_TIME:-120}000000000"
sxmo_wakelock.sh lock stay_awake "${SXMO_UNLOCK_IDLE_TIME:-120}s"
sxmo_hook_statusbar.sh state_change &
@@ -25,6 +25,6 @@ sxmo_daemons.sh start periodic_state_mutex_check sxmo_run_periodically.sh 10 sxm
# suspend after if no activity after 120s
sxmo_daemons.sh start idle_locker sxmo_idle.sh -w \
timeout "1" '' \
resume "sxmo_wakelock.sh lock stay_awake \"${SXMO_UNLOCK_IDLE_TIME:-120}000000000\""
resume "sxmo_wakelock.sh lock stay_awake \"${SXMO_UNLOCK_IDLE_TIME:-120}s\""
wait

View File

@@ -17,7 +17,7 @@ cleanup_main_mutex() {
exec 3<> "${XDG_RUNTIME_DIR:-$HOME}/sxmo.checkstatemutexes.lock"
flock -x 3
DEFAULT_DURATION=30000000000 # 30s to be sure to not lock indefinitely
DEFAULT_DURATION=30s # to be sure to not lock indefinitely
sxmo_wakelock.sh lock checking_mutexes "$DEFAULT_DURATION"
trap 'cleanup_main_mutex' TERM INT EXIT

View File

@@ -9,7 +9,7 @@
MMCLI="$(mmcli -m any -J 2>/dev/null)"
if [ -z "$MMCLI" ]; then
sxmo_notify_user.sh --urgency=critical "Modem crashed! 30s recovery."
sxmo_wakelock.sh lock modem_crashed 30000000000
sxmo_wakelock.sh lock modem_crashed 30s
fi
# see the comments in sxmo_hook_lock.sh

View File

@@ -80,7 +80,7 @@ blink_leds() {
eval "old_$color=$percent" # store old value
done
sxmo_wakelock.sh lock playing_with_leds 2000000000
sxmo_wakelock.sh lock playing_with_leds 2s
trap 'finish_blinking' TERM INT EXIT
while [ -n "$1" ]; do

View File

@@ -286,6 +286,6 @@ processmms() {
fi
}
sxmo_wakelock.sh lock mms_processing 30000000000
sxmo_wakelock.sh lock mms_processing 30s
"$@"
sxmo_wakelock.sh unlock mms_processing

View File

@@ -264,6 +264,6 @@ checkfornewtexts() {
done
}
sxmo_wakelock.sh lock modem_used 30000000000
sxmo_wakelock.sh lock modem_used 30s
"$@"
sxmo_wakelock.sh unlock modem_used