LoginSignup
8
9

More than 5 years have passed since last update.

ポモドーロタイマーのワンライナーで学ぶデスクトップ通知システム

Posted at

普段ポモドーロテクニックを使って作業をしていることが多いが,専用のツールとか使わずにコマンドラインからポモドーロタイマーを使いたいと思った.そこでデスクトップ通知システムを使ってワンライナーでタイマーを実装.

Mac OSX : terminal-notifier

alias pomodoro='i=-1;while :;do echo $((i+=1));if [ $i -ge 25 ];then;terminal-notifier -message "job finished";fi;sleep 60;done'

Linux : notify-send

alias pomodoro='i=1;while :;do echo $i;sleep 60;if [ $i -gt 25 ];then (notify-send job finished;sleep 1;killall notify-osd)&;fi;i=$(($i+1));done'

notify-sendはgnomeでは持続時間を10秒から変えられないというバグがあるので, (notify-send;sleep 1;killall notify-osd)& とすることで1秒(任意の秒数)で消せる.

このエイリアスを.bashrcに突っ込んで快適ポモドーロテクニック生活!

8
9
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
9