Created
December 1, 2018 17:29
-
-
Save premek/049e1f8236fa19983ecd78f06d6038a3 to your computer and use it in GitHub Desktop.
A script to read SMSes via kdeconnect DBUS interface
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
#!/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