I did check it yesterday. and yeah you should add the backlight.c in
components directory.
On 30/03, Ryan wrote:
> I just tested the patch again against master, works for me. You sure you
> tested it against slstatus master?
>
> On Fri, Mar 29, 2019 at 10:34 PM Abdullah <abdullah_AT_abdullah.today> wrote:
>
> > No such file or directory, backlight.o
> > This error comes after applying this patch.
> >
> > On 29/03, Ryan Kes wrote:
> > > ---
> > > Makefile | 1 +
> > > components/backlight.c | 36 ++++++++++++++++++++++++++++++++++++
> > > config.def.h | 1 +
> > > slstatus.h | 3 +++
> > > 4 files changed, 41 insertions(+)
> > > create mode 100644 components/backlight.c
> > >
> > > diff --git a/Makefile b/Makefile
> > > index 945b5e3..28a205f 100644
> > > --- a/Makefile
> > > +++ b/Makefile
> > > _AT_@ -6,6 +6,7 @@ include config.mk
> > >
> > > REQ = util
> > > COM =\
> > > + components/backlight\
> > > components/battery\
> > > components/cpu\
> > > components/datetime\
> > > diff --git a/components/backlight.c b/components/backlight.c
> > > new file mode 100644
> > > index 0000000..fcc062a
> > > --- /dev/null
> > > +++ b/components/backlight.c
> > > _AT_@ -0,0 +1,36 @@
> > > +/* See LICENSE file for copyright and license details. */
> > > +#include <stdio.h>
> > > +#include <string.h>
> > > +
> > > +#include "../util.h"
> > > +
> > > +#if defined(__linux__)
> > > + #include <limits.h>
> > > + #include <stdint.h>
> > > + #include <unistd.h>
> > > +
> > > + const char *
> > > + backlight_perc(const char *backlight)
> > > + {
> > > + float value;
> > > + char path[PATH_MAX];
> > > +
> > > + if (esnprintf(path, sizeof(path),
> > > +
> > "/sys/class/backlight/%s/actual_brightness", backlight) < 0) {
> > > + return NULL;
> > > + }
> > > + if (pscanf(path, "%f", &value) != 1) {
> > > + return NULL;
> > > + }
> > > +
> > > + return bprintf("%d", (int)(value / 852 * 100));
> > > + }
> > > +
> > > +#else
> > > + const char *
> > > + backlight_perc(const char *backlight)
> > > + {
> > > + return NULL;
> > > + }
> > > +
> > > +#endif
> > > diff --git a/config.def.h b/config.def.h
> > > index e06be66..d0996ef 100644
> > > --- a/config.def.h
> > > +++ b/config.def.h
> > > _AT_@ -12,6 +12,7 @@ static const char unknown_str[] = "n/a";
> > > /*
> > > * function description argument
> > (example)
> > > *
> > > + * backlight_perc backlight percentage backlight name
> > (intel_backlight)
> > > * battery_perc battery percentage battery name
> > (BAT0)
> > > * NULL on
> > OpenBSD/FreeBSD
> > > * battery_state battery charging state battery name
> > (BAT0)
> > > diff --git a/slstatus.h b/slstatus.h
> > > index 08f610a..d9c0b5f 100644
> > > --- a/slstatus.h
> > > +++ b/slstatus.h
> > > _AT_@ -1,5 +1,8 @@
> > > /* See LICENSE file for copyright and license details. */
> > >
> > > +/* backlight */
> > > +const char *backlight_perc(const char *backlight);
> > > +
> > > /* battery */
> > > const char *battery_perc(const char *);
> > > const char *battery_state(const char *);
> > > --
> > > 2.21.0
> > >
> > >
> >
> >
> > A K
> > https://abdullah.today
> > 69C8 7720 E507 86DF 1D85
> > EA5E FC59 7891 5CBC 7BC7
> >
> >
> >
A K
https://abdullah.today
69C8 7720 E507 86DF 1D85
EA5E FC59 7891 5CBC 7BC7
Received on Sat Mar 30 2019 - 15:58:50 CET