Last active
September 21, 2022 09:13
-
-
Save TomerGamerTV/799bfdd2b5129447267a12b0080881da to your computer and use it in GitHub Desktop.
Simple Steam account switcher for Mac using bash
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Remember to do
chmod +x steam-login.sh
to make it work