Xfce Forum

Sub domains
 

You are not logged in.

#1 2017-10-27 19:07:40

cty78ujo
Member
Registered: 2017-10-27
Posts: 2

Genmon tooltip size?

Is there a hardcoded limit to the maximum width/height of tooltips in genmon? For example, here is my source text of my tooltip

here

and here is the tooltip

here

It keeps the formatting up to a certain size; as you can in this case it wraps the text to new lines as it is too wide. Is there a way to keep the formatting and make the tooltip 100% width no matter how large it is?

Last edited by cty78ujo (2017-11-10 10:12:19)

Offline

#2 2017-10-28 02:58:07

ToZ
Moderator
From: Canada
Registered: 2011-06-02
Posts: 3,866

Re: Genmon tooltip size?

First question would be, what version of genmon are you using? A 3.x GTK2 version or a 4.x GTK3 version?

cty78ujo wrote:

Is there a hardcoded limit to the maximum width/height of tooltips in genmon?

No. The code simply uses the gtk_widget_set_tooltip_text() which uses internal GTK functionality for displaying tooltips.

For example, here is my source text of my tooltip

.....

It keeps the formatting up to a certain size; as you can in this case it wraps the text to new lines as it is too wide. Is there a way to keep the formatting and make the tooltip 100% width no matter how large it is?

Perhaps it is GTK's tooltip functionality that is doing this.

There are two issues here. The first is that the tooltip is using a non-monospaced font, so the alignment will never be correct. Secondly, you probably need to clean that output up manually to get it to display correctly. Something like:

sudo iptables -vnL | grep -A8 INPUT | awk '{printf "%-6s %-6s %-30s %-5s %-5s %-5s %-5s %-16s, %-16s\n", $1, $2, $3, $4, $5, $6, $7, $8, $9}'

..is one example where I'm grabbing a piece of the output and piping it through awk and using printf to format that output.

A second option to clean up the tooltip output if for me to change gtk_widget_set_tooltip_text() to gtk_widget_set_tooltip_markup() so that you can use pango markup in the tooltip (just like you can in the output string). I think I will do that.

Here is what this snippet:

echo "<txt>firewall on</txt><tool><span font='Monospace 6' fgcolor='Green'>$IPT</span></tool>"

...looks like with the output formatted and the code changed to use gtk_widget_set_tooltip_markup() on the GTK3 version of the plugin:
ipt0.png


How To Ask For Help           Xfce FAQ                            Xfce Release Information
The Xfce Community          Xfce Tips and Tricks

Offline

#3 2017-10-28 03:55:59

cty78ujo
Member
Registered: 2017-10-27
Posts: 2

Re: Genmon tooltip size?

ToZ wrote:

First question would be, what version of genmon are you using? A 3.x GTK2 version or a 4.x GTK3 version?

XFCE 4.12 (xfce panel says 4.12.1), so it should be the newest version that comes with Fedora's XFCE4 goodies package.

ToZ wrote:

There are two issues here. The first is that the tooltip is using a non-monospaced font, so the alignment will never be correct. Secondly, you probably need to clean that output up manually to get it to display correctly.

I didn't realize the tooltip wasn't monospaced and not aligned. Just the line wrapping, but it would be good to get it spaced correctly as well. In this example below, if I use the non verbose version, it doesn't wrap the text to new lines, it only does it in the verbose version, which is why I thought it was related to width.

here

ToZ wrote:

...looks like with the output formatted and the code changed to use gtk_widget_set_tooltip_markup() on the GTK3 version of the plugin:

Is this a setting I can change somewhere or do I need to recompile xfce/genmon with it somewhere?

Last edited by cty78ujo (2017-11-10 10:14:03)

Offline

#4 2017-10-28 10:45:34

ToZ
Moderator
From: Canada
Registered: 2011-06-02
Posts: 3,866

Re: Genmon tooltip size?

cty78ujo wrote:
ToZ wrote:

First question would be, what version of genmon are you using? A 3.x GTK2 version or a 4.x GTK3 version?

XFCE 4.12 (xfce panel says 4.12.1), so it should be the newest version that comes with Fedora's XFCE4 goodies package.

What does 'dnf info xfce4-genmon-plugin' report as the version?

ToZ wrote:

...looks like with the output formatted and the code changed to use gtk_widget_set_tooltip_markup() on the GTK3 version of the plugin:

Is this a setting I can change somewhere or do I need to recompile xfce/genmon with it somewhere?

For now, you would need to build only the genmon plugin from source yourself. The change is simple: change 'gtk_widget_set_tooltip_text' to 'gtk_widget_set_tooltip_markup' in the 'DisplayCmdOutput' function.

I will make the change to the git version of the plugin shortly.

EDIT: Commit pushed: https://git.xfce.org/panel-plugins/xfce … 9ede9e7d87

Last edited by ToZ (2017-10-29 00:59:13)


How To Ask For Help           Xfce FAQ                            Xfce Release Information
The Xfce Community          Xfce Tips and Tricks

Offline

Board footer

Powered by FluxBB