SCIENTIFIC-LINUX-USERS Archives

January 2012

SCIENTIFIC-LINUX-USERS@LISTSERV.FNAL.GOV

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Todd And Margo Chester <[log in to unmask]>
Reply To:
Todd And Margo Chester <[log in to unmask]>
Date:
Sun, 1 Jan 2012 14:35:54 -0800
Content-Type:
text/plain
Parts/Attachments:
text/plain (68 lines)
> Hi All,
>
> I am using Scientific Linux 6.2 x64 (RHEL clone):
>
> $  zenity --info --title="abc" --font "monospace 9" --text "abcdefg"
> This option is not available. Please see --help for all possible usages.
>
> $ zenity --help-all | grep -i font
> <nothing>
>
> $ rpm -qa \*zenity\*
> zenity-2.28.0-1.el6.x86_64
>
>
> I really need a monospaced font.  I am drawing a blank on Google.
> Any one know how to do this?
>
> Many thanks,
> -T

Hi All,

    Krzysztof over on comp.os.linux.misc showed me what to
do.  The solution is to use a custom .gtkrc.

    Thank you all for the tips and help!

-T

My notes on the subject:

How to set up a custom (in this case a "monospace") font in zenity:

A helpful reference:
 
http://urukrama.wordpress.com/2008/07/13/setting-a-custom-gtk-theme-for-specific-applications


Use a "custom" gtkrc.  Start you zenity command with:

     GTK2_RC_FILES=/path/to/your/theme/gtkrc zenity ....


For example:

$ xx="`su root -c "virsh list --all"`"


Show the bad spacing:
$ zenity --info --title="abc" --text "$xx"


$ cp .gtkrc .gtkrc.monospace.12


Add the customer font:
$ vi .gtkrc.monospace.12
style "font" {
font_name="monospace 12"
}
widget_class "*" style "font"
gtk-font-name = "monospace 12"


Show the good spacing:
$ GTK2_RC_FILES=/home/todd/.gtkrc.monospace.12  \
       zenity --info --title="Status" --text "$xx"

ATOM RSS1 RSS2