Skip to content

Instantly share code, notes, and snippets.

@0xbb
Last active October 6, 2024 19:54
Show Gist options
  • Save 0xbb/ae298e2798e1c06d0753 to your computer and use it in GitHub Desktop.
Save 0xbb/ae298e2798e1c06d0753 to your computer and use it in GitHub Desktop.
Turn off Macbook startup sound - Linux
#!/bin/bash
printf "\x07\x00\x00\x00\x00" > /sys/firmware/efi/efivars/SystemAudioVolume-7c436110-ab2a-4bbb-a880-fe41995c9f82
@Bios-Marcel
Copy link

Hey, this doesn't work, since not even root has the permission to change these :/

Could you lend your help here?

@jradmacher
Copy link

If someone else finds this Gist: You need to remove the immutable flag before writing.
chattr -i /sys/firmware/efi/efivars/SystemAudioVolume-7c436110-ab2a-4bbb-a880-fe41995c9f82

@OdinElfson
Copy link

I've been looking all over the web, all day, for a solution to this--> jradmacher you're a genius. Thank you thank you!

@ngeorger
Copy link

Genius, thank you!

@sharpsounds
Copy link

try just doing su before doing printf
its a pretty sensitive directory so it could be that your distro is being a bit extra cautious?

@daudix
Copy link

daudix commented Sep 10, 2022

If anyone needs :)

#!/usr/bin/bash

# Mute MacBook Chime

## Make "chime" value mutable

sudo chattr -i /sys/firmware/efi/efivars/SystemAudioVolume-7c436110-ab2a-4bbb-a880-fe41995c9f82

## Change "chime" value to "muted"

sudo printf "\x07\x00\x00\x00\x00" > /sys/firmware/efi/efivars/SystemAudioVolume-7c436110-ab2a-4bbb-a880-fe41995c9f82

## Make "chime" value immutable again

sudo chattr +i /sys/firmware/efi/efivars/SystemAudioVolume-7c436110-ab2a-4bbb-a880-fe41995c9f82

printf "\n🎉️🔇️ Now you don't have startup chime anymore!"

@daudix
Copy link

daudix commented Sep 10, 2022

Also, anyone knows is there a way to enable it back? (just want to know)

@glubsy
Copy link

glubsy commented Jan 29, 2023

Can't find that path while running Debian on a Mac Mini a1347. Perhaps because I'm not even using UEFI and only MBR boot with grub?

@zeddD1abl0
Copy link

I found that I had to specifically install efivar before the SystemAudioVolume variable was available. I also had to run @daudix-UFO 's script as root (via sudo su) as anything done as sudo didn't work.

@ADBeveridge
Copy link

@daudix-UFO to reenable it, just clear the nvram. Cmd + Options + P + R at the same time right on boot. Hold it for 20 seconds, the mac will reboot a couple times. And now you have that startling sound again 🤣. At least this is what i got with a 2012 iMac.

@leifliddy
Copy link

I have a MacBook9,1 and a MacBookPro14,1 -- and on both of these models I needed to set the hex value to 80
Setting it to 00 did not work. I'm surprised no one has posted anything on this topic before.....

 printf "\x07\x00\x00\x00\x80" > SystemAudioVolume-7c436110-ab2a-4bbb-a880-fe41995c9f82
 # probably wasn't needed, but changed the value of SystemAudioVolumeDB to match SystemAudioVolume
 printf "\x07\x00\x00\x00\x80" > SystemAudioVolumeDB-7c436110-ab2a-4bbb-a880-fe41995c9f82

@ammar-faifi
Copy link

ammar-faifi commented Jan 30, 2024

it only worked when i use yours @leifliddy 🫡,thanks

on MacBookPro13,1
i didn't need to overwrite the SystemAudioVolumeDB-* one

@P2AK
Copy link

P2AK commented Jun 26, 2024

Thanks @leifliddy ! After searching and trying to disable the startup chime / gong on my 2017 5K iMac 18,3 your trick of using 80 instead of 0 works great! Here's the script I use. I also put it in root's crontab @reboot to ensure it's always muted.

#!/bin/bash

#Ensure that we are root
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi

#Turn off the startup gong chime sound of a 2017 5K iMac 18,3 using Linux (Gentoo)
echo
echo ----------------------------------------------------------------
efivar -n "7c436110-ab2a-4bbb-a880-fe41995c9f82-SystemAudioVolume" -p # print
echo ----------------------------------------------------------------
echo "Before: $(efivar -n "7c436110-ab2a-4bbb-a880-fe41995c9f82-SystemAudioVolume" -d)" # print decimal
echo ----------------------------------------------------------------

#Remove the immutable flag before writing.
chattr -i "/sys/firmware/efi/efivars/SystemAudioVolume-7c436110-ab2a-4bbb-a880-fe41995c9f82"

#Set it to 80 instead of 0
printf "\x07\x00\x00\x00\x80" > "/sys/firmware/efi/efivars/SystemAudioVolume-7c436110-ab2a-4bbb-a880-fe41995c9f82"

#make it immutable again
chattr +i "/sys/firmware/efi/efivars/SystemAudioVolume-7c436110-ab2a-4bbb-a880-fe41995c9f82"
echo "After : $(efivar -n "7c436110-ab2a-4bbb-a880-fe41995c9f82-SystemAudioVolume" -d)" # print decimal
echo ----------------------------------------------------------------
echo

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