The Following 3 Users Say Thank You to Fuzzillogic For This Useful Post: | ||
|
2013-08-14
, 20:28
|
|
Posts: 6,436 |
Thanked: 12,699 times |
Joined on Nov 2011
@ Ängelholm, Sweden
|
#2
|
The Following User Says Thank You to coderus For This Useful Post: | ||
|
2013-08-14
, 20:45
|
|
Posts: 645 |
Thanked: 519 times |
Joined on Apr 2012
@ Finland
|
#3
|
|
2013-08-14
, 21:00
|
|
Posts: 63 |
Thanked: 19 times |
Joined on May 2012
|
#4
|
|
2013-08-14
, 21:10
|
|
Posts: 6,436 |
Thanked: 12,699 times |
Joined on Nov 2011
@ Ängelholm, Sweden
|
#5
|
|
2013-08-14
, 21:15
|
|
Posts: 645 |
Thanked: 519 times |
Joined on Apr 2012
@ Finland
|
#6
|
|
2013-08-15
, 16:35
|
Posts: 479 |
Thanked: 1,284 times |
Joined on Jan 2012
@ Enschede, The Netherlands
|
#7
|
The Following User Says Thank You to Fuzzillogic For This Useful Post: | ||
|
2013-08-15
, 17:41
|
|
Posts: 645 |
Thanked: 519 times |
Joined on Apr 2012
@ Finland
|
#8
|
The Following User Says Thank You to Mikkosssss For This Useful Post: | ||
|
2013-08-15
, 20:35
|
|
Posts: 645 |
Thanked: 519 times |
Joined on Apr 2012
@ Finland
|
#9
|
#!/bin/sh if ps aux | grep '[p]ython cpumonled.py'; then killall python echo Killed else nohup python /home/user/Asd/cpumonled.py echo Running fi
|
2013-08-15
, 21:58
|
Posts: 479 |
Thanked: 1,284 times |
Joined on Jan 2012
@ Enschede, The Netherlands
|
#10
|
Usage:
Ctrl+c aborts the script. You can also call it using "nohup python cpumonled.py". You can then close the terminal and the script will run in background. Use "killall python" later to kill it.
It works fine, and it uses very little CPU itself. Also, I reckon it uses very little energy as well, as the led is mostly dark.
But.. I'm looking for a way to make an indicator for actual power consumption. As such I would need to obtain the current... eh.. current, much like energy profiler and battery usage monitor. But I don't know where to get that data (let alone getting it using Python..) Anyone any pointers?
Also, it would be nice if the script runs without root. Is there a way to control the led as user?