Skip to content

Instantly share code, notes, and snippets.

@premek

premek/mbank-sms.sh

Created Dec 1, 2018
Embed
What would you like to do?
A script to read SMSes via kdeconnect DBUS interface
#!/usr/bin/env bash
DEV=`dbus-send --print-reply --dest=org.kde.kdeconnectd /modules/kdeconnect/devices org.freedesktop.DBus.Introspectable.Introspect | sed -n 's/.*node name="\(.*\)".*/\1/p'`
DATE=`date +'%d-%m-%Y'`
SMS="`dbus-send --print-reply --dest=org.kde.kdeconnectd /modules/kdeconnect/devices/$DEV org.kde.kdeconnect.device.conversations.activeConversations | grep -A3 "Operace ze dne $DATE" | sed 's/.*string "\|"$//'`"
echo $SMS
CODE=`echo $SMS | sed -ne 's/.* \([0-9]\{5,\}\) .*/\1/gp'`
echo $CODE | xclip
echo copied: $CODE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment