Reply
Thread Tools
Posts: 3,319 | Thanked: 5,603 times | Joined on Aug 2008 @ Finland
#1
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 !
 

The Following 82 Users Say Thank You to attila77 For This Useful Post:
zerojay's Avatar
Posts: 2,669 | Thanked: 2,538 times | Joined on Apr 2007 @ Halifax, Nova Scotia, Canada
#2
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.
 

The Following 5 Users Say Thank You to zerojay For This Useful Post:
Posts: 397 | Thanked: 224 times | Joined on May 2007
#3
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.
 

The Following 13 Users Say Thank You to ColdFusion For This Useful Post:
Posts: 3,319 | Thanked: 5,603 times | Joined on Aug 2008 @ Finland
#4
Originally Posted by ColdFusion View Post
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 !

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
 

The Following 4 Users Say Thank You to attila77 For This Useful Post:
tso's Avatar
Posts: 4,783 | Thanked: 1,246 times | Joined on Aug 2007 @ norway
#5
heh, could it be made to control the updates checker so that it only uses wifi?
 

The Following 3 Users Say Thank You to tso For This Useful Post:
Posts: 3,319 | Thanked: 5,603 times | Joined on Aug 2008 @ Finland
#6
Originally Posted by zerojay View Post
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
 
Posts: 3,319 | Thanked: 5,603 times | Joined on Aug 2008 @ Finland
#7
Originally Posted by tso View Post
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's Avatar
Posts: 1,589 | Thanked: 1,935 times | Joined on Mar 2007 @ UNKLE's Never Never Land
#8
Originally Posted by attila77 View Post
...
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.

Originally Posted by attila77 View Post
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)?
 

The Following 2 Users Say Thank You to Saturn For This Useful Post:
Posts: 2,803 | Thanked: 4,469 times | Joined on Nov 2007
#9
Other possible vectors: CPU load, RAM/SWAP usage, network load. Maybe contextkit integration down the line.
 

The Following 2 Users Say Thank You to lma For This Useful Post:
qole's Avatar
Moderator | Posts: 7,094 | Thanked: 8,643 times | Joined on Oct 2007 @ Vancouver, BC, Canada
#10
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...
__________________
qole.org --- twitter --- Easy Debian wiki page
Please don't send me a private message, post to the appropriate thread.
Thank you all for your donations!
 

The Following 5 Users Say Thank You to qole For This Useful Post:
Reply

Tags
cron, power save, scheduling, shepherd

Thread Tools

 
Forum Jump


All times are GMT -4. The time now is 05:26 AM.