Jump to content

Totally new to Alfred - is there a quick tutorial for kicking off a command with sudo?


Recommended Posts

Hi, 

  I'm an alfred powerpack user, and today I had a need to write down a few commands I'll need to use.

 

  here's one of them:

 

  sudo kextunload -b com.intel.kext.intelhaxm

 

  I was about to write this down in my documentation I'm keeping but then wondered if Alfred would be a better place for this!

 

  I figured if i can put this into a macro then I can just pull up alfred, run the macro and I won't need to look up the exact syntax and spelling of the whole command string.

 

  Is this easy to do? Does having sudo in there complicate things  (Since some input will be needed from the terminal)?

 

  Thanks!

 

 - Jack

Link to comment
You don’t actually need input from a terminal.

 

You can either use AppleScript with with administrator privileges to have a GUI dialog popup (see MachineClean for an example) or you can do something like sudo -S kextunload -b com.intel.kext.intelhaxm <<< your_sudo_password (-S tells sudo to read the password from standard input).

 

The second option would mean you having your password in plain text right there in your workflow which isn’t exactly recommended, but works without prompts.

Edited by Vítor
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...