Skip to content
Automatically set the volume of macOS to a specified volume.
Swift CSS HTML Objective-C
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
AutoVolume.xcodeproj Rename from Agent -> AutoVolume. Jan 8, 2017
AutoVolume Set window as initial controller. Change presentation to single. Jul 5, 2017
AutoVolumeHelper Rename from Agent -> AutoVolume. Jan 8, 2017
AutoVolumeHelperTests Rename from Agent -> AutoVolume. Jan 8, 2017
AutoVolumeTests Remove old agent references. Jul 5, 2017
AutoVolumeUITests Rename from Agent -> AutoVolume. Jan 8, 2017
website Add download link. Apr 2, 2017
.gitignore Initial commit with volume module. Dec 17, 2016
CONTRIBUTING.md Add license and contributing. Apr 2, 2017
LICENSE Correct license. Sep 24, 2017
README.md Add Hammerspoon example. Oct 31, 2017

README.md

AutoVolume (macOS)

Home page

AutoVolume automatically sets the volume of macOS to a specified volume. At the moment it only fires on sleep. For example, the primary use case is to set the system volume to 0 when waking from sleep to save being surprised if you were listening to music quite loud before you closed it and fell asleep.

Why? To learn about macOS development, begin the 'Agent' idea, and practice design.

Alternative:

Use HammerSpoon and hook into systemDidWake and mute default audio device. For example:

function sleepWatch(eventType)
  if (eventType == hs.caffeinate.watcher.systemWillSleep or eventType == hs.caffeinate.watcher.systemDidWake) then
    hs.audiodevice.defaultOutputDevice():setVolume(0)
  end
end

sleepWatcher = hs.caffeinate.watcher.new(sleepWatch)
sleepWatcher:start()

TODO

  • Add user notifications
  • Remove NSLog or hide behind debug flag

Wishlist

  • Choose audio device
  • Choose event for when to act
  • Only change volume if a specified amount of time has elapsed
  • Add option to display the current volume in a notable way on event
  • Act only if volume is above a specified threshold
  • Set time when to set volume (suggested by Simone M)
  • [Optional] menu bar icon
  • Set volume on system login

Contributing

Contributions are welcome! See contributing.

License

See license.

You can’t perform that action at this time.