iphands/randy

Conky inspired system info viewer written in Rust / GTK3

Conky was named after the puppet

Randy

Cheezeburgerz!

... so this thing is Randy

A man’s gotta eat, Julian.

Goals

Learn a ton

I'm new to Rust (you can tell in the code!), having fun and learning a lot.

I'd like to come up with a more standard "module" interface once I've developed more of the modules and refactor based on what I have learned.

Feature parity with my old Conky config

Done! My old Conky setup looked more or less like the Randy screenshot.

Took 200+ commits to get there, but its there and working!

Frick Ricky, stay off the CPU

Strive to do things in as little cycles as possible. Not do things as fast as possible (hence to parallel scans of /proc/*).

ps -eo etimes,times,command | grep randy

Speed tests

  • Check out the bench directory/sub-crate for some speed testing
  • Build with --features timings to see details about how long things take in Randy

Linux only

At the moment Randy only really runs on Linux. Running on other operating systems is not a goal.

Note: someone shared a screenshot of Randy running on Windows with WSfL though :D.

Features

Configurable modules

  • Module list:
    • system - system info
    • cpus - all cpus usage stats bar
    • cpu_consumers - top N pids using cpu and their usage
    • mem_consumers - top N pids using mem and their usage
    • filesystem - usage of a given mounted filesystem
    • net - usage recv/trans for a given network interface
    • battery - charging/discharging percentage of /sys/*/power_supply's
  • Can order the modules how you wish
  • Can enable/disable modules and sub items

UI settings

  • bar_height - the height of the bars (default: 10px)
  • base_opacity - the base opacity of the Randy window. affects window and all sub-widgets. (default: 1.0)
  • color_bar - base color of the usage bars
  • color_bar_med - color of the usage bars > 50% < 80%
  • color_bar_high - color of the usage bars > 80%
  • color_borders - color of the GTK borders (frame borders, bar borders) defaults to same as color_text
  • color_label - color of the "labels"
  • color_text - color of all other text
  • decoration - hide/show window decorations
  • font_family - the CSS-style font family string (font names with spaces must be wrapped in escaped quotes, eg fo_family: "\"Terminus (TTF)\", \"Liberation Mono\", monospace")
  • font_size
  • mod_bat -modulo used to skip frames for getting battery data (default: 2)
  • mod_fs - modulo used to skip frames for getting filesystem data (default: 2)
  • mod_top - modulo used to skip frames for getting top data (default: 2)
  • resizable - bool to make the GUI resizable
  • skip_taskbar - in case you want to see a Randy item in the taskbar
  • timeout - time in seconds to wait between frame updates
  • xpos - starting position x
  • ypos - starting position y

Building

Optional deps / features

  • nvidia: Enable NVIDIA card temp sensing via NVML .so
  • sensors: Enable lm-sensors integration

Example:

cargo run --features sensors,nvidia

Required build packages

I have only barely looked into packaging but jhjaggars put some helpful hints for Raspbian and Fedora in here:

  • https://github.com/iphands/randy/issues/2
  • https://github.com/iphands/randy/issues/1

Example

cargo run --release --no-default-features  # build with lm-sensors and nvml disabled

Running

Randy needs to be pointed at a config Yaml. It will look for the default.yml in $PWD/config. Should work ootb if you launch from the root of the Git repo.

If you are launching Randy from elsewhere... point it at the config Yaml file of your choosing. Example:

randy /tmp/configs/my_cool_config.yml

Screenshots

FAQ

  • Does randy work with Wayland?
    • Yes, check out the proof
  • Does randy work with X?
    • Yes
Issues

Collection of the latest Issues

ssokolow

ssokolow

Comment Icon1

I decided to explore Randy as a replacement for Conky after upgrading to some new hard drives and a new Kubuntu LTS, but I realized that it doesn't seem to support putting multiple pieces of information on the same line.

Here's the layout I'm trying to make a viably compact replacement for:

Screenshot_20210428_111835

qarmin

qarmin

Comment Icon3

I think that randy should load default(builtin) config when not found any. It is strange that after installation we need to create/copy config file because it crash when we don't do it

jhjaggars

jhjaggars

Comment Icon4

libglib2.0-dev libcairo2-dev libpango1.0-dev libatk1.0-dev libgdk-pixbuf2.0-dev libgtk-3-dev libsensors4-dev

Versions

Find the latest versions by id

1.6.3 - Nov 30, 2020

Changes from 1.6.0

  • Preallocate widget space so that there is (hopefully) no resizing at runtime
  • Fix bug where > 1 mount/fs lookups failed
  • Add support to change the frame/bar widget border color
  • Added battery/power_supply widget
  • Added base_opacity to let users make all things opaque (even text) thansk @mwcz
  • example green mode (and screenshot)

1.6.0 - Nov 28, 2020

Changes since 1.5.0

Networking module

Reports throughput up/down in {K,M,G} bytes per second. Example config:

Speed improvements

  • Cache reader and exit early in do_fs
  • Took get_cpu_mhz from 10ms to sub 1ms
  • Don't clean up of proc/pid BufReaders on every frame, wait a few
  • Lots of switches to iter chains from for loops

Misc

  • Better looking defaults
  • Let users configure the "bar" heights in config Yaml

1.5.0 - Nov 26, 2020

Changes since 1.4.3

Speed improvements of _consumers module

  • Cache BufReaders for cpu usage /proc/$pid/stat
  • Fix regression where skipfile didn't properly skip files

Build options now default to optional off

Config file clean up

  • Let users set progressbar "trough" color
    • fall back to transparent if composited and not set
    • fall back to color_background if not composited
  • Lots of fall back to parent option if specific thing isn't set

1.4.3 - Nov 25, 2020

Changes from 1.4.0

  • Send Randy to the background and dont steal focus on launch (unless configured for decorations)
  • Lots of small speed ups on the /proc/pid consumers code... sometimes <2ms on my box :D
  • Published to https://crates.io/crates/randy
  • Added license
  • Bars now can have a normal/med/high color
  • New settings
    • font_family thanks @mwcz
    • color_bar_med
    • color_bar_high

1.4.0 - Nov 25, 2020

Transparency

Randy config yaml now supports setting rgba CSS values that (if composited) will make Randy transparent. For example: color_background: "rgba(0, 0, 0, 0.75);"

Misc

Lots of behind the scenes stuff

  • macroing away repetition
  • sub crate for benchmarks (was doing out of tree)

1.3.3 - Nov 24, 2020

Lots of small speed hacks for the "top" code.

  • cache the BufReader
  • make matcher vec out side loop
  • trim before clone
  • adding to the process skip list hack
  • use iter chains where possible
  • dont get ps info when no top UI

Re-impl the nvidia gpu temp code to not exec nvidia-smi instead use the nvml .so to get the info.

  • 7ms -> 0.03ms :D

Small style changes

  • less empty space around progress bars
  • removed that funky 1px border on progress bars

1.3.2 - Nov 21, 2020

Rewrote the get_fs function to not exec. Instead call /proc/mounts and use libc's statvfs call.

1.3.1 - Nov 21, 2020

Same as 1.3.0, but I fixed the build. Bad ifdef borked the standard build.

1.3.0 - Nov 21, 2020

Adding the filesystem module. Rejiggered a lot of the configs. You can now configure the update frequency of the cpu_consumers, mem_consumers, and filesystem modules.

1.2.0 - Nov 20, 2020

Speed hacks for the /proc/pid/stat routine.

  • read lines one at a time
  • eagerly quit on matches
  • pass in a hack function to do weird shit on each line
    • lets me skip the whole file if Name:\tkworker is line 0

1.1.0 - Nov 19, 2020

Big speed improvements on the top data. Randy now caches open file handles on proc items.

1.0.0 - Nov 19, 2020

Initial release of Randy. This almost has feature parity with my Conky setup. Needs:

  • Networking
  • File-system

Squashed most bugs I tihnk!

Information - Updated Jul 28, 2022

Stars: 81
Forks: 8
Issues: 5

Repositories & Extras

This is an example of a Rust server that functions as a remote schema for...

Rust + Hasura Rust server that functions as a Hasura

This is an example of a Rust server that functions as a remote schema for...

Newport Engine is a modular 2D and 3D game engine built in Rust for Rust

It is designed to be easily extendable and easy to use

Newport Engine is a modular 2D and 3D game engine built in Rust for Rust

Newport Engine is a modular 2D and 3D game engine built in Rust for Rust

It is designed to be easily extendable and easy to use

Newport Engine is a modular 2D and 3D game engine built in Rust for Rust

liboqs-rust: Rust bindings for liboqs

Qyantum Safe liboqs rust bindings

liboqs-rust: Rust bindings for liboqs

msgflo-rust: Rust participant support for MsgFlo

Flowhub visual programming IDE

msgflo-rust: Rust participant support for MsgFlo
Actix

1.0K

How to be a full stack Rust Developer

Read Rust the Rust blog posts at Steadylearner

How to be a full stack Rust Developer

Rust library translation (rust-src/rust-std/stdlib/rustlib translation)

This is the place to translate Having a documentation in your native language is essential if you don't speak English, and still enjoyable even if...

Rust library translation (rust-src/rust-std/stdlib/rustlib translation)

False Positive for rust-lang/rust#83583

The deprecation lint proc_macro_derive_resolution_fallback is intended to catch proc macro generated code that refers to items from parent modules that should not be in scope:

False Positive for rust-lang/rust#83583

A CHIP-8 &amp; SuperChip interpreter written in Rust using rust-sdl2

If you're getting compile errors it may be because

A CHIP-8 &amp; SuperChip interpreter written in Rust using rust-sdl2

Rust-Svelte-on-Rust

Starter template for Rocket backend server

Rust-Svelte-on-Rust

xbuild is a build tool for rust and rust/flutter projects with support for cross compiling...

xbuild is a build tool for rust and rust/flutter projects with support for cross compiling and

xbuild is a build tool for rust and rust/flutter projects with support for cross compiling...
Facebook Instagram Twitter GitHub Dribbble
Privacy