{"id":443,"date":"1997-09-09T01:36:29","date_gmt":"1997-09-09T09:36:29","guid":{"rendered":"http:\/\/www.birdhouse.org\/betips\/?p=443"},"modified":"1997-09-09T01:36:29","modified_gmt":"1997-09-09T09:36:29","slug":"shuffle-your-startup-sound","status":"publish","type":"post","link":"https:\/\/www.betips.net\/?p=443","title":{"rendered":"Shuffle your startup sound"},"content":{"rendered":"<p>If you&#8217;d like to have a different sound played automatically every time you start your machine, you&#8217;ll want to run a brief script on startup that chooses a random sound or song from a given directory, then play it using either the built-in Sounds preferences panel or by specifying the path to your favorite audio player.<br \/>\n This tip assumes that your sound files are stored in <code>\/boot\/home\/config\/sounds<\/code> &#8212; edit to suit if you store them elsewhere.<br \/>\nAdd the following to <code>\/boot\/home\/config\/boot\/UserBootscript<\/code>:<\/p>\n<pre>\nN=`date +%S`\nN=`expr $N + 0`\nI=0\nfor file in \/boot\/home\/config\/sounds\/*; do\n\tI=$[$I + 1]\ndone\nN=$[($I * $N) \/ 60]\nfor file in \/boot\/home\/config\/sounds\/* ; do\n\tif [ $N -eq 0 ]\n\t\tthen\n\t\trm \/boot\/home\/config\/settings\/Sound\n\t\tln -s \"$file\" \/boot\/home\/config\/settings\/ Sound\n\t\tbreak\n\tfi\n\tif [ $N -ne 0 ]\n\t\tthen\n\t\tN=$[$N - 1]\n\tfi\ndone\n<\/pre>\n<p>Now, copy one of your sound files to <code>\/boot\/home\/config\/settings<\/code> and rename it &#8222;Sound.&#8220; If you want the sound to be played via the operating system&#8217;s built-in startup sound function, launch the Sounds preferences panel, select Startup in the main panel, and choose Other&#8230; from the picklist. Navigate to <code>\/boot\/home\/config\/settings\/Sound<\/code>.<br \/>\nAlternatively, you can simply point SoundPlay, MediaPlayer, or any other audio player at your Sound link from <code>~\/config\/boot\/UserBootscript<\/code>. For example:<\/p>\n<pre>MediaPlayer \/boot\/home\/config\/settings\/Sound &amp; <\/pre>\n<p>Make sure the audio format of the sounds you choose are supported by the player you use.<br \/>\nThe idea and 99% of code for this script was taken from the tip<a href=\"http:\/\/ www.betips.net\/chunga.php?ID=286\"> Shuffle your background Images<\/a> by Jason Scaroni.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you&#8217;d like to have a different sound played automatically every time you start your machine, you&#8217;ll want to run a brief script on startup that chooses a random sound or song from a given directory, then play it using either the built-in Sounds preferences panel or by specifying the path to your favorite audio [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[10],"class_list":["post-443","post","type-post","status-publish","format-standard","hentry","tag-scripting"],"_links":{"self":[{"href":"https:\/\/www.betips.net\/index.php?rest_route=\/wp\/v2\/posts\/443","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.betips.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.betips.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.betips.net\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.betips.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=443"}],"version-history":[{"count":0,"href":"https:\/\/www.betips.net\/index.php?rest_route=\/wp\/v2\/posts\/443\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.betips.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=443"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.betips.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=443"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.betips.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=443"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}