A simple Bash script to share text data using quick response (QR) codes.
Go to file
Adam ed08b701c3 initial commit 2025-03-27 15:41:57 -06:00
src initial commit 2025-03-27 15:41:57 -06:00
LICENSE initial commit 2025-03-27 15:41:57 -06:00
README.md initial commit 2025-03-27 15:41:57 -06:00

README.md

QR Share

Share text data between devices using a computer with GNU/Linux operating system, a camera and a quick response (QR) code.

Features

  • Supports QR code output to the console (tty), terminal (pts) or graphical user interface (GUI)
  • Auto detects graphical environment, X.Org or Wayland
  • Clipboard access uses xclip (X.Org) or wl-paste (Wayland)
  • Text data sourced from clipboard or as a command argument
  • Shares Wi-Fi network QR code (pregenerated image)
  • Customize image viewer command along with arguments
  • Customize Wi-Fi image viewer command along with arguments

Install

  1. Install application dependencies.

    Choose one of the applicable example commands below by operating system and display server, X.Org or Wayland.

    Arch Linux - X.Org

    # pacman -Sy qrencode xclip
    

    Arch Linux - Wayland

    # pacman -Sy qrencode wl-clipboard
    

    Fedora - X.Org

    # dnf install qrencode xclip
    

    Fedora - Wayland

    # dnf install qrencode wl-clipboard
    

    Debian/Ubuntu - X.Org

    # apt install qrencode xclip
    

    Debian/Ubuntu - Wayland

    # apt install qrencode wl-clipboard
    
  2. Download QR Share.

  3. Install QR Share.

    Move QR Share to one of the following directories. Which ever directory you choose make sure it is found within the PATH environment variable to ensure the command works in all contexts.

    Accessible to a Specific User

    $ mv qrshare ~/.local/bin/
    

    Accessible to All System Users

    # mv qrshare /usr/local/bin/
    

Configuration

The user settings are configured within the qrshare command and can be altered by using a text editor. Each user setting is optional, but be aware if a setting is omitted functionality maybe limited. User-friendly error messages will tell you if a setting is missing. Here is a break-down of the available settings.

  • wifiQRCode (optional): An absolute path to a pregenerated Wi-Fi QR code. The value must be enclosed in quotes.
  • wifiViewer (optional): The command name of a desired Wi-Fi image viewer (e.g. feh, kitten). The value must be enclosed in quotes.
  • wifiViewerArgs (optional): The associated image viewer arguments. Each argument must be enclosed in quotes and all the arguments must be surrounded by parentheses.
  • viewer (optional): The command name of a desired image viewer (e.g. feh, kitten). The value must be enclosed in quotes.
  • viewerArgs (optional): The associated image viewer arguments. Each argument must be enclosed in quotes and all the arguments must be surrounded by parentheses.

View the qrshare command in a text editor to see examples.

Usage

Generate QR code from Clipboard

First copy text data to the clipboard within X.Org or Wayland and then run the following command to generate a QR code.

$ qrshare

Generate QR code from Argument

Generating a QR code from an argument is simply achieved by typing out a text string in quotes after the command.

$ qrshare "Hello World!"

Display Wi-Fi QR Code

In order to display a pregenerated Wi-Fi QR code QR Share requires three configuration options to be previously set, wifiQRCode, wifiViewer and wifiViewerArgs. Once the configuration has been completed, run one of the following command examples.

$ qrshare -w
$ qrshare --wifi

Display Help

A simple help message can be displayed using one of the following commands.

$ qrshare -h
$ qrshare --help

Refer to the LICENSE file for details.