-
Notifications
You must be signed in to change notification settings - Fork 3
/
focus_time_JBs.sh
executable file
·52 lines (45 loc) · 1.6 KB
/
focus_time_JBs.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash
#
# Autor= João Batista Ribeiro
# Bugs, Agradecimentos, Críticas "construtivas"
# me envie um e-mail. Ficarei Grato!
# e-mail: joao42lbatista@gmail.com
#
# Este programa é um software livre; você pode redistribui-lo e/ou
# modifica-lo dentro dos termos da Licença Pública Geral GNU como
# publicada pela Fundação do Software Livre (FSF); na versão 2 da
# Licença, ou (na sua opinião) qualquer versão.
#
# Este programa é distribuído na esperança que possa ser útil,
# mas SEM NENHUMA GARANTIA; sem uma garantia implícita de ADEQUAÇÃO a
# qualquer MERCADO ou APLICAÇÃO EM PARTICULAR.
#
# Veja a Licença Pública Geral GNU para mais detalhes.
# Você deve ter recebido uma cópia da Licença Pública Geral GNU
# junto com este programa, se não, escreva para a Fundação do Software
#
# Livre(FSF) Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# Script: Focus - warning you about a $timeToFocus in work and $timeToRest min of rest
# Tip: Pass the time to the Script (timeToFocus and timeToRest)
#
# Last update: 03/11/2022
#
timeToFocus=$1
timeToRest=$2
if echo "$timeToFocus" | grep -q -v "[[:digit:]]"; then
timeToFocus='60m'
fi
if echo "$timeToRest" | grep -q -v "[[:digit:]]"; then
timeToRest='10m'
fi
echo "Begin focus of $timeToFocus - $(date)"
echo "Begin focus of $timeToFocus $(echo; date)" > /dev/pts/0
echo "sleep $timeToFocus"
sleep "$timeToFocus"
echo "Break of $timeToRest - $(date)"
echo "Break of $timeToRest $(echo; date)" > /dev/pts/0
echo "sleep $timeToRest"
sleep "$timeToRest"
echo "Break End ... $(date)"
echo "Break End ... $(echo; date)" > /dev/pts/0