Skip to content

Instantly share code, notes, and snippets.

@grohith327
Created October 30, 2019 18:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save grohith327/9192644cc40d2d1a2c0cc963dc5520ca to your computer and use it in GitHub Desktop.
Save grohith327/9192644cc40d2d1a2c0cc963dc5520ca to your computer and use it in GitHub Desktop.
import osascript
vol = osascript.osascript('get volume settings')
cur_vol = int(vol[1].split(':')[1].split(',')[0])
cur_vol = cur_vol - 20
if(cur_vol < 0):
cur_vol = 0
osascript.osascript("set volume output volume "+str(cur_vol))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment