macの「ディスクがほとんど一杯です」通知は消しても数分するとまた表示されて本当に邪魔です。こっちは少ない容量を一生懸命やりくりしているんだと突っ込みたくなります。通知を消す方法をグーグル先生に聞いても、ディスクの整頓術ばっかりで肝心の通知を切る方法がありません。
英語で調べたら数年の悩みが一瞬で片付いたので共有します。
環境
- mac Mojave
通知を消す方法
$ launchctl unload -w /System/Library/LaunchAgents/com.apple.diskspaced.plist
ターミナル上でこれ打つだけです。こんなことに悩まされていたとは、、、
デフォルトだと20GBより容量が少なくなったときに通知が出るみたいで、その数を変えることもできます。
$ defaults write com.apple.diskspaced minFreeSpace 1
自分はこっちの方法で1GBにしました。再起動すれば反映されます。
追記
The minFreeSpace option and many others appear to have been removed recently, for no reason.
MojaveだとminFreeSpaceというオプションが使えなくなったようでした。
通知を表示させなくする方も試したのですが、これも上で言及されているエラーが出てしまいました。
$ launchctl unload -w /System/Library/LaunchAgents/com.apple.diskspaced.plist /System/Library/LaunchAgents/com.apple.diskspaced.plist: Operation not permitted while System Integrity Protection is engaged
他のサイトの方法でも通知消えず。
$ defaults write com.apple.diskspaced removeAllNotifications -bool true $ killall diskspaced
$ defaults write com.apple.diskspaced freeSpaceWarningLevel 1 $ defaults write com.apple.diskspaced warningInterval 36000000 $ launchctl stop com.apple.diskspaced && launchctl start com.apple.diskspaced # 設定した値がロードできてません $ grep -A6 debugLog <(strings $(find /System/Library/PrivateFrameworks -name diskspaced -print -quit)) debugLog (BOOL) - log additional debug information. Default: NO Commands: removeAllNotifications - Removes all scheduled and delivered user notificiations. removeAllNotifications com.apple.diskspaced _mbsetupuser Ignoring low disk notification during migration. -- debugLog systemUpdateDate com.apple.updatesettings Interval since system update :%f alloc init lowSpaceTimer
これらもMojaveのときに消えてしまったんでしょうか汗
$ grep com.apple.diskspaced /var/log/system.log Dec 16 15:32:08 dorapon-MBA com.apple.xpc.launchd[1] (com.apple.xpc.launchd.domain.user.501): Service "com.apple.xpc.launchd.unmanaged.diskspaced.2257" tried to register for endpoint "com.apple.diskspaced" already registered by owner: com.apple.diskspaced
ログにはすでに登録されている旨が書かれてますね。
只今模索中
追記2
検索しても皆さん解決策がなくて困ってるようですね汗。今後改善して、設定で消せるようになることを期待します。
参考
- Disable "Your disk is almost full" popup? - Apple Community
Silencing "Your disk is almost full" notification - Ask Different
- Mojave - Is there any way to hide/disable the "Disk space running low" notification? : applehelp
mojave - How to access a launch daemon's values/ system defaults value - Ask Different
[SOLVED] Silencing "Your disk is almost full" notification