Skip to content
macOS system library in Swift
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Example Update copyright year for 2017 Oct 5, 2017
SystemKit.xcodeproj Update project settings for Xcode 8.3.3 Oct 5, 2017
SystemKit Update copyright year for 2017 Oct 5, 2017
SystemKitTests Update copyright year for 2017 Oct 5, 2017
.gitignore Add example Jan 10, 2015
LICENSE Update copyright year for 2017 Oct 5, 2017
README.md Update README Oct 5, 2017

README.md

SystemKit

A macOS system library in Swift based off of libtop, from Apple's top implementation.

  • For an example usage of this library, see dshb, a macOS system monitor in Swift
  • For other system related statistics in Swift for macOS, see SMCKit

Requirements

Installation

Carthage

Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.

You can install Carthage with Homebrew using the following command:

$ brew update
$ brew install carthage

To integrate SystemKit into your Xcode project using Carhage, specify it in your Cartfile:

github "beltex/SystemKit"

Run carthage update to build the framework and drag the built SystemKit.framework into your Xcode project. Don't forget to alter your Carthage building phase for macOS.

Example

Sample ouput from example.

// MACHINE STATUS

-- CPU --
  PHYSICAL CORES:  2
  LOGICAL CORES:   2
  SYSTEM:          10%
  USER:            17%
  IDLE:            71%
  NICE:            0%

-- MEMORY --
  PHYSICAL SIZE:   7.75GB
  FREE:            1.33GB
  WIRED:           866MB
  ACTIVE:          5.04GB
  INACTIVE:        516MB
  COMPRESSED:      0MB

-- SYSTEM --
  MODEL:           MacBookPro7,1
  SYSNAME:         Darwin
  NODENAME:        beltex.local
  RELEASE:         13.4.0
  VERSION:         Darwin Kernel Version 13.4.0: Sun Aug 17 19:50:11 PDT 2014...
  MACHINE:         x86_64
  UPTIME:          6d 21h 4m 38s
  PROCESSES:       197
  THREADS:         967
  LOAD AVERAGE:    [3.18, 3.89, 3.99]
  MACH FACTOR:     [0.436, 0.385, 0.322]

-- POWER --
  CPU SPEED LIMIT: 100.0%
  CPUs AVAILABLE:  2
  SCHEDULER LIMIT: 100.0%
  THERMAL LEVEL:   Not Published

-- BATTERY --
  AC POWERED:      true
  CHARGED:         true
  CHARGING:        false
  CHARGE:          100.0%
  CAPACITY:        1675 mAh
  MAX CAPACITY:    1675 mAh
  DESGIN CAPACITY: 5450 mAh
  CYCLES:          646
  MAX CYCLES:      1000
  TEMPERATURE:     30.0°C
  TIME REMAINING:  0:45

References

License

This project is under the MIT License.

You can’t perform that action at this time.