LoginSignup
20
10

More than 5 years have passed since last update.

ノー残業デーに蛍の光を流して帰ろうコールをする

Last updated at Posted at 2017-01-11

ノー残業デー導入しても、なかなか帰らない!そんな会社もあると思います。(うちじゃないです)
そこで、蛍の光を自動で流して帰ろうコール。
常時動いているMacがあったのでスピーカーをつなげてcronで下記シェルスクリプトを起動します。

afplayコマンドでmp3をバックグランドで再生、そこへsayコマンドをかぶせるだけといえはだけですが。

play.sh
#!/bin/bash

D=`dirname $0`
cd $D
afplay -v 0.5 -t 24 hotarunohikari.mp3 &
sleep 5
say -v kyoko -r 140 みなさん、本日、`date +"%Y年%m月%d日 %a曜日"`はノー残業デーです。仕事を終わらせて早く帰りましょう。早く帰らないと、しらないですよ?
sleep 4
afplay -v 1 -t 60 hotarunohikari_rock.mp3

水曜日の19時ならcronはこんな感じです。

cron
0 19 * * 3 /path/to/play.sh
20
10
1

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
20
10