Created
September 7, 2021 14:29
-
-
Save DanEdens/820a33d1af7ae58808e9b634bf6fff23 to your computer and use it in GitHub Desktop.
check_wsl2_otherwise_get_mqtt-stored_DISPLAY
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
if grep -qEi "(Microsoft|WSL)" /proc/version &> /dev/null ; then | |
echo WSL2 detected. Using Local \$DISPLAY. $DISPLAY | |
export DISPLAY=$(grep -m 1 nameserver /etc/resolv.conf | awk '{print $2}'):0.0 | |
else | |
echo Using Ghost\'s \$DISPLAY: $DISPLAY | |
export DISPLAY=$(mosquitto_sub -h $AWSIP -p $AWSPORT -t status/ghost/IP -C 1):0.0 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment