mirror of
https://github.com/brunofontes/linuxShortcuts.git
synced 2024-11-24 00:50:51 +00:00
Adding script to wait for some minutes and suspend system
This commit is contained in:
parent
5d37b4e886
commit
f505d3bed1
15
waitAndSleep.sh
Executable file
15
waitAndSleep.sh
Executable file
@ -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
|
Loading…
Reference in New Issue
Block a user