Created
July 1, 2020 19:06
-
-
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
This file contains 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 -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