Last active
September 11, 2016 11:35
-
-
Save acro5piano/11f067d6002572581c5bbc82ca51de78 to your computer and use it in GitHub Desktop.
Bashにアラーム機能を搭載する(改) ref: http://qiita.com/acro5piano/items/12c829da344464134f37
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alarm(){ | |
echo "tmux detach-client; sleep 2; cowsay_to_single_pts $1" | at $2 | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for t in `w -s | grep -v tty | grep ':0' | grep $SHELL | awk '{print $2}' | sed s:^:/dev/:`; do | |
echo $1 | cowsay > $t | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# アラームをセット | |
alarm 'The meeting with my boss will start in 10 minutes' 9:50 | |
# => job 22 at Thu Jun 1 9:50:00 2016 | |
# アラーム一覧 | |
atq | |
# => 22 Thu Jun 1 9:50:00 2016 a k-gosho | |
# JobIDを指定してアラームを削除 | |
at -d 22 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment