-
Notifications
You must be signed in to change notification settings - Fork 277
CLI Scripting
Andy Holmes edited this page Dec 1, 2019
·
11 revisions
WARNING: This page is under construction
./daemon.js --help
Usage:
GSConnect [OPTION…]
Help Options:
-h, --help Show help options
--help-all Show all help options
--help-gapplication Show GApplication options
--help-gtk Show GTK+ Options
Application Options:
-l, --list-devices List available devices
-a, --list-all List all devices
-d, --device=<device-id> Target Device
--pair Pair
--unpair Unpair
--message=<phone-number> Send SMS
--message-body=<text> Message Body
--notification=<title> Send Notification
--notification-appname=<name> Notification App Name
--notification-body=<text> Notification Body
--notification-icon=<icon-name> Notification Icon
--notification-id=<id> Notification ID
--photo Photo
--ping Ping
--ring Ring
--share-file=<filepath|URI> Share File
--share-link=<URL> Share Link
-v, --version Show release version
--display=DISPLAY X display to use
When running a script with the Commands plugin, several environment variables are available to ease scripting:
echo $GSCONNECT; # Path to the application (`daemon.js`)
echo $GSCONNECT_DEVICE_DBUS; # DBus object path, useful for Python, GJS or other script
echo $GSCONNECT_DEVICE_ID; # The id of the device executing the command
echo $GSCONNECT_DEVICE_NAME; # The display name of the device (eg. Google Pixel)
echo $GSCONNECT_DEVICE_ICON; # The themed icon name of the device (eg. smartphone-symbolic)
A typical script might look like this:
#!/bin/bash
screenshot1=/tmp/$(date).png
gnome-screenshot --file=${screenshot1}
screenshot2=/tmp/$(date).png
gnome-screenshot --file=${screenshot1}
${GSCONNECT} --device ${GSCONNECT_DEVICE_ID} --share-file ${screenshot1} \
--share-file ${screenshot2}