Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

POSIX compliance #4

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions potato.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh

WORK=25
PAUSE=5
Expand Down Expand Up @@ -54,31 +54,33 @@ fi

while true
do
for ((i=$WORK; i>0; i--))
i=$WORK
while [ $i -gt 0 ]
do
printf "$time_left" $i "work"
sleep 1m
true $(( i=i-1 ))
done

! $MUTE && play_notification
if $INTERACTIVE; then
read -d '' -t 0.001
echo -e "\a"
echo "Work over"
printf "\a\nWork over\n"
read
fi

for ((i=$PAUSE; i>0; i--))

i=$PAUSE
while [ $i -gt 0 ]
do
printf "$time_left" $i "pause"
sleep 1m
true $(( i=i-1 ))
done

! $MUTE && play_notification
if $INTERACTIVE; then
read -d '' -t 0.001
echo -e "\a"
echo "Pause over"
printf "\a\nPause over\n"
read
fi
done