| 1   2     3   | Next | Last
maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   [User feedback request] Shepherd (https://talk.maemo.org/showthread.php?t=31524)

attila77 2009-09-10 21:44

[User feedback request] Shepherd
 
Have you ever left an app running only to let it run your battery dry ? Would you like to run a torrent client, but only if you're home and plugged in ? Well, there might be a way, but I need your input !

I wrote a script called Shepherd, which is basically a glorified scheduler (cron) that has not just time, but a power and connectivity axis, too. This way, for any process registered to Shepherd, you can define:
  • hours allowed
  • connection type allowed (I guess you could define exact connections, but I never got that far)
  • power requirements (plugged in, or a minimum % of battery)
  • user inactivity (also started to implement, but never actually finished)

I used it for a couple of things... Flipclock (turn on if charging), transmission (turn on if charging and on WLAN between 2AM and 8AM) and killing maps if battery gets below 25%. It's very simple - launches the app if it is not already running and the conditions are met, and kills it if they aren't (but only if they were started by the shepherd app).

It currently does not have a GUI which pretty much makes it unusable for most users, BUT, this is where you have your say ! What would you like to see in Shepherd in addition to what I described ? Can you think up more use-case scenarios ? Do you have ideas how the GUI should look ? (throwing it all on one page would really cramp it's style !)

Do you like/need something like this ? Comments, ideas more than welcome !

zerojay 2009-09-10 21:46

Re: [User feedback request] Shepherd
 
This is a great idea. I can't think of any other vectors I'd like. Great job... and if you're interested in getting some UI design help from a member of the Maemo 5 UI team, please let me know and I'll get you in touch. :)

ColdFusion 2009-09-10 22:00

Re: [User feedback request] Shepherd
 
Location maybe? When you get to the store it opens your grocery list.
For exact connection a use case could be that you want to run some app only on the corporate network, or don't run the torrent client on it.

attila77 2009-09-10 22:22

Re: [User feedback request] Shepherd
 
Quote:

Originally Posted by ColdFusion (Post 325117)
Location maybe? When you get to the store it opens your grocery list.

Excellent idea ! We could also make it chirp to know you should get off the bus, or just start Maps when you leave home :) Keep this rolling !

Quote:

For exact connection a use case could be that you want to run some app only on the corporate network, or don't run the torrent client on it.
Yes, I agree completely, the sole reason it's not already implemented is that it required more mucking with the Diablo API than I could spare at the time. But if there is interest, I can certainly take another look :)

tso 2009-09-10 22:22

Re: [User feedback request] Shepherd
 
heh, could it be made to control the updates checker so that it only uses wifi?

attila77 2009-09-10 22:30

Re: [User feedback request] Shepherd
 
Quote:

Originally Posted by zerojay (Post 325094)
This is a great idea. I can't think of any other vectors I'd like. Great job... and if you're interested in getting some UI design help from a member of the Maemo 5 UI team, please let me know and I'll get you in touch. :)

Absolutely. My GTK+ UI skills are a little worse than that of a sleeping walrus :) :(

attila77 2009-09-10 22:36

Re: [User feedback request] Shepherd
 
Quote:

Originally Posted by tso (Post 325133)
heh, could it be made to control the updates checker so that it only uses wifi?

Hm, Shepherd can't make an app (not) use wifi, however, it can start or stop it depending whether wifi is (not) available. Would that help ?

Saturn 2009-09-10 23:02

Re: [User feedback request] Shepherd
 
Quote:

Originally Posted by attila77 (Post 325087)
...
I wrote a script called Shepherd, which is basically a glorified scheduler (cron) that has not just time, but a power and connectivity axis, too.
...

Excellent idea!! Hope it prospers, I would really love to have this functionality.

Quote:

Originally Posted by attila77 (Post 325142)
Hm, Shepherd can't make an app (not) use wifi, however, it can start or stop it depending whether wifi is (not) available. Would that help ?

I think in this case wouldn't help. :(

Another idea/workaround could be to play with the "next update" time. That is, increase it a lot when doesn't have a preferred connection and decrease it when in the opposite case.. but it's a little bit weird.

The best would be to ask to be given an option to disable the automatic updates and the ability to run them on request. Does this qualify for an enhancement request (if it doesn't already exist)?

lma 2009-09-10 23:03

Re: [User feedback request] Shepherd
 
Other possible vectors: CPU load, RAM/SWAP usage, network load. Maybe contextkit integration down the line.

qole 2009-09-10 23:09

Re: [User feedback request] Shepherd
 
So you could use this to send your IP address to a central server every time you connected to a new WiFi? (Still) thinking of a thief-catching utility...

dormant 2009-09-10 23:09

Re: [User feedback request] Shepherd
 
  • device orientation
  • gps status

attila77 2009-09-10 23:16

Re: [User feedback request] Shepherd
 
Quote:

Originally Posted by Saturn (Post 325154)
The best would be to ask to be given an option to disable the automatic updates and the ability to run them on request. Does this qualify for an enhancement request (if it doesn't already exist)?

If the update is an executable or DBUS call it should be doable. I already have custom categories (apart from those dug up from the Maemo launcher), so in that case this could fit nicely (disable updates, and then make it run via shepherd).

Quote:

Originally Posted by lma (Post 325155)
Other possible vectors: CPU load, RAM/SWAP
usage, network load. Maybe contextkit integration down the line.

Right ! I can already see that vectors will have to be modular/extensible as this has growing potential :) And since we're on an input frenzy... with a N900 we could also do:

- Light sensor
- Kickstand
- Proxymity sensor

Not sure about the use cases for these, but... that's up to you ! :)

attila77 2009-09-10 23:18

Re: [User feedback request] Shepherd
 
Quote:

Originally Posted by qole (Post 325157)
So you could use this to send your IP address to a central server every time you connected to a new WiFi? (Still) thinking of a thief-catching utility...

Absolutely ! (That's a new connectivity flag BTW.. new connection, nice, nice)

Saturn 2009-09-10 23:32

Re: [User feedback request] Shepherd
 
Quote:

Originally Posted by qole (Post 325157)
So you could use this to send your IP address to a central server every time you connected to a new WiFi? (Still) thinking of a thief-catching utility...

Could also sent the last known GPS location. Adds also value which later can be used differently. e.g plot in a map your day out.

ColdFusion 2009-09-11 00:42

Re: [User feedback request] Shepherd
 
How about a "Dock mode" when the TV out is pluged and external keyboard and mouse are detected? It could start Easy Debian to turn it into a real workstation.

tso 2009-09-11 02:26

Re: [User feedback request] Shepherd
 
hmm, i guess one option would be to set the refresh time for the updater to a silly high number, and basically use shepered to run apt-get update at intervals, if wifi is available, but not when phone is.

iKneaDough 2009-09-11 03:17

Re: [User feedback request] Shepherd
 
I would like it if it could put the device in silent mode, and disable all audible alerts, when I am in school.

I guess this could be triggered by time (when I am officially in school), and/or location (when GPS detects I am in vicinity of the school, during school hours).

ysss 2009-09-11 04:18

Re: [User feedback request] Shepherd
 
Sounds like an awesome project!

But the requests list seems to have grown unnecessarily long already.. I think the features list has to be cut really short to cater to the biggest audience first so the development can go swiftly and focused on the core functions intended..

Then implement the rest as plugins\future developments.

Oh, a more descriptive name would help too :D

attila77 2009-09-11 21:59

Re: [User feedback request] Shepherd
 
Quote:

Originally Posted by ysss (Post 325222)
Sounds like an awesome project!
But the requests list seems to have grown unnecessarily long already.. I think the features list has to be cut really short to cater to the biggest audience first so the development can go swiftly and focused on the core functions intended..
Then implement the rest as plugins\future developments.

They're all going to be plugins, anyway, so the least I can do is put placeholders there so people can see the ideas, and join in on implementing them. Most of the ideas outlined here were not THAT difficult to implement (CPU/RAM the easiest and location being probably the most complex). In any case, having some ideas how things might develop in the future makes it easier to avoid inadvertently placing nasty dev roadblocks for future development.

Quote:

Oh, a more descriptive name would help too :D
It's an established fact that I'm bad at naming projects :) It started off as something that you know, herds applications out when the weather is nice and there is grass, takes care they don't run away, and such... hence the shepherd association. Thought it would be lame calling it YASA (yet another scheduling app), Puli would probably also mean nothing to most of of the world... But I'm open to suggestions, at least until the stuff enters extras.

PS. For people too lazy to click on the above link:
http://www.city-data.com/forum/attac...lying-puli.jpg

zerojay 2009-09-11 22:04

Re: [User feedback request] Shepherd
 
Quote:

Originally Posted by attila77 (Post 325599)
It's an established fact that I'm bad at naming projects :) It started off as something that you know, herds applications out when the weather is nice and there is grass, takes care they don't run away, and such... hence the shepherd association. Thought it would be lame calling it YASA (yet another scheduling app), Puli would probably also mean nothing to most of of the world...

"Canola" didn't mean anything to the world either, but that didn't stop it.

qole 2009-09-11 22:36

Re: [User feedback request] Shepherd
 
Canola is a made-up word that was formed from words meaning "Canadian Oil". Why? Well, "rape seed oil" just doesn't have a good sound for marketing.

Why someone chose the word for rape seed oil for their media player is less clear, however.

edgar2 2009-09-11 22:44

Re: [User feedback request] Shepherd
 
feature idea: location and/or time defining what profile gets activated (normal, silent, OUTDOORS, meeting, etc).

i can think of lots of places where i'd love to have my (soon-to-be-in-my-hands) n900 automatically switch to silent :)

Saturn 2009-09-13 23:16

Re: [User feedback request] Shepherd
 
Hi, filled an enhancement request in bugzilla for the the automatic updates thing discussed earlier in the thread.

If you feel like, please give it a vote.

javispedro 2009-09-13 23:26

Re: [User feedback request] Shepherd
 
Have you seen GlovePIE?

I once envisioned a language based on GlovePIE's "declarative"/"eternal while true loop" idea managing from input mapping to a load of events. The syntax was kinda like:

Code:

on (Script.started) {
    $host = Network.Host("192.168.0.2");
}

on ($host.down) {
  System.Reboot();
}

on (Keyboard.Ctrl.Pressed && Keyboard.A.Pressed) {
    Keyboard.B.Pressed = true;
}

Script, Keyboard, System, etc. all pluggable modules.

Unfortunately I only got to the parser before wandering off and pushing it to the bottom of my TODO pile, but if you're looking for ideas.... (even though this one is a geekish). You can use a Python VM too, or just the GUI option and be done with it, but I usually find them lacking unless they're really, really complex, in which case it usually defeats the purpose.

iKneaDough 2009-09-14 00:07

Re: [User feedback request] Shepherd
 
Quote:

Originally Posted by javispedro (Post 326451)
You can use a Python VM too, or just the GUI option and be done with it, but I usually find them lacking unless they're really, really complex, in which case it usually defeats the purpose.

It can be made a hybrid as well, meaning have a nice GUI with some simple tasks preloaded which the user can enable or disable,or add a simple task, and then have an advanced option (or config file), which could get much more complex and granular.

jolouis 2009-09-14 12:58

Re: [User feedback request] Shepherd
 
For the automatic update stuff... This is handled by AlarmD, so it's actually rediculously easy to disable/enable; just remove the event from the alarmD queue, and in its place add a new event that will check against the type of connectivity and only run the updater if wifi is active. Really has nothing to do with shepherd at all, unless you wanted to use shepherd to set a nice flag in gconf/temp file somewhere to indicate when you were on wifi vs anything else?...

i.e. From the alarmD queue right now (/var/lib/alarmd/alarm_queue.xml):
Code:

  <object type="AlarmdEventRecurring">
    <parameter name="action" type="object">
      <object type="AlarmdActionExec">
        <parameter name="flags" type="int">193</parameter>
        <parameter name="title" type="string"/>
        <parameter name="message" type="string"/>
        <parameter name="sound" type="string"/>
        <parameter name="icon" type="string"/>
        <parameter name="path" type="string">/usr/bin/hildon-update-notifier</parameter>
      </object>
    </parameter>
    <parameter name="time" type="int64">1217617165</parameter>
    <parameter name="snooze_interval" type="uint">0</parameter>
    <parameter name="snooze" type="uint">0</parameter>
    <parameter name="cookie" type="long">1217444365</parameter>
    <parameter name="recurr_interval" type="uint">1440</parameter>
    <parameter name="recurr_count" type="int">-1</parameter>
    <parameter name="real_time" type="uint64">1217617165</parameter>
  </object>

So just change the Path entry from "/usr/bin/hildon-update-notifier" to your own custom script that checks whether wifi is active, and only runs accordingly. You'll also have to change the entry later on that actually performs update checks, which is a little further down:

Code:

  <object type="AlarmdEventRecurring">
    <parameter name="action" type="object">
      <object type="AlarmdActionDbus">
        <parameter name="flags" type="int">193</parameter>
        <parameter name="title" type="string"/>
        <parameter name="message" type="string"/>
        <parameter name="sound" type="string"/>
        <parameter name="icon" type="string"/>
        <parameter name="interface" type="string">com.nokia.hildon_update_notifier</parameter>
        <parameter name="service" type="string">com.nokia.hildon_update_notifier</parameter>
        <parameter name="path" type="string">/com/nokia/hildon_update_notifier</parameter>
        <parameter name="name" type="string">check_for_updates</parameter>
        <parameter name="arguments" type="value_array"/>
      </object>
    </parameter>
    <parameter name="time" type="int64">1252944740</parameter>
    <parameter name="snooze_interval" type="uint">0</parameter>
    <parameter name="snooze" type="uint">0</parameter>
    <parameter name="cookie" type="long">1252512740</parameter>
    <parameter name="recurr_interval" type="uint">1440</parameter>
    <parameter name="recurr_count" type="int">-1</parameter>
    <parameter name="real_time" type="uint64">1252944740</parameter>
  </object>

I make no guarantees that this will actually work, but should do... if somebody wants to try it and is having issues/etc or gets it to work then I suggest opening it in a new thread unless it's specifically associated with Shepherd itself as it seems a bit off topic (but still very useful info)

-Rob

attila77 2009-09-14 13:49

Re: [User feedback request] Shepherd
 
@javispedro: have not seen it, thanks for the tip, will take a look

@iKneaDough: it is already a two-component software. The 'daemon' part runs in the background and is controlled by config files. The WiP GUI part is just a front-end for user friendly editing these config files and signaling reload/start/stop to the daemon.

@jolouis: I agree shepherd is not necessary to change how you deal with updates. That said, the lure of using shepherd for such a task is to be able to *easily* combine the action with any vector provided - particular provider, location, etc.

allnameswereout 2009-09-14 17:05

Re: [User feedback request] Shepherd
 
Great idea! :)

attila77 2009-09-17 13:54

Re: [User feedback request] Shepherd
 
Just ran accross this headset thingie... You know where this is going (apart from the end of the already longish todo :) ) - make the headset button perform different tasks depending on shepherd parameters :)

nilchak 2009-09-17 19:15

Re: [User feedback request] Shepherd
 
Quote:

Originally Posted by Saturn (Post 325169)
Could also sent the last known GPS location. Adds also value which later can be used differently. e.g plot in a map your day out.

As long as you can shut it down in SPECIAL CASES ;)

http://geekandpoke.typepad.com/.a/6a...599062a970c-pi

pelago 2009-09-17 20:22

Re: [User feedback request] Shepherd
 
Resize please!

qole 2009-09-22 17:14

Re: [User feedback request] Shepherd
 
Another idea for Shepherd: make your NIT into a WiFi USB host for your N900 (posted here by request):

(Prerequisites: an ad-hoc wifi network set up between the N8x0 and the N900, and a USB OTG adapter for the N8x0)

When you plug a USB device into your N8x0, Shepherd will notice and can ask if you want to start the ad-hoc wifi network. Then, on the N900, when you connect to the ad-hoc network, Shepherd can ask if you want to mount the USB devices from the tablet on your N900 (via sshfs probably), and open the file manager for you.

nymajoak 2009-10-03 01:41

Re: [User feedback request] Shepherd
 
Could it perhaps be interesting to control the desktops based on time or location?

Eg. put all workrelated widgets, links etc on one desktop and have that one switched to when arriving at work. Get another desktop when at home, a third when on the bus in between..

Could save you up to two swipes each time. ;)

nymajoak 2009-10-04 00:12

Re: [User feedback request] Shepherd
 
Could current weather be a reason to trigger an application? I can't think of any other use-cases right now than maybe to trigger a change in wallpaper to one representing the weather, or a notification to bring the umbrella/remember the tanning lotion, but the idea seems somehow... exciting to me.

allnameswereout 2009-10-06 15:39

Re: [User feedback request] Shepherd
 
What if I knew I'd have 30 hours no adapter to charge device.
Would I then not allow certain features, or in general want the device to be a bastard for power, like not allowing LCD to be too bright? Or put LCD off quicker?

What if GPS or network provider is non-flatfree, roaming instead?
Would I then want to disable certain auto fetch stuff? Or enable caching proxy which compresses pictures instead? Lower SIP quality? These are examples for the point here is to have a 'mode' defined by the user which gives 'acceptable quality' but 'takes into account non-flatfree'.

And some things... I have no idea, how much data for example MySpace or Facebook IM extensions use because I don't know how they exactly work. If they don't use an API but use HTTP + HTML and then parse the JS then they're quite 'bloated' so to say.

So, I think, for research purposes, some kind of traffic accounting on user processes is very interesting (much like powertop, htop, iotop for other statistics)

slartibart 2009-10-06 16:25

Re: [User feedback request] Shepherd
 
Some interesting possibilities...

Would the following be possible?

1) Headset connected/disconnected
(I know the NIT can sense this as the icon on the FM-radio player (N800) changes when you connect a headset)
a) When headset inserted, set volume to X
b) When headset removed set volume to Y

2) Application dependent
IF incoming VoiP call, stop all other audio, set audio to X and switch to Skype in full-screen.

lcuk 2009-10-13 12:59

Re: [User feedback request] Shepherd
 
Quote:

Originally Posted by slartibart (Post 340465)
Some interesting possibilities...

Would the following be possible?

1) Headset connected/disconnected
(I know the NIT can sense this as the icon on the FM-radio player (N800) changes when you connect a headset)
a) When headset inserted, set volume to X
b) When headset removed set volume to Y

sounds cool
Quote:


2) Application dependent
IF incoming VoiP call, stop all other audio, set audio to X and switch to Skype in full-screen.
make sure the app you stop is NOT the phone app ;)

aboaboit 2009-11-04 11:05

Re: [User feedback request] Shepherd
 
Quote:

Originally Posted by attila77 (Post 325162)
And since we're on an input frenzy... with a N900 we could also do:
- Light sensor
- Kickstand
- Proxymity sensor

In dmesg I see the slider is gpio 71 but nothing comes up for the kickstand and I am not surprised, considering there is no visible connection inside the case.

kopte3 2009-11-04 21:00

Re: [User feedback request] Shepherd
 
What about changing profiles if phone finds your home/work/school wireless connection?
This way if you come to for ex. work, it searches for wireless connection, finds out that you're on work and changes your profile to silent. When that wireless connection isn't present any more it switches your profile on the one you had before you went to work.
This can work too when you're leaving home and home connection isn't accessible.
It should have infinite modes that user can make.
Here are some ideas for other parameters:
- Time
- Location
- Battery
All the parameters should be mixable. I think this could work for applications too. Sorry if this is too much off topic.:rolleyes:

dtrouton 2009-11-05 12:09

Re: [User feedback request] Shepherd
 
I had a thought on another brainstorm about using bluetooth status for some actions. For example if the device is paired with my car headset and a friend texts I'd like it to send a message to them saying if it's urgent please give me a call, I can't look at messages right now. It could also set the presence status of any IM clients running to say I'm in the car/not available/whatever.

Also if I'm sitting near my laptop with it turned on I might want the phone to behave differently than if I'm watching my media PC (which has bluetooth).

Somone had mentioned locale too, from android, which has a really interesting plugin set up to allow you to do almost anything when certain location based conditions are active. The granularity of location info can be wifi/call tower/GPS or whatever. I can see a lot of stuff being useful off just cell tower info for me. The GPS is such a battery hog I'd be reluctant to use it for many things.


| 1   2     3   | Next | Last
All times are GMT. The time now is 10:45.

vBulletin® Version 3.8.8