A collection of command line scripts for working with
Expo Snacks':
QR codes, the browser, clipboard, emulator, etc.
by jaggz.h who is at gmail.com. Script version date: 2018-01-16
References:
- React Native: https://facebook.github.io/react-native/
- Expo: https://expo.io/
- Expo Snacks: https://snack.expo.io/
Converts Expo Snack web URLS (https://) to the exp:// format and copies the URL to the clipboard, using X11's xsel command, which allows the Expo client, in the emulator, to pick it up.
Expo scripts for working with Expo snack URLs and QR Codes for use with the emulator.
NOTE: Make sure you have clipboard sharing enabled in
The Emulator -> ... -> Settings -> Clipboard sharing
My emulator loses this function, and I must toggle the
Clipboard sharing option off and back on to get it working again.
Example: expo https://snack.expo.io/HJVEgOugW
Produces: exp://expo.io/@snack/H1cnedhBW
Example registered user input (this may not work yet):
expo https://snack.expo.io/@jaggzh/slider-example
Produces: exp://expo.io/@jaggzh/slider-example
Examines the whole screen for a QR code (the one in the browser!)
(See example screencapture below (taken from an Expo github issue))
- Gets the URL from the QR code,
- Converts it to an Expo app URL,
- ...And copies it to the clipboard for Expo, in the emulator, to pick up in its main screen.
- Have QR code visible on screen (in browser probably)
- Make sure you have clipboard sharing enabled in
The Emulator -> ... -> Settings -> Clipboard sharing.
If Expo doesn't pick up the URL, you might need to toggle the setting off and back on again. I don't know why it breaks. - Run:
expoqr
If found, the QR Code from Expo's snacks will contain, for example:
exp://expo.io/@snack/Skf4bLBNz+BJDE-ISNz
Then, then clipboard will have what the Expo app craves:
exp://expo.io/@snack/Skf4bLBNz
will be placed in the clipboard (currently uses xsel -ib, so it only works in un*x/X11)
- ImageMagick's "
import
" commandline utility (to capture the desktop)
You may change the "import -window root ...
" command to your own screen capture utility - zbar-tools' "
zbarimg
" utility
If you have another utility to scan an image for QR codes, be my guest.
- sudo apt install imagemagick zbar-tools