Skip to content

cshmookler/system_state

Repository files navigation

system_state

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).

Build from Source

1.  Install a C++ compiler, Meson, GoogleTest (optional), ALSA libraries, and cpp_result.

Linux (MOOS):

sudo pacman -S base-devel meson gtest alsa-lib moos-cpp-result

2.  Clone this project.

git clone https://github.com/cshmookler/system_state.git
cd system_state

3.  Build this project from source.

meson setup build
cd build
ninja

4.  (Optional) Run all tests.

sudo ninja test

NOTE: Some tests require root privileges to succeed.

4.  (Optional) Install this project globally.

meson install

TODO

  • 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

About

C++ library for fetching and modifying the system state on MOOS (https://github.com/cshmookler/moos). Provides functions for volume control, networking, power management, backlight, thermal, resource usage, and more (see the README).

Resources

License

Stars

1 star

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors