Git Product home page Git Product logo

mac-boot-chime-muter's Introduction

macOS/OS X boot chime muter

Prevent your Mac from making noise when it is being powered on.

Every Mac computer chimes when you turn it on. This can be quite load and unpredictable as the volume level is determined from what was set when the computer was last shut down. So unless you always remember to mute your Mac or at least turn the volume down before powering it off, mac-boot-chime-muter might be a tool for you.

Installation

Open Terminal, clone this repository anywhere in your file system, cd to it and run the following commands:

$ chmod u+x install.sh
$ sudo ./install.sh

If you wanted to uninstall the scripts, run similar commands but replace install.sh with uninstall.sh.

What happens during the installation?

  • a small shared JavaScript .scpt file compiled in Apple's Script Editor is copied to /Library/Script Libraries/,
  • turn-volume-down and turn-volume-up executables are dropped under /usr/local/bin/,
  • the two executables are registered as login and logout hooks.

The chime volume level is set to a very quiet 6% when the computer is being booted and once you have logged in - the level goes up to 31%. Why these particular values? Well, by default the OS supports 16 intervals from mute to maximum so 6% represents level 1 and 31 - level 5 that seems "just right" for normal computer use.

To customise these values you would need to open the provided system-volume.scpt file in Script Editor, hack the values and save your edits.

Troubleshooting

Program no longer works after macOS/OS X upgrade

Open Terminal and execute the following scripts:

defaults write com.apple.loginwindow LogoutHook /usr/local/bin/turn-volume-down
defaults write com.apple.loginwindow LoginHook /usr/local/bin/turn-volume-up

Caveats

If you use keyboard shortcuts for immediately shutting down or restarting the computer (Ctrl-Alt-Cmd-Eject/PowerOff or Ctrl-Cmd-Eject/PowerOff, respectively), this tool is not going to work. This is because macOS/OS X seems to ignore login and logout hooks in such scenarios.

Notes for techies

The simple scripts provided here have been written in JavaScript for Automation (JXA). Yes, the same effect could have been achieved with AppleScript in a more concise way but... hey, JavaScript is awesome and it has been great fun to knock it all together using this language!

Another alternative that can be found on-line is the firmware manipulation command line tool called nvram. I am yet to get it to work successfully so for now I am going to stick to my tool instead.

Licence

http://unlicense.org

mac-boot-chime-muter's People

Contributors

chris-kobrzak avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.