disableAudioBellForProfile function
Disable audio bell for a Terminal.app profile.
Implementation
Future<bool> disableAudioBellForProfile(String profileName) async {
var result = await Process.run('/usr/libexec/PlistBuddy', [
'-c',
"Add :'Window Settings':'$profileName':Bell bool false",
getTerminalPlistPath(),
]);
if (result.exitCode != 0) {
result = await Process.run('/usr/libexec/PlistBuddy', [
'-c',
"Set :'Window Settings':'$profileName':Bell false",
getTerminalPlistPath(),
]);
if (result.exitCode != 0) return false;
}
return true;
}