Aaron Marcher
74c4f4ebda
Add the percent sign to *_perc functions
Units should be added to the corresponding numbers
pirms 6 gadiem
Laslo Hunhold
68a3902dc5
Increase precision in netspeeds.c
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.
pirms 6 gadiem
Laslo Hunhold
422cadfd5f
Implement esnprintf() and make formatted calls more efficient
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.
pirms 6 gadiem
Aaron Marcher
f31b113e7e
Simplify ipv* functions
pirms 6 gadiem
Aaron Marcher
d47d78255e
Use `int` for flags
pirms 6 gadiem
Aaron Marcher
74891945d8
Revert aac29e2
as it is nonsense
pirms 6 gadiem
Aaron Marcher
06d4447f03
Set {r,t}xbytes 0 before incrementing them on OBSD
pirms 6 gadiem
Aaron Marcher
a37224bf7b
Missing assignment for last commit
pirms 6 gadiem
Aaron Marcher
e3ccac3298
Unify and simplify netspeed logic and types
pirms 6 gadiem
Tobias Tschinkowitz
2321aecff0
netspeeds: added error condition for openbsd
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.
pirms 6 gadiem
Aaron Marcher
0383146e5e
uptime: Format function is static
pirms 6 gadiem
Aaron Marcher
aac29e2bba
battery: Move out struct as common code
pirms 6 gadiem
Tobias Tschinkowitz
22175f0d57
implemented openbsd netspeed functions
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.
pirms 6 gadiem
Aaron Marcher
0d05b3d13d
Add network speed functions
pirms 6 gadiem
Aaron Marcher
d0c68989cd
Implement fmt_scaled for ram_* functions
pirms 6 gadiem
Aaron Marcher
49d1e5fae2
Fix ram_free for Linux
pirms 6 gadiem
Aaron Marcher
39ee31c242
Implement fmt_scaled for swap_* functions
pirms 6 gadiem
Aaron Marcher
b3e56066ed
Implement fmt_scaled for disk_* functions
pirms 6 gadiem
Aaron Marcher
f317819984
Use %d instead of accidentally %i
pirms 6 gadiem
Aaron Marcher
f170028527
Port battery_remaining to Linux
Additionally unify the format of battery_state and uptime
pirms 6 gadiem
Aaron Marcher
b04ca3ef45
Fix memory leak
pirms 6 gadiem
Tobias Tschinkowitz
367f8a8c44
battery: fixed remaining time on connected AC
when an AC is connected apm_info shows a non-valid value for remaining
minutes. it was decided that in that case the function should return an
empty string.
pirms 6 gadiem
Aaron Marcher
2604f25b16
Fix indentation
Tabs for indentation, spaces for alignment
pirms 6 gadiem
Tobias Tschinkowitz
8c8326f793
Add battery_remaining function on OpenBSD
Implementation of a battery_remaining function which returns the
remaining battery time in HH:MM format. Linux function still needs
implementation.
Move common code to load_apm_power_info
pirms 6 gadiem
Laslo Hunhold
80fc20d1d6
Add warn() and die()
Given slstatus is a tool that runs in the background, most likely run
from .xinitrc, it's important to prepend the name of the tool to error
messages so it becomes clear where the error is coming from.
To make this much more consistent, this commit adds warn() and die()
utility functions consistent with other suckless projects and adapts all
calls to fprintf(stderr, *) to the warn() and die() functions, greatly
increasing the readability of the code.
pirms 6 gadiem
Aaron Marcher
b759662983
Remove UNUSED macro
Use variables named unused instead which is simpler
pirms 6 gadiem
Aaron Marcher
fc8b6f81a5
Mark unused parameters, fix compiler warnings
pirms 6 gadiem
Aaron Marcher
977be0cf4f
wifi: Fix order and add missing header
<sys/select.h> is needed before <net80211/ieee80211_ioctl.h> on OpenBSD
to define NBBY and shut up compiler warnings.
pirms 6 gadiem
Aaron Marcher
ca8a146f03
wifi: Change memmove to memcpy on OpenBSD
pirms 6 gadiem
Aaron Marcher
7ab183c97f
Unify type of in for loops
pirms 6 gadiem
Aaron Marcher
1c44d404f6
wifi_essid: Fix coding style
Only initialize variables at the beginning of a block
pirms 6 gadiem
Aaron Marcher
7be675f154
Unify type of `i` in for loops
int for normal indexes
size_t for usage with the LEN macro
pirms 6 gadiem
Tobias Tschinkowitz
0f46c675d3
corrected calculations for disk space on openbsd
pirms 6 gadiem
Aaron Marcher
bb61392386
wifi: Fix coding style
Use block for single statement ifs
When functions return -1 for error test against 0 not -1
Newlines
pirms 6 gadiem
Aaron Marcher
9d967498be
load_ieee80211_nodereq: Fix typo
pirms 6 gadiem
Aaron Marcher
f3c23f08bb
wifi: Move out common headers
pirms 6 gadiem
Tobias Tschinkowitz
1fc5cf0016
added wifi functionality for openbsd
display ESSID and signal strength percentage
pirms 6 gadiem
Tobias Tschinkowitz
c1f79d741a
corrected calculation for swap on openbsd
The swapctl(2) function fills the swapent struct with 512KB blocks.
As we want to display in GB, i just modified the calculation for this to
get the expected output.
pirms 6 gadiem
Tobias Tschinkowitz
82eb6e3832
consistent calculation of ram_* on openbsd
pirms 6 gadiem
Tobias Tschinkowitz
0f9a1a8367
updated ram_total and ram_free (obsd)
pirms 6 gadiem
Aaron Marcher
6464cea333
Cast CPU percentage to int and fix indenation
pirms 6 gadiem
Josuah Demangeon
ea2e2bd004
include <sys/time.h> before <sys/sensors.h> for time struct timeval
sys/sensors.h has two structs struct timeval: sensor and ksensor:
struct sensor {
...
struct timeval tv; /* sensor value last change time */
...
};
pirms 6 gadiem
Aaron Marcher
6123f482e3
Fix indents (spaces for alignment)
pirms 6 gadiem
Aaron Marcher
6c6c144be6
wifi_perc: Simplify
pirms 6 gadiem
Aaron Marcher
0a287616b2
num_files: Variable declarations at top of block
pirms 6 gadiem
Aaron Marcher
dcffaeaf57
Fix disk_perc by casting it to int
pirms 6 gadiem
Aaron Marcher
4fc4983502
disk_perc: Simplify
pirms 6 gadiem
Aaron Marcher
b3330d849d
cpu: Simplify functions
pirms 6 gadiem
Aaron Marcher
16a97fbca1
Unify header includes
- Sort Alphabetically
- Same indentation for preprocessor clauses
pirms 6 gadiem
Aaron Marcher
fbbe300f4d
entropy: Small fix
pirms 6 gadiem