Tell me more ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I am looking for a script which will allow me to disable one specific USB port on my Mac mini. It would only serve a purpose if it works in real-time and didn't require a reboot. I've found scripts for various Linux distros that seemed to do something similar - however most required a reboot.

I've got ambient lighting behind my monitor which is powered by USB and it doesn't turn off when the system sleeps. So my office is constantly lit up, it would be nice if I could write a script that would disable that specific USB port.

How to disable individual USB ports by script?

share|improve this question

2 Answers

Have you seen this thread? Maybe shell could be used to "manually" rename the device ID or port to something odd that won't work, upon a specified event, then renames it to what it's supposed to be later.

share|improve this answer

Unfortunately, what you are asking is not possible with any OS X API or AppleScript hook. This is something controlled by the hardware layer of the OS and involves far more work than it's worth. While similar scripts exist for Linux, you must keep in mind that even though OS X and Linux are distant cousins, OS X wasn't built for such fine-grained control over its components like Linux was. Sadly, the only options you have in this case is to unplug the device or completely disable the USB interface. That last one, of course, isn't feasible for you, so unfortunately, there's no solution to this problem. Sorry. :(

Good luck and happy sleeping!

share|improve this answer
Can you cite a reason or documentation for "OS X wasn't built for such fine-grained control over its components like Linux was" Surely both Linux and OSX are Unix like OSs and have equal control over interfaces – Mark Nov 16 '12 at 18:28

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.