Jump to content
Stooovie

[SOLVED] Launch apps as sudo? Possible?

Recommended Posts

Hi,

 

I’d LOVE an option in Alfred to launch apps as admin (=with sudo). For example, some file managers like Forklift or Marta don’t run as admin by default, making them less than ideal for my needs. 

 

I know I can do this in terninal, but I’d love to be able to do this in Alfred, preferably with modifier key (i.e. "hold Opt to run as admin“).

 

Any tips? Thanks!

Share this post


Link to post
15 hours ago, Stooovie said:

For example, some file managers like Forklift or Marta don’t run as admin by default

 

I find that weird, and that seems like a bad decision.

 

It also seems unlikely that option will ever be added to Alfred. Very few people would want it, and it gives users an easy way to shoot themselves in the foot.

 

15 hours ago, Stooovie said:

I know I can do this in terninal

 

You don’t need a terminal, you just need a Run Script Action.

Share this post


Link to post

Thanks! Just one thing - how do I pass my root (admin) password so I don’t have to enter it manually upon invoking the command? TY

 

EDIT: I’m just using the Terminal command action to do this, with a simple "sudo -b /Applications/Marta.app/Contents/MacOS/Marta" 

Share this post


Link to post
2 minutes ago, Stooovie said:

how do I pass my root (admin) password

 

You don't because that would be very bad from a security perspective.

 

Either you use AppleScript: do shell script "/Applications/Marta.app/Contents/MacOS/Marta" with administrator privileges


Or you edit your sudoers configuration, so you don't need to enter your password to use sudo.


The former is a better idea, security-wise.

Share this post


Link to post
1 hour ago, deanishe said:

You don't because that would be very bad from a security perspective.

 

Still, it is possible (even if a terrible idea) with sudo --stdin /Applications/Marta.app/Contents/MacOS/Marta <<< PASSWORD_HERE.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...