GithubHelp home page GithubHelp logo

scoreunder / cpu_usage Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 3 KB

Quick CPU usage tool for command line usage

OCaml 100.00%
linux i3blocks i3blocklets i3blocks-modules i3blocks-scripts cpu-monitoring

cpu_usage's Introduction

CPU usage monitor

TL;DR

  • shows CPU usage percentage
  • needs systemd (kinda)
  • made for i3blocks

Description

Intended for use on systemd systems. Maybe uncomment line 9 and comment out line 10 if you're not using systemd. (At the expense of a ridiculously slim chance of a hypothetical symlink attack)

This tool will output the CPU usage percentage to stdout and then exit. The first run will produce the output "nan%" but the rest will be fine. Designed for i3blocks as a drop-in replacement for the existing script. The existing one lingers around for a short moment and shows CPU usage between program start and finish, but this one shows CPU usage between invocations instead, which means that all you need to do to change the resolution in i3blocks is to change the i3blocks "interval" as with any other program.

This program outputs the usage since last invocation, so if this tool is being invoked by multiple programs, the output may apply to an unacceptably short period of time.

How to build

  1. install dune (the ocaml build tool)
  2. dune build

cpu_usage's People

Contributors

scoreunder avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.