New Plugin: Python extension (and Remote KDE unlock)

Srivatsan Iyer supersaiyanmode.rox at gmail.com
Thu Aug 18 23:58:35 UTC 2016


Hi Aleix,

Unlock/lock is just a sample. The main idea is to embed python interpreter
with custom modules, so that anyone can easily write their own plugins. All
it would take is a few lines of python as opposed to a shared object.
Further, the Android activity corresponding to this plugin can potentially
be made generic enough to dynamically show elements corresponding to each
plugin. Currently the ListView gets automatically populated with plugins
information (specifically ones that have expressed an intent to listen to
"MAIN" event  -- akin to android.intent.action.MAIN).

May be providing a different example might help what I'm trying to explain.
Assuming the android device is able to listen to an event "battery fully
charged", any one can quickly write up a script that listens to that event,
and sends a desktop notification to unplug the charger. All you'd need to
do is drop the script (and metadata.json) in a specific folder. That's it.
No change on the android side at all (assumption of being able to listen to
the event still holds but this is just a one time business).

Srivatsan



On Thu, 18 Aug 2016 at 16:24 Aleix Pol <aleixpol at kde.org> wrote:

> On Tue, Aug 16, 2016 at 10:50 AM, Srivatsan Iyer
> <supersaiyanmode.rox at gmail.com> wrote:
> > Hello,
> >
> > I have been writing a kdeconnectd plugin that embeds a python interpreter
> > allowing scripts to be written to extend functionality. These scripts can
> > respond to android system events (such as phone unlock) or be manually
> > invoked via the Android App.
> >
> > There's a bare-bones implementation in my Github repository (links
> below),
> > that is able to load two scripts: one that locks the KDE session from the
> > android device, and the other that listens to android device unlock event
> > and also unlocks KDE. (Link to a gif below).
> >
> > I have a few questions and I'd really appreciate you guys' response.
> >
> > 1) Although I do not see it within the repository here:
> > github.com/KDE/kdeconnect-kde, is this something someone else is
> working on
> > locally? If so, I'd love to collaborate and contribute.
> >
> > 2) This point is valid provided the plugin sounds like a good idea. The
> > current implementation is really not that robust and has a lot of rough
> > edges. I have about 10-15 non-trivial todos before I can even think of a
> PR.
> > Eventually, this plugin will expose basic desktop functionalities of KDE
> > (like notifications), and the android device (like other calls, texts, or
> > notification access). Additionally I am also thinking about virtualenvs
> and
> > ability to install 3rd party packages for these python scripts. This,
> > surely, is too ambitious for me. But in the short term, I feel I am done
> > with a basic skeleton and would like others taking a look. What would be
> the
> > best process? I can surely submit a review at git.reviewboard.kde.org,
> but
> > it might take me a few months to fully finish this and submit for
> review. Or
> > is it okay submit work that is (somewhat) complete but not ready to be
> > merged? I am looking for something that allows for a lot of going back
> and
> > forth.
> >
> > Links:
> > - kdeconnect-kde diff:
> >
> https://github.com/KDE/kdeconnect-kde/compare/master...supersaiyanmode:master
> > - kdeconnect-android diff:
> >
> https://github.com/KDE/kdeconnect-android/compare/master...supersaiyanmode:master
> > - Remote KDE Unlock demo:
> > https://twitter.com/supersaiyan_9/status/765440342023745536
> >
> > Thanks,
> > Srivatsan
> > --
> >
> > Srivatsan Iyer
>
> There's already a plugin for un/locking in plugins/lockdevice, we
> didn't enable it by default because we don't have UI for Android. I'd
> suggest making your Android patch work with this one, so it's not
> duplicated in the KDE side.
>
> HTH,
> Aleix
>
-- 

Srivatsan Iyer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdeconnect/attachments/20160818/e5c08d99/attachment.html>


More information about the KDEConnect mailing list