You are not logged in.

#1 2014-10-12 15:09:49

mrkernelpanic
Member
Registered: 2014-01-30
Posts: 43

Unable to change urxvt font

Hello,

Somhow I can not get my console to use a different font automatically. When starting it manually

urvxt -fn "xft:Source Code Pro:Regular:size14"

it works perfectly fine. My .Xresources looks like this:

URxvt.scrollBar: false
URxvt.font: xft:Source Code Pro:regular:size=14

Setting the scrollBar off has worked. urvxt is called via sxkhd.

Any ideas what I did wrong? Thank you!

Last edited by mrkernelpanic (2014-10-12 15:55:20)

Offline

#2 2014-10-12 15:13:14

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,548
Website

Re: Unable to change urxvt font

mrkernelpanic wrote:

URxvt.font: xftLSource Code Pro:regular:size=14

Is that typo also in your Xresources?  Did you/do you merge Xresources with xrdb?  Have you tried Xdefaults (at least for diagnostic purposes)?  Do you run urxvt or urxvtd/c?


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#3 2014-10-12 16:02:10

mrkernelpanic
Member
Registered: 2014-01-30
Posts: 43

Re: Unable to change urxvt font

I'm sorry, of course that is a typo and correct in my Xresources. Merging is enabled in my .xinitrc:

[[ -f ~/.Xresources ]] && xrdb -merge ~/.Xresources

I did not try Xdefaults yet. I run urxvt (not d/c) in my xinitrc/sxhkd.

Offline

#4 2014-10-12 16:07:09

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: Unable to change urxvt font

`[[` is a bashism, use `[`...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#5 2014-10-12 16:36:03

mrkernelpanic
Member
Registered: 2014-01-30
Posts: 43

Re: Unable to change urxvt font

I now have

[ -f ~/.Xresources ] && xrdb -merge ~/.Xresources

in my xinitrc. After restarting X, still the same result.

Edit: I got the result I wanted like this:
sxhkdrc and xinitrc:

urxct -fn 'xft:Source\ Code\ Pro:size=8'

Altough this works, I still would like to know why it does not load Xresources

Last edited by mrkernelpanic (2014-10-12 16:48:19)

Offline

#6 2014-10-12 16:39:13

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,548
Website

Re: Unable to change urxvt font

Xdefaults may be useful for diagnostic purposes.  There are various arguments for each Xresources and Xdefaults - the reasons likely favor Xresources overall, though I still use the Xdefaults.  One advantage of trying out Xdefaults for diagnostic purposes is that urxvt (re-)reads Xdefaults every time it starts up.

If setting that font works with Xdefaults, then we know the font works and the error is somewhere in the merging of Xresources, so we can then focus on that.  If, on the other hand, Xdefaults also does not work, then the problem is actually with urxvt setting that font, and then we can look closer at the font string, perhaps your fonts database, or other related bits.

Also, could you post  your full xinitrc? (this may be worth doing first)

Last edited by Trilby (2014-10-12 16:40:24)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#7 2014-10-12 16:53:25

mrkernelpanic
Member
Registered: 2014-01-30
Posts: 43

Re: Unable to change urxvt font

.xinitrc

#! /bin/sh
#
#~/.xinitrc
#
#Executed by startx (run your window manager from here)

if [ -d /etc/X11/xinit/xinitrc.d ]; then
  for f in /etc/X11/xinit/xinitrc.d/*; do
    [ -x "$f" ] && . "$f"
  done
  unset f
fi
[ -f ~/.Xresources ] && xrdb -merge ~/.Xresources

xrandr --output LVDS1 --auto --primary
xrandr --output HDMI1 --auto --right-of LVDS1

hsetroot -solid "#ffBB00" -tile /home/username/photos/wallpapers/pattern.png
urxvt -fn 'xft:Source\ Code \Pro:size=8' &
sxhkd &
panel &
exec bswpm

Offline

#8 2014-10-12 17:00:27

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,548
Website

Re: Unable to change urxvt font

Thanks, that looks good.  I gather the urxvt terminal launched from within xinitrc has the right font, but subsequent ones do not?


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#9 2014-10-12 17:12:32

mrkernelpanic
Member
Registered: 2014-01-30
Posts: 43

Re: Unable to change urxvt font

I launch subsequent terminals via sxkhd, but I use the same option as in the xinitrc. So now both xinit and sxkhd launched terminals start right, but not without stating the font option explicitly.

urxvt -fn 'xft:Source\ Code \Pro:size=8'

Offline

#10 2014-10-12 18:00:32

cargoan
Member
Registered: 2013-07-13
Posts: 20

Re: Unable to change urxvt font

export the XENVIRONMENT variable in .xinitrc or use .Xdefaults

export XENVIRONMENT="$HOME/.Xresources"

Offline

Board footer

Powered by FluxBB