Skip to content

Instantly share code, notes, and snippets.

@fabacab
Created July 1, 2020 19:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fabacab/e85c21215dfcef2b085a11cfdb4ddaa2 to your computer and use it in GitHub Desktop.
Save fabacab/e85c21215dfcef2b085a11cfdb4ddaa2 to your computer and use it in GitHub Desktop.
Signal Switch - Signal Desktop switcher that makes it easy to flip between two different Signal accounts installed on the same macOS user account
#!/bin/bash -x
#
# Switch out one Signal Desktop installation for another.
#
APPSUPPORT_DISABLED="$HOME/tmp/Library-DISABLED/Application Support"
mkdir -p "$APPSUPPORT_DISABLED"
signal_running="$(ps -ef | grep -v grep | grep Signal.app/Contents/MacOS/Signal | wc -l | tr -d ' ')"
if [ 0 -lt $signal_running ]; then
osascript -e 'tell application "Signal" to quit'
sleep 3
fi
mv "$HOME/Library/Application Support/Signal" "$APPSUPPORT_DISABLED/Signal-tmp"
[ -d "$APPSUPPORT_DISABLED/Signal" ] && mv "$APPSUPPORT_DISABLED/Signal" "$HOME/Library/Application Support/Signal"
mv "$APPSUPPORT_DISABLED/Signal-tmp" "$APPSUPPORT_DISABLED/Signal"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment