You are not logged in.

#1 2012-06-09 11:11:23

navgeet
Member
Registered: 2012-05-06
Posts: 3

urxvt - use different fonts for different instances of urxvt

Hello. I use mcabber for IM which is a ncurses program. From what I understand, it is not possible to set font size for a ncurses program. Also urxvt uses .Xresources for configuration which sets the same font for every instance of urxvt.
So I want to ask if it is possible to write a script to start urxvt with a different configuration file and then start mcabber in it.
I understand that I can write a script to change font size in .Xresources and then use xrdb to merge the changes, but I do not understand how I can make that change local for only that instance of urxvt.

Thanks

Offline

#2 2012-06-09 12:05:20

JackH79
Member
From: Australia
Registered: 2009-06-18
Posts: 663
Website

Re: urxvt - use different fonts for different instances of urxvt

I don't htink it's possible to invoke a single instance of urxvt with a different profile.
Why don't you simply configure xterm to your liking and startx mcabber through that?

Offline

#3 2012-06-09 12:15:39

swanson
Member
From: Sweden
Registered: 2011-02-05
Posts: 759

Re: urxvt - use different fonts for different instances of urxvt

Form man urxvt;

-fn fontlist
    Select the fonts to be used. This is a comma separated list of font names that are checked in order when trying to find glyphs for characters. The first font defines the cell size for characters; other fonts might be smaller, but not (in general) larger. A (hopefully) reasonable default font list is always appended to it. See resource font for more details.

    In short, to specify an X11 core font, just specify its name or prefix it with "x:". To specify an XFT-font, you need to prefix it with "xft:", e.g.:

    urxvt -fn "xft:Bitstream Vera Sans Mono:pixelsize=15"
    urxvt -fn "9x15bold,xft:Bitstream Vera Sans Mono"

I use it all the time.

Offline

#4 2012-06-09 12:16:01

bohoomil
Banned
Registered: 2010-09-04
Posts: 2,377
Website

Re: urxvt - use different fonts for different instances of urxvt

You can create a launch script for your application and define fonts you want to use there.

Edit: Good news came twice so now you even have a relevant man snippet.

Last edited by bohoomil (2012-06-09 12:18:30)


:: Registered Linux User No. 223384

:: github
:: infinality-bundle+fonts: good looking fonts made easy

Offline

#5 2012-06-09 12:52:30

navgeet
Member
Registered: 2012-05-06
Posts: 3

Re: urxvt - use different fonts for different instances of urxvt

Thanks swanson, that was exactly what I was looking for. I was so pessimistic I didn't even bother looking up the man page.

Last edited by navgeet (2012-06-09 12:52:46)

Offline

#6 2012-06-09 13:06:40

Procyon
Member
Registered: 2008-05-07
Posts: 1,819

Re: urxvt - use different fonts for different instances of urxvt

You can also do it from within urxvt.

You could for example make an alias for the ncurses program like this:

alias fontc='printf "\e]710;xft:%s:pixelsize=%s\007"'
alias mcabber='fontc profont 11; mcabber; fontc profont 15'

Offline

#7 2012-06-09 18:53:19

ZekeSulastin
Member
Registered: 2010-09-20
Posts: 266

Re: urxvt - use different fonts for different instances of urxvt

You can also set the class of the window upon launch and use that to define your terminal settings (all of them ...) in your .Xresources:

http://pod.tst.eu/http://cvs.schmorp.de … figuration

Offline

Board footer

Powered by FluxBB