Skip to content

Instantly share code, notes, and snippets.

@hyuki

hyuki/ohirune.rb Secret

Created April 14, 2023 01:15
Show Gist options
  • Select an option

  • Save hyuki/8c623bd4916ac01ac19d50cfea1ca651 to your computer and use it in GitHub Desktop.

Select an option

Save hyuki/8c623bd4916ac01ac19d50cfea1ca651 to your computer and use it in GitHub Desktop.
ohirune.rb - 指定した時間後に起こすRubyスクリプト(Mac用)
#!/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")
@hyuki
Copy link
Copy Markdown
Author

hyuki commented Jun 25, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment