Age | Commit message (Collapse) | Author |
|
|
|
|
|
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 fa8b939990ed0648f99b0cbeba4efed807160db3.
|
|
This way cases like
$ slstatus -s > /dev/full
are properly caught and the program terminated with the proper return
code.
|
|
|
|
At the moment linux only, but will add support for OpenBSD as well.
|
|
Thanks to Hiltjo
|
|
Add a return value so we are able to check any errors and actually fail
when there has been a critical error instead of carrying on uselessly.
|
|
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.
|
|
Now only one function, fmt_human, takes an additional argument "base".
|
|
In a later commit something like that will be enabled for every
component
|
|
|
|
|
|
|
|
- Line length
- Spacing and indentation
- No explicit checks for NULL
|
|
|
|
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.
|
|
|
|
|
|
|
|
On some laptops (mostly thinkpads), the remaining time may be
expressed in µWh using energy_now and power_now files rather than µAh
for charge_now and current_now.
Add pick function to conditionally select appropriate one.
|
|
free the interface list before returning from the function
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
These functions take the raw number and a unit and automatically
print it out "scaled down" to a proper SI-prefix, for powers of 2
and 10 respectively.
Apply them to the 2-power cases and keep the 10-power for a later
commit.
|
|
Units should be added to the corresponding numbers
|
|
First dividing by interval before multiplying with 1000 decreases the
precision by +-(interval - 1) * 1000, as interval arithmetic always
applies the Gauß-function to the result.
This is not necessary and simply reordering the operations mitigates
this.
|
|
Within the components, snprintf() was unchecked and had inefficient
calls in some places.
We implement esnprintf() that does all the dirty laundry for us
and use it exclusively now.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
implemented additional error condition for openbsd netstat in case the
interface could not be found in the interface list or if_data is not
readable.
|
|
|
|
|
|
implemented the netspeed functionality for openbsd.
furthermore the static keyword was removed of the interval variable in
config.def.h for usage as extern variable.
|
|
|
|
|
|
|
|
|
|
|