Skip to content

Instantly share code, notes, and snippets.

@BobSynfig
Last active April 26, 2022 22:14
Show Gist options
  • Save BobSynfig/603eb64d16515e610489a81cbce56a06 to your computer and use it in GitHub Desktop.
Save BobSynfig/603eb64d16515e610489a81cbce56a06 to your computer and use it in GitHub Desktop.
Run Synfig in a Web Browser!
#!/bin/bash
# Access SynfigStudio from your web browser at the address http://IP:PORT
# You can use for example a Tablet with a BlueTooth mouse
# Note: You may have to open the port in your firewall to access it from another device
IP=192.168.0.21 # The Ip of your interface
PORT=3131 # The Port
B_DISPLAY=:5 # A display number, 5 should be fine
# You can select a theme or let it empty for the default theme
# THEME=
# THEME=Adwaita:dark
THEME=Adwaita
# The path and name of your SynfigStudio build
BUILD_BASE=~/sources/synfig/_production/build # Depends on your system
BINARY=bin/synfigstudio # This should be untouched
# Don't modify below -------------------------------------------------
RUN_BROADWAYD="broadwayd --address=$IP --port=$PORT $B_DISPLAY"
# Start Broadway server
$RUN_BROADWAYD & </dev/null >/dev/null 2>&1
PID_BROADWAYD=$!
PWD=`pwd`
cd $BUILD_BASE
GDK_BACKEND=broadway BROADWAY_DISPLAY=$B_DISPLAY GTK_THEME=$THEME $BINARY
cd $PWD
# Kill Broadway server
if ps -p $PID_BROADWAYD >/dev/null
then
kill $PID_BROADWAYD >/dev/null || true
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment