From f505d3bed11be3aeb4512f36545c85d2f1e859fc Mon Sep 17 00:00:00 2001 From: Bruno Fontes Date: Thu, 13 Dec 2018 11:03:44 -0200 Subject: [PATCH] Adding script to wait for some minutes and suspend system --- waitAndSleep.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 waitAndSleep.sh diff --git a/waitAndSleep.sh b/waitAndSleep.sh new file mode 100755 index 0000000..71abdba --- /dev/null +++ b/waitAndSleep.sh @@ -0,0 +1,15 @@ +if [ -z $1 ]; then + echo "Define how many minutes to wait before sleep" + echo + echo "Example: to wait 5 minutes before system suspend, run the following code:" + echo "waitAndSleep.sh 5" + echo + exit +fi + +echo "Type your password: " +read -s sudoPass +echo +minutes=$(($1 * 60)) +echo "System will sleep in $minutes minutes" +sleep "$minutes" && echo -e "$sudoPass\n" | sudo -S systemctl suspend