C++ library for fetching and modifying the system state on MOOS. Provides functions for volume control, networking, power management, backlight, thermal, resource usage, and more (see the README).
1. Install a C++ compiler, Meson, GoogleTest (optional), ALSA libraries, and cpp_result.
sudo pacman -S base-devel meson gtest alsa-lib moos-cpp-resultgit clone https://github.com/cshmookler/system_state.git
cd system_state
meson setup build
cd build
ninja
sudo ninja test
NOTE: Some tests require root privileges to succeed.
meson install
- Remove duplicate code in sound.cpp
- Prefix all methods that fetch with "get_" and all methods that set with "set_"
- Replace all static methods with global functions.
- Move error_t, result_t, optional_t, and all related utilities to a distinct library
- Remove const qualifiers from all methods that modify system state.
- error handling
- make (mostly) thread safe
- add traces to error messages
- examples
- uptime
- disks
- disk partitions
- disk name
- disk total space
- disk used space
- disk partition schemes
- partition name
- partition start position
- partition mount points
- partition filesystems
- partition mount options
- swap
- memory
- total cpu usage
- individual cpu usage
- process statistics
- thermal sensors
- cooling devices
- load averages (1 min, 5 min, 15 min)
- battery name
- battery status
- battery current
- battery power
- battery percentage
- battery time remaining
- backlight name
- backlight get
- backlight set
- backlight set relative
- network interface name
- network interface status
- network interface SSID
- network interface statistics
- network interface signal strength percentage
- playback mute get
- playback mute set
- playback mute toggle
- playback volume get
- playback volume set
- playback volume set all
- playback volume set all relative
- capture mute get
- capture mute set
- capture mute toggle
- capture volume get
- capture volume set
- capture volume set all
- capture volume set all relative
- microphone status
- camera status
- user name
- running kernel version
- installed kernel versions