Skip to content

Instantly share code, notes, and snippets.

@TomerGamerTV
Last active September 21, 2022 09:13
Show Gist options
  • Save TomerGamerTV/799bfdd2b5129447267a12b0080881da to your computer and use it in GitHub Desktop.
Save TomerGamerTV/799bfdd2b5129447267a12b0080881da to your computer and use it in GitHub Desktop.
Simple Steam account switcher for Mac using bash
#!/bin/bash
osascript -e 'tell application "Steam" to quit'
#this thing above might be buggy if steam closes just rerun the script
selected=$(osascript -e "set accounts to {\"USERNAME1\", \"USERNAME2\"}
set selectAccount to choose from list accounts with prompt \"Steam account:\"
selectAccount")
case "$selected" in
USERNAME1)
open /Applications/Steam.app --args -login "$selected" "PASSWORD"
;;
USERNAME2)
open /Applications/Steam.app --args -login "$selected" 'PASSWORD'
;;
*)
exit 0
;;
esac
#Credits to this post taken from reddit https://www.reddit.com/r/macprogramming/comments/7y3ob1/comment/dudnm9z/?context=3
#i just fixed the closing of the steam app.. i think
@TomerGamerTV
Copy link
Author

TomerGamerTV commented Sep 20, 2022

Remember to do chmod +x steam-login.sh to make it work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment