Run terminal script at startup

Joined
Sep 22, 2014
Messages
1
Reaction score
0
Hello,

A few months ago I spilled water on the keyboard of my macbook pro. Luckily I can keep using my mac with a bluetooth keyboard. However, sometimes the internal keyboard also provides input (random keys). So I found a terminal script to disable the internal keyboard. Up till now I had to copy paste and run this script at every startup. I would be better to have it run automatically. I've tried two solutions up till now. First a solution wherein I had to create a ".sh" file, and then execute that file. I had to change the example script with my script, and make several adjustments (it was quite complicated), and eventually it didn't work. Secondly I tried it via Automator. (First start up terminal, and then have the program type the command, and then my password, and finally close terminal.) This doesn't work either. I have spend many hours on this, and I know very little of terminal scripts and Automator. So if somebody could provide a tailored solution I would be very grateful.

It is a very simple script:

sudo kextunload /System/Library/Extensions/AppleUSBTopCase.kext/Contents/PlugIns/AppleUSBTCKeyboard.kext/

After entering this in terminal I have to enter my password, and then the script is active.

Many thanks in advance,

Klaas
 
Joined
Nov 26, 2010
Messages
3,558
Reaction score
52
Code:
echo myPassword | sudo kextunload /System/Library/Extensions/AppleUSBTopCase.kext/Contents/PlugIns/AppleUSBTCKeyboard.kext/

with the Run Shell Script workflow
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top