Age | Commit message (Collapse) | Author |
|
ALSA is not a dependency anymore as we use /dev/mixer. The corresponding
notice about PulseAudio is thus not necessary too.
|
|
Replace #ifdef with #if defined() and #elif with #elif defined() as it
should only test if it is defined or not.
|
|
In OpenBSD uptime gets fetched using sysctl now.
|
|
In OpenBSD battery percentage gets fetched using apm now.
|
|
|
|
|
|
|
|
Print unknown_str in case of error
|
|
func can return NULL in case of error, but no checking is done when
printing, and unknown_str wasn't being used anywhere.
|
|
|
|
When an invalid interface name is passed to wifi_essid() it does not
close opened sockets.
|
|
|
|
|
|
Implement basic percentage calculation for wifi_perc. With this
commit, the function returns correct percentage, since the max
of what /proc/net/wireless returns is 70.
|
|
This brings us a lot more tidiness.
|
|
The HDR variable is used for general purpose headers, which are not
given in this project. arg.h and config.h are only needed for
slstatus.c, not every component $(COM:=.c).
This also fixes a problem introduced in
e04a3853643df1c98a451969d515d8850f138bcc, where config.h is pulled into
the tarball.
|
|
|
|
|
|
|
|
|
|
|
|
For multiple reasons the program is now split:
- Make future porting to OpenBSD easier
- Assign header includes to individiual functions
- Make future program extensions easier
- Recompile only changed parts
|
|
setlocale() has to be separated from the signal handling.
|
|
I want my date & time printed according my locale settings.
This commit enables that
Signed-off-by: Kurt Van Dijck <dev.kurt@vandijck-laurijssen.be>
|
|
|
|
This commit introduces the cpu_iowait item, this is the percentage
of cpu time spent waiting on disks. High numbers typically indicate
that your system is not responsive due to disk IO.
This commit also avoid sleeping inside the cpu_perc and cpu_iowait
functions: waiting in either one implies lost info for the other.
Signed-off-by: Kurt Van Dijck <dev.kurt@vandijck-laurijssen.be>
|
|
|
|
|
|
- Renamed "ip" function to "ipv4"
- Added "ipv6" function
- Adjusted README and config.def.h accordingly
|
|
|
|
|
|
This reduces a lot of equivalent code to one function call.
|
|
We remove the hack with the sleep and global "delay"-variable and use a
monotonic clock to derive the desired monotonic properties of the tool.
Inside each function that demands a personal delay we can then just do a
nanosleep() and be done with it.
It's a shame that timespec is so ugly to work with, but there's really
no way to make it more beautiful. However, at this cost though we
finally can set the interval times in milliseconds and not only just
seconds.
We remove setlocale(), because nothing good ever came out of this
function.
Besides that we have some more code refactoring, especially in the
argument loop which saves us a bit of complexity.
|
|
|
|
|
|
|
|
|
|
|
|
According to the FHS, /usr/local/share/man is the correct man page path
in this projects's case. Set this to default in config.mk.
|
|
|
|
Debugging #define is very difficult. The performance overhead of static const
char is negligible.
|
|
Debugging #define, especially in mathematical constructs is very
difficult. The performance overhead of static const int is negligible.
|
|
Extended Ali H. Fardan contribution dates
|
|
|
|
- Added a check for the return value of XOpenDisplay() in main().
This fixes a possible NULL-deref.
- Removed unnsecessary XOpenDisplay and XCloseDisplay from
keyboard_indicators(). The ones in main() are sufficent.
|
|
|
|
|
|
|
|
|
|
What we really want is to either output to WM_NAME or stdout. If we want
just one single line, we do slstatus | head -n 1.
|