I made a mistake while reading the Posix spec. In fact, the implicit
prerequisite imposed by the .c.o-rule is evaluated as expected, even if
the .c is not given in the target rule.
This partially reverts 0efd64ffaa.
This drops a lot of code and even though we are using a common function,
the specification of only the needed things keeps it very efficient and
even more efficient in memory and time than the previous solution.
There was a long tinkering process at farbfeld about this, but the sad
truth is that it's the only way to make the Makefile truly portable.
Listing it just as
$(COM:=.o): config.mk $(REQ:=.h)
omits the dependency on the c-file itself, which incurs that strictly
speaking the object file is not depending on the source file, which is
nonsense.
You don't see strictly Posix compliant Makefiles around very often and
most use nasty GNU-extensions everywhere. It is a good idea to go ahead
as a fitting example and show how to write them portably.
On OpenBSD the backlight percentage cannot be retrieved in a simple way.
The only two solutions we are aware of for now are:
- reading from /dev/ttyC0: which isn't possible without changing
permissions or running slstatus as root
- linking against xcb-xrandr: which is bloat and does not work in every
case appearently
This reverts commit 37724ac2c3 for now.
- Get rid of camel-casing
- Don't use all-caps for variable names
- use LEN()-macro
- use strncmp() rather than strstr() for prefix-checking
- clean up the tokenizer-loop and don't use copies
- make the loop more readable by separating different breaking
conditions
- stricter error-checking and cleanup
- store the layout directly with bprintf rather than having
a separate buffer
Adding a new keymap component that will
indicate the current keyboard layout (language)
and variant if any was set. I use the
standard X11 XKB APIs to retrieve and parse
the xkb_symbols set with setxkbmap.
Even if we extend the flag to be an n-flag with a numerical input, we
already have other Unix-tools to take care of us much more flexibly,
e.g. with head(1) you can easily get the first 10 outputs with
slstatus -s | head -n 10,
but also e.g. discard the first one and then get the consecutive 10
outputs.
For the X11-root-window-name, you can limit the runtime with timeout(1)
or a comparable solution.
This reverts commit fa8b939990.
It is not necessary to copy memory or anything. Just keep a pointer to
the active prefix-array and assign the length of the arrays to a
variable.
Make the code more readable by using a switch, be more strict when an
invalid base is passed to it and fix a small oversight in the bottom of
the code where the base 1024 was forgotten to generalized.
This is a first step to decouple formatting from information because of
two reasons:
1. The components should only gather and return the values by design
2. Fine grained user control should be a focus
Scaling will be implemented in a different way in a later commit.