9
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

macのターミナルから音量を調節する

Last updated at Posted at 2017-12-23

#ミュートにする

osascript -e 'set volume with output muted'

#音量を50にする

osascript -e "set volume 50/100*7"

#ログアウトするときにミュートにする
vimでスクリプトを作ります

vim muted.sh

muted.shに以下の構文を書きます

osascript -e 'set volume with output muted'

ログアウト時に実行されるようにします
/Users/name/muted.shのところは絶対パスで指定します。macの環境によって絶対パスは異なります。

sudo defaults write com.apple.loginwindow LogoutHook /Users/name/muted.sh

#muted.shのスクリプトがログアウト時に実行されないようにします

sudo defaults delete com.apple.loginwindow LoginHook

#参考
https://builder.japan.zdnet.com/os-admin/sp_snow-leopard-09/20423879/

9
6
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
9
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?