osutil

OS Utils for Nim, simple tiny but useful procs for OS. Turn Display OFF and set Process Name.


Keywords
utils, helpers, minimalism, process, mobile, battery, nim, nim-lang, operating-system
License
LGPL-3.0
Install
nimble install osutil

Documentation

nim-os-util

  • Set the current Process name in Nim, shows up on system monitor with custom name.
  • Turn Display Off using Nim, 1 proc, turns off monitor, designed for long running tasks on mobile devices to save battery.

screenshot

Use

>>> import osutil
>>> echo set_process_name("MyAwesomeNimApp")
>>> echo set_display_off()
(output: "", exitCode: 0)

Install

nimble install osutil

Requisites

Documentation

set_process_name()

Description: Set the current Process name in Nim, shows up on system monitor with custom name.

If you dont set the process name it will show up as "nim" or "main" or the filename of the main executable.

For SysAdmins and DevOps is important to quickly identify a particular process on the system monitor, that can be a GUI or a command like htop or glances.

Giving a proper name to your processes makes your software feel more professional.

Uses a low level call to libc.so. Only available on Linux.

Arguments:

  • name A Name for your Process, string type, required.

Returns: None.

set_display_off()

Description: Turn Display Off using Nim, crossplatform, 1 proc, turns off monitor, designed for long running tasks on mobile devices.

Arguments: None.

Returns: tuple[output: TaintedString, exitCode: int].