-
-
Save hyuki/8c623bd4916ac01ac19d50cfea1ca651 to your computer and use it in GitHub Desktop.
ohirune.rb - 指定した時間後に起こすRubyスクリプト(Mac用)
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
| #!/usr/bin/env ruby | |
| APPNAME = 'ohirune' | |
| if ARGV.size != 1 | |
| puts "#{APPNAME}: ohirune MIN" | |
| puts "#{APPNAME}: MIN分後に起こします。" | |
| exit | |
| end | |
| VOLUME = 50 # パーセント | |
| min = ARGV[0].to_i | |
| puts "#{APPNAME}: #{min}分後に起こします。" | |
| sleep min * 60 | |
| system("osascript -e 'set volume #{VOLUME}/100*7'") | |
| system("open -a Safari https://audio.hyuki.net/20230414095330-c732022ed94197ba-tomoko-ohirune-owari.mp3") | |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
◆ChatGPTによる解説
https://gist.github.com/hyuki/727d46dd227f9df0ba1263f53497274a