04-29-2020, 04:06 PM
(04-29-2020, 07:12 AM)owagott Wrote: For example, you can use this script and add the function time.
When starting the script, read time, from the last call and compare with the current time.
Code:#!/bin/bash
t1=$(date +%s)
echo $t1
t2=$(cat time.log)
echo $t2
delta=$(( ($t1-$t2) ))
echo $t1 > time.log
echo $delta
if [ $delta -lt 2 ]
then
echo "Button pressed twice"
double=1
fi
if the value $delta is small, you pressed the button twice.
like this you can extend the functions
Thank you for this proposal. I will look into it and see what I can do with it.
Best regards,