i3status-rust icon indicating copy to clipboard operation
i3status-rust copied to clipboard

Add block for libvirtd/qemu

Open dijit opened this issue 3 years ago • 7 comments

Why

I find it sometimes useful on my desktop to understand how many VMs I have running or that are paused/stopped at a glance.

What

a simple libvirt integration to count the number of running instances; optionally you can use format to display.

  • "paused" (suspended)
  • "stopped" (destroyed) domains
  • and a count of the images in the local disk store (such as virtual harddisks and ISOs, will count all activated storage).

Due to the crate virt using a lot of unsafe, I figure it's best to keep it as an optional include.

I chose the icon 'copy' for the bar, as that closely resembles vmware's iconography.

dijit avatar May 05 '22 15:05 dijit

Hrm, it seems like it's more likely to crash with the new error handling.

(I'm testing by restarting libvirtd repeatedly)

dijit avatar May 06 '22 08:05 dijit

Due to the crate virt using a lot of unsafe, I figure it's best to keep it as an optional include.

It doesn't add any new dependencies and the unsafe code would only be called if you're using the block so I'd say it's OK the other way as well.

ammgws avatar May 07 '22 13:05 ammgws

It doesn't add any new dependencies

Unfortunately it does: https://github.com/greshake/i3status-rust/pull/1471/commits/54223fb9f4cb63a7e943984879cfb537eb992e53

MaxVerevkin avatar May 07 '22 13:05 MaxVerevkin

Ah, then I take it back.

ammgws avatar May 07 '22 13:05 ammgws

Would be nice if there was a dlopen version...

MaxVerevkin avatar May 07 '22 21:05 MaxVerevkin

Once compiled libvirt-dev is not needed (if that's the question).

It's a build-time dependency.

dijit avatar May 09 '22 01:05 dijit

@dijit can you rebase please?

The Block trait changed, see the definition here. In short, id() was removed and name() was added.

block_error function was removed, see what's available here. In short, instead of .block_error(<block>, <msg>)? use .error_msg(<msg>)?.

MaxVerevkin avatar May 14 '22 16:05 MaxVerevkin

Closing due to lack of activity

MaxVerevkin avatar Mar 10 '23 19:03 MaxVerevkin