I need to be able to run a bash script every time a specific user logs in. The solution here is for all users.
Is there any way to specify the user, and if not is there a way for the bash script to check the username that has logged in?
You can add a script call in his specific
If you want it to be more general, you can add it in
If you go with the LaunchAgent solution, just put it in that user's ~/Library/LaunchAgents folder, and it'll only run when that particular user logs in.
If you go with the LoginHook solution, you need to write the script so that it checks the username (passed to the script as $1):