GRUB2: set Super Mario as startup tune

echo "GRUB_INIT_TUNE=\"1000 334 1 334 1 0 1 334 1 0 1 261 1 334 1 0 1 392 2 0 4 196 2\"" | sudo tee -a /etc/default/grub > /dev/null && sudo update-grub

22
By: stanix
2011-04-12 12:47:04

1 Alternatives + Submit Alt

What Others Think

untested, but if this works, the awesomeness could only be exceeded by changing the startup tune to the imperial death march
linuxrawkstar · 392 weeks and 5 days ago
Can anyone confirm if this works?
leovailati · 392 weeks and 5 days ago
This feature is documented at https://help.ubuntu.com/community/Grub2 , so it's for real. It is worth pointing out that the docs say that the Grub menu will not be displayed until after the music is done playing. Be aware of this when composing long into tunes.
smithadmin · 392 weeks and 5 days ago
yes, it works!
cd1 · 392 weeks and 4 days ago
Does this work in Fedora14?
dtolj · 392 weeks and 2 days ago
@dtoli if you hav grub2 installed then yes! What I'm interested in knowing is, will it work in burg? I'm going to try it out later.
sinisterstuf · 392 weeks and 2 days ago
@sinisterstuf: it works for burg replace grub by burg and it will work
halohell · 392 weeks ago
Found elsewhere: GRUB_INIT_TUNE="480 900 2 1000 2 800 2 400 2 600 3" for the "Close Encounters" greeting message. Sure would be nice to cat /dev/dsp somehow to test these tunes without rebooting.
Mozai · 390 weeks and 6 days ago
"sure would be nice to ..." Ha! instead of waiting, I figured it out myself. Pity that the GRUB2 wiki is down, else I'd add it there. It's too long to be a one-liner; pity I can't use it to curry favour with this website. tune="480 900 2 1000 2 800 2 400 2 600 3"; f="";tmpdir=$(mktemp -d);for d in $tune;do if [ ! "$t" ];then t=$d;elif [ ! "$f" ];then f=$d;else sox -U -r 8000 -n -t raw - synth $(echo "$d*(60/$t)"|bc -l) sine $f >>$tmpdir/grubtune.ul;f="";fi;done;sox -c1 -r 8000 $tmpdir/grubtune.ul $tmpdir/grubtune.au;play -q $tmpdir/grubtune.au;/bin/rm -r $tmpdir
Mozai · 390 weeks and 6 days ago
Hint: divide/multiply every second number by 2 to get a lower/higher octave :)
stanix · 390 weeks and 3 days ago
Amazing. This worked like a charm
nssy · 389 weeks and 6 days ago
Star Wars Imperial Death March: GRUB_INIT_TUNE="480 440 4 440 4 440 4 349 3 523 1 440 4 349 3 523 1 440 8 659 4 659 4 659 4 698 3 523 1 415 4 349 3 523 1 440 8"
Striek · 384 weeks and 6 days ago
:D
sputnick · 384 weeks and 5 days ago
tee is used when you need to print to STDOUT _and_ a file. Using it with sudo like this just adds an unneeded program into the mix. The alternative, passing all the commands to sudo as a string to be execute by bash, is somewhat better but still awkward.
dbbolton · 375 weeks ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: