Aaron Marcher [Thu, 17 May 2018 18:05:57 +0000 (20:05 +0200)]
Remove UNUSED macro
Use variables named unused instead which is simpler
Aaron Marcher [Thu, 17 May 2018 16:29:25 +0000 (18:29 +0200)]
Mark unused parameters, fix compiler warnings
Aaron Marcher [Thu, 17 May 2018 16:14:08 +0000 (18:14 +0200)]
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.
Aaron Marcher [Thu, 17 May 2018 16:08:31 +0000 (18:08 +0200)]
wifi: Change memmove to memcpy on OpenBSD
Aaron Marcher [Thu, 17 May 2018 16:05:38 +0000 (18:05 +0200)]
Unify type of in for loops
Aaron Marcher [Thu, 17 May 2018 15:59:05 +0000 (17:59 +0200)]
wifi_essid: Fix coding style
Only initialize variables at the beginning of a block
Aaron Marcher [Thu, 17 May 2018 15:40:11 +0000 (17:40 +0200)]
Unify type of `i` in for loops
int for normal indexes
size_t for usage with the LEN macro
Aaron Marcher [Thu, 17 May 2018 15:28:32 +0000 (17:28 +0200)]
Change done to int as it is the CPU's natural type
Aaron Marcher [Thu, 17 May 2018 15:25:31 +0000 (17:25 +0200)]
Change interval to unsigned int
Aaron Marcher [Thu, 17 May 2018 15:24:47 +0000 (17:24 +0200)]
Add comments for battery_* functions on OpenBSD
Tobias Tschinkowitz [Thu, 17 May 2018 11:19:29 +0000 (13:19 +0200)]
added comment for temp function (openbsd)
Tobias Tschinkowitz [Thu, 17 May 2018 10:43:21 +0000 (12:43 +0200)]
corrected calculations for disk space on openbsd
Aaron Marcher [Wed, 16 May 2018 21:19:33 +0000 (23:19 +0200)]
Update README
Aaron Marcher [Wed, 16 May 2018 21:17:30 +0000 (23:17 +0200)]
wifi: Fix coding style
Use block for single statement ifs
When functions return -1 for error test against 0 not -1
Newlines
Aaron Marcher [Wed, 16 May 2018 21:08:33 +0000 (23:08 +0200)]
load_ieee80211_nodereq: Fix typo
Aaron Marcher [Wed, 16 May 2018 20:57:13 +0000 (22:57 +0200)]
wifi: Move out common headers
Tobias Tschinkowitz [Wed, 16 May 2018 20:37:43 +0000 (22:37 +0200)]
added wifi functionality for openbsd
display ESSID and signal strength percentage
Tobias Tschinkowitz [Wed, 16 May 2018 11:26:34 +0000 (13:26 +0200)]
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.
Tobias Tschinkowitz [Wed, 16 May 2018 07:57:38 +0000 (09:57 +0200)]
consistent calculation of ram_* on openbsd
Aaron Marcher [Wed, 16 May 2018 06:13:09 +0000 (08:13 +0200)]
Add he4d to LICENSE
Tobias Tschinkowitz [Tue, 15 May 2018 22:45:41 +0000 (00:45 +0200)]
updated ram_total and ram_free (obsd)
Aaron Marcher [Mon, 14 May 2018 18:54:48 +0000 (20:54 +0200)]
Cast CPU percentage to int and fix indenation
Josuah Demangeon [Tue, 8 May 2018 13:13:56 +0000 (15:13 +0200)]
fflush(stdout) to print line by line if stdout is not a tty
To reproduce the issue:
$ slstatus -s | tee
then it would print only when the stdout buffer is full, by block
of multiple lines.
fflush() makes sure the line is printed at every loop iteration
Aaron Marcher [Tue, 8 May 2018 13:06:55 +0000 (15:06 +0200)]
Add josuah to LICENSE
Josuah Demangeon [Tue, 8 May 2018 11:42:17 +0000 (13:42 +0200)]
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 */
...
};
Aaron Marcher [Mon, 7 May 2018 13:57:32 +0000 (15:57 +0200)]
Only variable declarations at top of block
Aaron Marcher [Mon, 7 May 2018 11:48:43 +0000 (13:48 +0200)]
Fix indents (spaces for alignment)
Aaron Marcher [Mon, 7 May 2018 10:25:34 +0000 (12:25 +0200)]
wifi_perc: Simplify
Aaron Marcher [Mon, 7 May 2018 10:17:13 +0000 (12:17 +0200)]
num_files: Variable declarations at top of block
Aaron Marcher [Mon, 7 May 2018 10:14:46 +0000 (12:14 +0200)]
Fix disk_perc by casting it to int
Aaron Marcher [Mon, 7 May 2018 09:44:15 +0000 (11:44 +0200)]
disk_perc: Simplify
Aaron Marcher [Mon, 7 May 2018 09:39:59 +0000 (11:39 +0200)]
cpu: Simplify functions
Aaron Marcher [Mon, 7 May 2018 09:21:59 +0000 (11:21 +0200)]
Unify header includes
- Sort Alphabetically
- Same indentation for preprocessor clauses
Aaron Marcher [Sun, 6 May 2018 21:09:36 +0000 (23:09 +0200)]
entropy: Small fix
Aaron Marcher [Sun, 6 May 2018 20:54:32 +0000 (22:54 +0200)]
entropy: Port to OpenBSD
OpenBSD's entropy design is superior to Linux.
Aaron Marcher [Sun, 6 May 2018 20:41:56 +0000 (22:41 +0200)]
datetime: Add <stdio.h> for fprintf
Aaron Marcher [Sun, 6 May 2018 20:38:29 +0000 (22:38 +0200)]
datetime: Add error message
Aaron Marcher [Sun, 6 May 2018 20:28:56 +0000 (22:28 +0200)]
Fix coding style
- Use block for single statement ifs
- Keep lines to reasonable length (current debate as to reasonable)
- When functions return -1 for error test against 0 not -1
- Do not indent cases another level
- Do not test against NULL and 0 explicitly
- Use tabs for indentation, use spaces for alignment
Aaron Marcher [Sun, 6 May 2018 19:11:50 +0000 (21:11 +0200)]
Remove cpu_iowait
The third value from load_avg (idle) gives us almost the same
information as cpu_iowait. Plus OpenBSD does not offer an iowait value
as Linux and thus the corresponding function would not be portable.
Aaron Marcher [Sun, 6 May 2018 19:10:02 +0000 (21:10 +0200)]
cpu_perc: Documentation and readbility improvements
Aaron Marcher [Sun, 6 May 2018 15:48:37 +0000 (17:48 +0200)]
cpu_perc: Port to OpenBSD
In OpenBSD the CPU usage in percent is now computed using KERN_CPTIME
sysctl.
Aaron Marcher [Sat, 5 May 2018 23:20:46 +0000 (01:20 +0200)]
swap_*: Port to OpenBSD
Aaron Marcher [Fri, 4 May 2018 16:04:53 +0000 (18:04 +0200)]
battery: Remove full indicator
It does not respect charging thresholds and it is not trivial to
implement the indicator in OpenBSD.
Aaron Marcher [Wed, 2 May 2018 17:41:53 +0000 (19:41 +0200)]
wifi_perc: Fix file descriptor leak
Aaron Marcher [Wed, 2 May 2018 10:30:16 +0000 (12:30 +0200)]
Add examples to config.def.h
Aaron Marcher [Wed, 2 May 2018 10:08:54 +0000 (12:08 +0200)]
uptime: Add missing brace
parazyd [Wed, 2 May 2018 09:38:27 +0000 (11:38 +0200)]
volume: Cast SOUND_MIXER_READ_DEVMASK to int to avoid warning.
Aaron Marcher [Wed, 2 May 2018 06:49:06 +0000 (08:49 +0200)]
wifi: Various cleanups
Aaron Marcher [Wed, 2 May 2018 06:42:55 +0000 (08:42 +0200)]
user: Only declare variables in the beginning
Aaron Marcher [Wed, 2 May 2018 06:41:06 +0000 (08:41 +0200)]
uptime: Simplifiy and clean up
Aaron Marcher [Wed, 2 May 2018 06:29:36 +0000 (08:29 +0200)]
run_command: Clean up
Aaron Marcher [Wed, 2 May 2018 06:26:23 +0000 (08:26 +0200)]
keyboard_indicators: Clean up opening display
Aaron Marcher [Wed, 2 May 2018 06:21:32 +0000 (08:21 +0200)]
ip: Sort headers alphabetically
Aaron Marcher [Wed, 2 May 2018 06:16:21 +0000 (08:16 +0200)]
battery_state: Unify unknown state with "?" symbol
Aaron Marcher [Tue, 1 May 2018 19:05:50 +0000 (21:05 +0200)]
Update README todo
Aaron Marcher [Tue, 1 May 2018 19:01:25 +0000 (21:01 +0200)]
Remove battery_power for various reasons
- Battery power cannot be easily gatherable via apm(4)
- IMHO it does not represent essential information
Laslo Hunhold [Tue, 1 May 2018 18:50:53 +0000 (20:50 +0200)]
Tweak build system a little bit
Be consistent with brackets and add a comment for OpenBSD to make it
clearer what the actual intent of the uncommented line is.
In the Makefile, add a dependency of slstatus.o from config.mk.
Aaron Marcher [Tue, 1 May 2018 18:45:29 +0000 (20:45 +0200)]
battery_perc: Port to OpenBSD
Laslo Hunhold [Tue, 1 May 2018 18:20:58 +0000 (20:20 +0200)]
components/swap.c | move duplicated code to separate function
Laslo Hunhold [Tue, 1 May 2018 17:01:22 +0000 (19:01 +0200)]
Use indentation to increase readability
Granted, this style is definitely not common, but for the short
utility-functions of this program it's just the right choice. This
provides great flexibility, such that in the long run, it will be
possible to also share code between the OS-implementations.
This also keeps the state-keeping at a minimum and makes it clearer
which functions are implemented on which OS without having to jiggle
around with too many files in the process.
Laslo Hunhold [Tue, 1 May 2018 16:10:39 +0000 (18:10 +0200)]
Revert component-split
this reverts the commits from
92ab9ef52ebcb097add97d9f78e67ad1c1d6a6ec up to
d42870d6ca7fb587b38f8cf6d6821ae33a53a696.
After heavy consideration, the component split has more disadvantages
than advantages, especially given there will be utility-functions
sharing quite a lot of code that would then need to be duplicated, as it
does not fit into the util.c due to its speciality.
One big advantage of the component-wise build is readability, and
without doubt, this was achieved here. This point will be addressed
with a different approach that will be visible in the upcoming commits.
One big disadvantage of the component build is the fact that it
introduces state to the build process which is not necessary. Before its
introduction, the only influencing factors where the system-defines
__linux__ and __OpenBSD__. With the components, we are also relying on
the output of uname(1).
Additionally, if the os.mk is not present, make gives the output
$ make
Makefile:5: os.mk: No such file or directory
make: *** No rule to make target 'os.mk'. Stop.
This could easily be fixed by providing some sort of meta-rule for this
file, however, it indicates the problem we have here, and this entire
statefulness will heavily complicate packaging of this tool and makes
the build process much more complex than it actually has to be.
Quentin Rameau [Mon, 30 Apr 2018 14:14:05 +0000 (16:14 +0200)]
Makefile: add distclean target
Quentin Rameau [Mon, 30 Apr 2018 14:13:12 +0000 (16:13 +0200)]
Makefile: move OS-specific libs to configure script
Quentin Rameau [Mon, 30 Apr 2018 14:11:45 +0000 (16:11 +0200)]
Makefile: separate default flags from user flags
Aaron Marcher [Mon, 30 Apr 2018 13:44:41 +0000 (15:44 +0200)]
Update LICENSE for Quentin Rameau
Quentin Rameau [Mon, 30 Apr 2018 13:14:39 +0000 (15:14 +0200)]
wifi: OS split
Quentin Rameau [Mon, 30 Apr 2018 13:14:38 +0000 (15:14 +0200)]
uptime: OS split
Quentin Rameau [Mon, 30 Apr 2018 13:14:37 +0000 (15:14 +0200)]
temperature: OS split
Quentin Rameau [Mon, 30 Apr 2018 13:14:36 +0000 (15:14 +0200)]
swap: OS split
Quentin Rameau [Mon, 30 Apr 2018 13:14:35 +0000 (15:14 +0200)]
ram: OS split
Quentin Rameau [Mon, 30 Apr 2018 13:14:34 +0000 (15:14 +0200)]
entropy: OS split
Quentin Rameau [Mon, 30 Apr 2018 13:14:33 +0000 (15:14 +0200)]
cpu: OS split
Quentin Rameau [Mon, 30 Apr 2018 13:14:32 +0000 (15:14 +0200)]
battery: OS split
Quentin Rameau [Mon, 30 Apr 2018 13:14:31 +0000 (15:14 +0200)]
Makefile: detect running OS
Aaron Marcher [Mon, 30 Apr 2018 11:20:24 +0000 (13:20 +0200)]
cpu_freq: Port to OpenBSD
In OpenBSD CPU frequency gets fetched using sysctl now.
Aaron Marcher [Sun, 29 Apr 2018 20:44:09 +0000 (22:44 +0200)]
Fix typo in temperature
Aaron Marcher [Sun, 29 Apr 2018 20:33:15 +0000 (22:33 +0200)]
Update README for OpenBSD build
Aaron Marcher [Sun, 29 Apr 2018 18:07:09 +0000 (20:07 +0200)]
uptime: Separate function for readbility
Aaron Marcher [Sun, 29 Apr 2018 18:02:42 +0000 (20:02 +0200)]
battery: Separate function for readbility
Aaron Marcher [Sun, 29 Apr 2018 18:00:38 +0000 (20:00 +0200)]
ram: Move up includes
Aaron Marcher [Sun, 29 Apr 2018 16:50:44 +0000 (18:50 +0200)]
Sort LICENSE according to first commit
Aaron Marcher [Sun, 29 Apr 2018 16:35:41 +0000 (18:35 +0200)]
temp: Port to OpenBSD
In OpenBSD temperature gets fetched using sysctl now.
Aaron Marcher [Sun, 29 Apr 2018 14:08:45 +0000 (16:08 +0200)]
Remove vol_perc() from todo in README
Aaron Marcher [Sun, 29 Apr 2018 14:05:53 +0000 (16:05 +0200)]
Update LICENSE for parazyd
parazyd [Sun, 29 Apr 2018 13:41:18 +0000 (15:41 +0200)]
Add OpenBSD support in volume.c
Aaron Marcher [Sun, 29 Apr 2018 11:02:08 +0000 (13:02 +0200)]
Update LICENSE for Ali H. Fardan
Aaron Marcher [Sun, 29 Apr 2018 11:00:12 +0000 (13:00 +0200)]
Remove ipv{4,6}() from todo in README
Ali H. Fardan [Sun, 29 Apr 2018 07:55:38 +0000 (10:55 +0300)]
ip: add OpenBSD support
ip.c already works on OpenBSD, it's just missing some headers:
Aaron Marcher [Mon, 16 Apr 2018 17:09:07 +0000 (19:09 +0200)]
Remove non-portable functions from config.def.h
Aaron Marcher [Sat, 14 Apr 2018 17:44:54 +0000 (19:44 +0200)]
Add Darron Anderson to LICENSE
Thank you for your contribution.
Aaron Marcher [Sat, 14 Apr 2018 17:44:25 +0000 (19:44 +0200)]
Remove ram_*() from README
Darron Anderson [Sat, 14 Apr 2018 09:41:35 +0000 (09:41 +0000)]
Add OpenBSD RAM stats
Aaron Marcher [Wed, 28 Mar 2018 17:46:27 +0000 (19:46 +0200)]
Format error messages properly
Make use of strerror(errno) and format all errors equally:
function ['parameters']: error message
Aaron Marcher [Wed, 28 Mar 2018 16:49:27 +0000 (18:49 +0200)]
Remove program name from error messages
Aaron Marcher [Wed, 28 Mar 2018 16:26:56 +0000 (18:26 +0200)]
Get rid of err.h as it is not portable
Replace warn() and warnx() with fprintf() and add <stdio.h> where
necessary.
Aaron Marcher [Wed, 28 Mar 2018 16:14:08 +0000 (18:14 +0200)]
Remove unnecessary headers
Aaron Marcher [Mon, 26 Mar 2018 16:09:30 +0000 (18:09 +0200)]
Remove ALSA dependency from README
ALSA is not a dependency anymore as we use /dev/mixer. The corresponding
notice about PulseAudio is thus not necessary too.
Aaron Marcher [Wed, 21 Mar 2018 11:21:37 +0000 (12:21 +0100)]
More robust preprocessor switches
Replace #ifdef with #if defined() and #elif with #elif defined() as it
should only test if it is defined or not.
Aaron Marcher [Mon, 19 Mar 2018 23:48:10 +0000 (00:48 +0100)]
uptime: Port to OpenBSD.
In OpenBSD uptime gets fetched using sysctl now.
Aaron Marcher [Mon, 19 Mar 2018 17:44:52 +0000 (18:44 +0100)]
battery_perc: Port to OpenBSD.
In OpenBSD battery percentage gets fetched using apm now.