Tiny Core Base > CorePlus

Battery monitor or icon?

<< < (4/6) > >>

Juanito:
No rush  :)

That's fine by me, @curaga?

In the meantime, updated watcher posted to the CorePure64-10.x repo

curaga:
Yeah I'll take that patch.

Rich:
Hi Juanito & curaga
Premature error messages have been removed and an updated package has been sent to tcesubmit. A patch called
watcher2.patch (the old watcher.patch from Sept 1, 2017 was never deleted)  has been uploaded to:
http://patches.tinycorelinux.net/

This is what it looks like:

--- Code: ------ watcher.cxx.old 2019-01-30 08:55:54.945634735 +0000
+++ watcher.cxx 2019-01-30 08:57:32.015633230 +0000
@@ -7,6 +7,16 @@
 // wmbluemem :)
 // Thank You Mihai Drãghicioiu
 
+// Jan 30, 2019 v1.10.1 by Rich
+// Removed 2 error messages from batcheckup() because they were not errors yet.
+
+// Jan 29, 2019 v1.10 by Rich
+// Compiled in the energy patch that was added on Sep 1, 2017
+// Added parameter assignment to parser() to shut up compiler unused parameter warning.
+
+// Nov 22, 2014 v1.9
+// Rebuilt with FLTK 1.3
+
 // v1.8: update battery support for linux 3.0
 
 // Changes from Softwaregurl:
@@ -21,7 +31,7 @@
 #include <string.h>
 #include <stdlib.h>
 
-static const char version[] = "1.9";
+static const char version[] = "1.10.1";
 
 static float timeout = 1.5, mem = 0, swap = 0, cpu = 0, used = 0, oldused = 0,
  cputotal = 0, oldcputotal = 0;
@@ -37,7 +47,6 @@
  sprintf(longpath, "/sys/class/power_supply/%s/energy_now", batname);
  if ((batinfo = fopen(longpath, "r")) == NULL)
  {
- fprintf(stderr, "Error opening batinfo %s\n", longpath);
  sprintf(longpath, "/sys/class/power_supply/%s/charge_now", batname);
  if ((batinfo = fopen(longpath, "r")) == NULL)
  {
@@ -51,7 +60,6 @@
  sprintf(longpath, "/sys/class/power_supply/%s/energy_full", batname);
  if ((batinfo = fopen(longpath, "r")) == NULL)
  {
- fprintf(stderr, "Error opening batinfo %s\n", longpath);
  sprintf(longpath, "/sys/class/power_supply/%s/charge_full", batname);
  if ((batinfo = fopen(longpath, "r")) == NULL)
  {
@@ -184,6 +192,7 @@
 }
 
 static int parser(int argc, char **argv, int &z) {
+ argc=argc; // Added to shut up compiler unused parameter warning.
  if (strcmp(argv[z], "-h") == 0) {
  printf("Watcher %s\n"
         "(C) Curaga\n"
--- End code ---

@Juanito: Maybe add an options hint similar to this to the CorePure64 watcher.tcz.info file:

--- Code: --- To start watcher on X start, add to .xsession:
[ $(which watcher) ] && watcher -g +0-0 &
-
For more options, run  watcher -h
--- End code ---

curaga:
Applied except the argc assignment, I find that ugly. Thanks!

I see the patch cron job hadn't been updated with the server change to nginx and corresponding script update. Updated now.

Rich:
Hi curaga

--- Quote from: curaga on January 30, 2019, 12:46:48 PM ---Applied except the argc assignment, I find that ugly. Thanks! ...
--- End quote ---
I've been bitten in the past where I became complacent with the same handful of harmless warnings showing up during compilation
and not noticing an extra warning that caused a problem. As a result, I usually try to make the compiler happy and add comments
indicating such. As I'm sure you are aware, the compiler is smart enough to optimize out that assignment.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version