Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Tom Pillot
pi-gen-thymio
Commits
18b6b6c2
Commit
18b6b6c2
authored
Jun 22, 2020
by
Tom Pillot
Browse files
Add Blockly standalone
parent
0ac67adb
Changes
2
Hide whitespace changes
Inline
Side-by-side
stage4/05-blockly-standalone/00-packages
0 → 100755
View file @
18b6b6c2
npm
stage4/05-blockly-standalone/01-run.sh
0 → 100755
View file @
18b6b6c2
#!/bin/bash -e
# Download and build Blockly
on_chroot
<<
EOF
cd /opt
git clone https://github.com/Mobsya/thymio-blockly-standalone.git
chmod -R 777 thymio-blockly-standalone/
cd thymio-blockly-standalone/
npm i
npm run build
EOF
# Script to run Blockly, thymio-device-manager needs to be launched before Blockly
cat
>
"
${
ROOTFS_DIR
}
/opt/thymio-blockly-standalone/run-blockly.sh"
<<
EOF
#!/bin/bash
pgrep -f thymio-device-manager
if [
\$
? -eq 0 ]; then
echo "thymio-device-manager is already running."
else
echo "Running thymio-device-manager ..."
thymio-device-manager& > /dev/null
fi
chromium-browser /opt/thymio-blockly-standalone/thymio_blockly/thymio_blockly.fr.html &> /dev/null
EOF
chmod
+x
"
${
ROOTFS_DIR
}
/opt/thymio-blockly-standalone/run-blockly.sh"
# Add a desktop shortcut
cat
>
"
${
ROOTFS_DIR
}
/home/
${
FIRST_USER_NAME
}
/Desktop/blockly.desktop"
<<
EOF
[Desktop Entry]
Type=Link
Name=Blockly
Icon=thymio-blockly-icon
URL=/usr/local/share/applications/blockly.desktop
EOF
cat
>
"
${
ROOTFS_DIR
}
/usr/local/share/applications/blockly.desktop"
<<
EOF
[Desktop Entry]
Type=Application
Name=Blockly
Icon=thymio-blockly-icon
Exec=/opt/thymio-blockly-standalone/run-blockly.sh
Categories=Education;Science;
EOF
# Allow user to edit and run desktop entries
chmod
-R
777
"
${
ROOTFS_DIR
}
/home/
${
FIRST_USER_NAME
}
/Desktop/"
# Add an icon for Blockly
cp
"
${
ROOTFS_DIR
}
/opt/thymio-blockly-standalone/thymio_blockly/media/thymio-blockly-icon.png"
"
${
ROOTFS_DIR
}
/usr/share/pixmaps/"
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment