Help us understand the problem. What is going on with this article?

bashでポモドーロタイマー作ったった

More than 5 years have passed since last update.

背景

なが~い処理を流しててちょっとスキマ時間があったので作ってみた。
tmuxで時間とhtopをいつも画面下に出すようにしているんですが
もう2つ枠が余ってて、なにか入れたいなーと。

準備

macのbannerコマンドだと微妙だったので
figletをHomebrewからインストールしておく

$ brew install figlet

pomodoro.sh

pomodoro.sh
#!/bin/bash

clear
i=25
figlet ready?
read Wait
clear
figlet $((i))

while :
do
  sleep 1
  clear
  figlet $((i-=1))
  if [ $i -eq 0 ]
  then
    terminal-notifier -message "job finished"
    echo -n "Pomodoro[P],Short break[S], Long break[L]?> "
    read WAIT
    case "${WAIT:0:1}" in
      P | p )
        i=25
        ;;
      S | s)
        i=5
        ;;
      L | l)
        i=15
        ;;
      *)
        echo "Didn't match anything"
        echo "Pomodoro Start!"
        i=25
    esac
    clear
    figlet $((i))
  fi
done

こんなかんじです。
(添付のgifは1/60秒でお送りいたします)

pomo.gif

(ポップアップがうまくgifに入っていないけど)

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした