Pino Toscano
2019-Feb-07 18:02 UTC
[Libguestfs] [PATCH] inspect: get icon of Gentoo guests
The icon is installed by x11-themes/gentoo-artwork, which is not installed by default (and most probably only on "desktop" installations), although it's the best hit so far... --- lib/inspect-icon.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/inspect-icon.c b/lib/inspect-icon.c index 623591aa6..e785a2172 100644 --- a/lib/inspect-icon.c +++ b/lib/inspect-icon.c @@ -66,6 +66,7 @@ static char *icon_cirros (guestfs_h *g, size_t *size_r); #endif static char *icon_voidlinux (guestfs_h *g, size_t *size_r); static char *icon_altlinux (guestfs_h *g, size_t *size_r); +static char *icon_gentoo (guestfs_h *g, size_t *size_r); #if CAN_DO_WINDOWS static char *icon_windows (guestfs_h *g, const char *root, size_t *size_r); #endif @@ -166,6 +167,9 @@ guestfs_impl_inspect_get_icon (guestfs_h *g, const char *root, size_t *size_r, else if (STREQ (distro, "altlinux")) { r = icon_altlinux (g, &size); } + else if (STREQ (distro, "gentoo")) { + r = icon_gentoo (g, &size); + } } else if (STREQ (type, "windows")) { #if CAN_DO_WINDOWS @@ -440,6 +444,15 @@ icon_altlinux (guestfs_h *g, size_t *size_r) return get_png (g, ALTLINUX_ICON, size_r, 20480); } +/* Installed by x11-themes/gentoo-artwork. */ +#define GENTOO_ICON "/usr/share/icons/gentoo/48x48/gentoo.png" + +static char * +icon_gentoo (guestfs_h *g, size_t *size_r) +{ + return get_png (g, GENTOO_ICON, size_r, 10240); +} + #if CAN_DO_WINDOWS /* Windows, as usual, has to be much more complicated and stupid than -- 2.20.1
Richard W.M. Jones
2019-Feb-07 18:33 UTC
Re: [Libguestfs] [PATCH] inspect: get icon of Gentoo guests
On Thu, Feb 07, 2019 at 07:02:38PM +0100, Pino Toscano wrote:> The icon is installed by x11-themes/gentoo-artwork, which is not > installed by default (and most probably only on "desktop" > installations), although it's the best hit so far... > --- > lib/inspect-icon.c | 13 +++++++++++++ > 1 file changed, 13 insertions(+) > > diff --git a/lib/inspect-icon.c b/lib/inspect-icon.c > index 623591aa6..e785a2172 100644 > --- a/lib/inspect-icon.c > +++ b/lib/inspect-icon.c > @@ -66,6 +66,7 @@ static char *icon_cirros (guestfs_h *g, size_t *size_r); > #endif > static char *icon_voidlinux (guestfs_h *g, size_t *size_r); > static char *icon_altlinux (guestfs_h *g, size_t *size_r); > +static char *icon_gentoo (guestfs_h *g, size_t *size_r); > #if CAN_DO_WINDOWS > static char *icon_windows (guestfs_h *g, const char *root, size_t *size_r); > #endif > @@ -166,6 +167,9 @@ guestfs_impl_inspect_get_icon (guestfs_h *g, const char *root, size_t *size_r, > else if (STREQ (distro, "altlinux")) { > r = icon_altlinux (g, &size); > } > + else if (STREQ (distro, "gentoo")) { > + r = icon_gentoo (g, &size); > + } > } > else if (STREQ (type, "windows")) { > #if CAN_DO_WINDOWS > @@ -440,6 +444,15 @@ icon_altlinux (guestfs_h *g, size_t *size_r) > return get_png (g, ALTLINUX_ICON, size_r, 20480); > } > > +/* Installed by x11-themes/gentoo-artwork. */ > +#define GENTOO_ICON "/usr/share/icons/gentoo/48x48/gentoo.png" > + > +static char * > +icon_gentoo (guestfs_h *g, size_t *size_r) > +{ > + return get_png (g, GENTOO_ICON, size_r, 10240); > +} > + > #if CAN_DO_WINDOWS > > /* Windows, as usual, has to be much more complicated and stupid than > -- > 2.20.1ACK Thanks, Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-builder quickly builds VMs from scratch http://libguestfs.org/virt-builder.1.html
Apparently Analagous Threads
- [PATCH] inspect: get icon of OpenMandriva guests
- [PATCH] inspect: get a better icon for ALT Linux guests (RHBZ#1433937)
- [PATCH 0/3] library: improve handling of external tools
- [PATCH v2 0/3] library: improve handling of external tools
- [PATCH] inspect: fix icon of RHEL