|
2013-01-09
, 14:53
|
Posts: 498 |
Thanked: 836 times |
Joined on Jun 2012
@ Finland
|
#462
|
|
2013-01-09
, 15:18
|
|
Posts: 118 |
Thanked: 20 times |
Joined on May 2012
@ INDIA
|
#463
|
|
2013-01-09
, 16:44
|
Moderator |
Posts: 6,215 |
Thanked: 6,400 times |
Joined on Nov 2011
|
#464
|
#!/bin/sh # lshal command thanks to joerg_rw # status=$(lshal | grep -v grep | grep battery.charge_level.percentage | awk '{print $3}' | head -1) if [[ $status -ge 30 ]] then echo {{green}} $status % else echo {{red}} $status % fi
The Following User Says Thank You to thedead1440 For This Useful Post: | ||
|
2013-01-09
, 18:24
|
Posts: 44 |
Thanked: 20 times |
Joined on May 2012
|
#465
|
|
2013-01-09
, 20:49
|
Posts: 498 |
Thanked: 836 times |
Joined on Jun 2012
@ Finland
|
#467
|
Maybe you want something like this:
It will echo for example as 75 % in green and 29 % in redCode:#!/bin/sh # lshal command thanks to joerg_rw # status=$(lshal | grep -v grep | grep battery.charge_level.percentage | awk '{print $3}' | head -1) if [[ $status -ge 30 ]] then echo {{green}} $status % else echo {{red}} $status % fi
|
2013-01-09
, 21:34
|
Posts: 87 |
Thanked: 14 times |
Joined on Jan 2012
|
#468
|
Thanks again for this Thedead!
I am, however, doing something wrong as Billboard is not giving anything with this script. I ran it in terminal and it did give the battery status there. But when save it as battery.py to /home/user and write to billboard {script:/home/user/battery.py} there is nothing as an output.
|
2013-01-09
, 21:46
|
Posts: 498 |
Thanked: 836 times |
Joined on Jun 2012
@ Finland
|
#469
|
|
2013-01-10
, 04:43
|
Moderator |
Posts: 6,215 |
Thanked: 6,400 times |
Joined on Nov 2011
|
#470
|
Yes, I noticed that also. But even though I tried with .sh, I still could't get it to work
Is it ok to make it with notepad and save em with UTF-8 coding? Am I doing something wrong there?
Telegram | Openrepos | GitHub | Revolut donations