Coder Social home page Coder Social logo

jaggzh / react-native--expo-shell-utils Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 159 KB

React Native/Expo: A collection of command line scripts for working with QR codes, the browser, clipboard, emulator, etc.

License: MIT License

Perl 41.37% Shell 58.63%

react-native--expo-shell-utils's Introduction

react-native--expo-shell-utils

React Native/Expo command line scripts

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:

  1. React Native: https://facebook.github.io/react-native/
  2. Expo: https://expo.io/
  3. Expo Snacks: https://snack.expo.io/

Currently two scripts are included:


expo

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


expoqr

Examines the whole screen for a QR code (the one in the browser!)
(See example screencapture below (taken from an Expo github issue))

  1. Gets the URL from the QR code,
  2. Converts it to an Expo app URL,
  3. ...And copies it to the clipboard for Expo, in the emulator, to pick up in its main screen.

To run:

  1. Have QR code visible on screen (in browser probably)
  2. 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.
  3. 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)

Example screen capture:

Screenshot of expoqr

This script depends on:

  • 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.

To install those in Debian/Ubuntu:

  • sudo apt install imagemagick zbar-tools

react-native--expo-shell-utils's People

Contributors

jaggzh avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.