Awesome. I'll give it a go this afternoon and get back to you. Thanks.Sure. Probably the easiest way is to make an Automator action with a "Run Shell Script" action, then save it as an application.
You can add that application to your login items to make it run on startup.
I implemented something similar recently myself and documented the process here:
https://www.ghostotter.com/making-shell-scripts-little-user-friendly/
Hope that's some help
Cool! Ill play around with it later and see what works better. Thanks.Kind of a variation of what superscape suggested, buy you could also use Script Editor to make an application to do what you want. Just put your Terminal command inside the quotes in place of say hello, then save as an application.
Code:do shell script "say hello"
Ahh. It won't work because it is a sudo command that disables the internal keyboard, therefore it needs a password when opened.Code:do shell script "say hello"
Yup, that's will work fine too.
It can get a bit confusing when you get into the realms of quoting things, but if you're confident with that then there's no reason not to do it that way.
sudo kextunload /System/Library/Extensions/AppleUSBTopCase.kext/Contents/PlugIns/AppleUSBTCKeyboard.kext/
I need to create an icon on the desktop to run a terminal command by double clicking.
cd ~/Desktop
cat > test.command
echo Hello World!
^D
chmod u+x test.command
#!/bin/bash
echo Hello World!
Alternative to the Automator method:
just create a plain text file (use a programmer's text editor, not TextEdit which will try to create a rich text file) containing your terminal commands, give it the the extension ".command", and then make it executable (needs a terminal command).
To do this all from the terminal:
Code:cd ~/Desktop cat > test.command echo Hello World! ^D chmod u+x test.command
I usually include the bash shebang so you can also run the file from the terminal. I.e. the file becomes:
Code:#!/bin/bash echo Hello World!
Con: starts up terminal and leaves a terminal window open cluttering up your desktop.
Pro: starts up terminal and leaves a terminal window open, so you can see any output and respond to requests for input.
Thanks for the response, and excuse my ignorance but...
Can you explain the process with a little more detail. Looks like you have included plenty of detail but this is my first dive into terminal/scripts.
#!/bin/bash
sudo kextunload /System/Library/Extensions/AppleUSBTopCase.kext/Contents/PlugIns/AppleUSBTCKeyboard.kext/
[/bash]
The first line ensures that the script file is run in "bash" - I'm not sure if its necessary for (or even used in) a .command file but it does mean you can also run the file directly from terminal if you wish.
(c) Save it to the desktop as 'mycommand.command'
(d) Now open the terminal, change directory to the desktop ("~/" means your home directory) and make the file executable by the owner:
[code]
cd ~/Desktop
chmod u+x mycommand.command
(a) Get hold of a programmer's text editor (there are at least 3 already installed that you can use in terminal, or download TextWrangler, Atom, Sublime Text, XCode).
What you want to do is:
(a) Get hold of a programmer's text editor (there are at least 3 already installed that you can use in terminal, or download TextWrangler, Atom, Sublime Text, XCode).
(b) Create a file containing:
...and you should have a double-clickable icon on your desktop that pops up a terminal window & runs the command in it.Code:#!/bin/bash sudo kextunload /System/Library/Extensions/AppleUSBTopCase.kext/Contents/PlugIns/AppleUSBTCKeyboard.kext/ [/bash] The first line ensures that the script file is run in "bash" - I'm not sure if its necessary for (or even used in) a .command file but it does mean you can also run the file directly from terminal if you wish. (c) Save it to the desktop as 'mycommand.command' (d) Now open the terminal, change directory to the desktop ("~/" means your home directory) and make the file executable by the owner: [code] cd ~/Desktop chmod u+x mycommand.command
Or just use TextEdit and choose 'Plain Text' in the Format menu. Why make it hard?
A.
Or just use TextEdit and choose 'Plain Text' in the Format menu. Why make it hard?
The most important thing about a "programmer's text editor" is not that it does magical super-secret programmers stuff, just that it doesn't even try to be a word processor.
our first suggestion is 'download (and learn) this new text editor'