Last active
May 8, 2020 14:54
-
-
Save Konfekt/ebad84e99695905d9613ce215034b748 to your computer and use it in GitHub Desktop.
kc-sms - send SMS using KDEconnect on the command line
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
if ! command -v kdeconnect-cli >/dev/null 2>&1; then | |
echo "kde-connect-cli not found! Please install KDE Connect." | |
exit 1 | |
fi | |
if [ $# -eq 0 ] || [ "$1" = -h ] || [ "$1" = --help ]; then | |
echo "kc-sms - send SMS using KDE Connect on the command line" | |
echo "usage: kc-sms <Phone Number> <Message> [Parameters]" | |
echo "example: kc-sms 01721234567 'How are you?' --refresh" | |
exit 2 | |
fi | |
name="$(kdeconnect-cli --list-available --name-only | head -n 1)" | |
if kdeconnect-cli --name "$name" --destination "$1" --send-sms "$2" "${@:3}"; then | |
echo "successfully sent SMS to $1 by phone $name" | |
else | |
echo "error sending SMS to $1 by phone $name" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This blog entry explains this little script.