<div dir="ltr">Hi Aleix,<div><br></div><div>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 <span style="line-height:1.5">android.intent.action.MAIN).</span></div><div></div>





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