1

I'm trying to run xrdb ~/.Xresources but I'm getting the following error:

~/dotfiles/.Xresources:0: warning: Unknown encoding: POSIX

Any suggestions?

Xft.hinting: true 
Xft.hintstyle: hintfull 
Xft.antialias: rgba 
Xft.rgba: none
Xft.dpi: 96

Xcursor.theme: DMZ-Black
Xcursor.size: 16

#define r_bg   #000000
#define r_fg   #aaaaaa
#define r_hlfg #ffffff

! States: bg, fg, bgalt, hlbg, hlfg
rofi.color-enabled: true
rofi.color-normal: r_bg,r_fg,r_bg,r_bg,r_hlfg
rofi.color-urgent: r_bg,#ffffff,r_bg,r_bg,r_hlfg
rofi.color-active: r_bg,r_fg,#ffffff,r_bg,#ffffff
! states: background, border
rofi.color-window: r_bg,#ffffff

rofi.separator-style: solid
rofi.sidebar-mode: falseA
rofi.bw: 1
rofi.columns: 1
rofi.padding: 5

rofi.yoffset: -300
rofi.opacity: 80
rofi.fake-transparency: true
rofi.location: 0
rofi.width: 30
rofi.font: Inconsolata 12
rofi.lines: 10

! special
*.foreground:   #ffffff
*.background:   #000000
*.cursorColor:  #cc00ff

! black
*.color0:       #1c1c1c
*.color8:       #00d7ff

! red
*.color1:       #ff00ff
*.color9:       #d700ff

! green
*.color2:       #00afaf
*.color10:      #00afd7

! yellow
*.color3:       #0087af
*.color11:      #5f5fff

! blue
*.color4:       #5f5faf
*.color12:      #ff5fff

! magenta
*.color5:       #d75fff
*.color13:      #00d7ff

! cyan
*.color6:       #00afff
*.color14:      #00ffff

! white
*.color7:       #808080
*.color15:      #ccffff

! define different font params for various machines
#ifdef SRVR_chromebook
    #define urxvt_font_size 17
    #define urxvt_letter_spacing -1
#elif defined SRVR_baseline
    #define urxvt_font_size 16
    #define urxvt_letter_spacing -1
#else
    #define urxvt_font_size 15
    #define urxvt_letter_spacing -2
#endif

! make it easy to change font in one place
#define urxvt_font xft:Ubuntu Mono:pixelsize=urxvt_font_size
#define urxvt_bold_font urxvt_font:style=Bold

URxvt*font: urxvt_font
URxvt*boldFont: urxvt_bold_font

URxvt*allow_bold: true
URxvt*letterSpace: urxvt_letter_spacing

URxvt*buffered: false
URxvt.transparent: true
URxvt*shading: 15

URxvt*scrollBar:     false

Also, I'm having trouble getting 256 color support with urxvt, tmux, and vim

The output of locale is:

LANG=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=POSIX

I am running Fedora

Zac Yauney
  • 11
  • 3
  • 2
    For some reason it (some program) doesn't like the fact that you have LC_ALL=POSIX. Change it to a valid locale, either C or any appropriate locale reported by locale -a. – Kusalananda Apr 21 '17 at 19:02
  • How do you change the locale? It looks like what I need to do is set a default locale in my locale.conf. – Zac Yauney Apr 21 '17 at 19:08
  • @ZacYauney Yes, in /etc/locale.conf. See https://docs.fedoraproject.org/en-US/Fedora/22/html/System_Administrators_Guide/ch-System_Locale_and_Keyboard_Configuration.html I'm not on Fedora myself, so can't verify or reproduce any of this. – Kusalananda Apr 21 '17 at 19:20
  • I would perhaps not change settings system-wide if this is only problematic with xrdb (and maybe a few other utilities with similar provenance). – tripleee Apr 22 '17 at 05:55
  • For tangential background, see also https://unix.stackexchange.com/questions/153556/consequences-of-setting-up-posix-locales – tripleee Apr 22 '17 at 05:55

1 Answers1

1

You can temporarily set a different locale for the duration of the xrdb command with

LC_ALL=C xrdb ~/.Xresources

I'm speculating that xrdb was compiled with some legacy library from many years ago which supports the basic locale API but doesn't know how to handle the POSIX locale. (You might want to submit a bug report with a link to this answer if this is reproducible. Pertinent standards require POSIX to be defined, and behave identically to the the C locale.)

tripleee
  • 7,699
  • The C locale is not legacy. The POSIX locale and the C locale are one and the same. – fpmurphy Apr 22 '17 at 09:23
  • To my understanding, the reason there are two names with the same semantics is certainly for compatibility with legacy systems which used the older locale name C. But thanks for following up; I removed that pesky word from this answer. – tripleee Apr 22 '17 at 09:58
  • C/POSIX has been there far longer than Fedora, making this answer not useful to anyone. The problem is likely some breakage in the X locale configuration. – Thomas Dickey Apr 22 '17 at 12:19
  • This solution actually helped my on Fedora 32, so its useful. I checked that the .Xresources file had no BOM. – zx485 Aug 23 '22 at 22:20
  • The contents of the file are probably unimportant; the error message is saying that some internal API that the program is calling doesn't support the POSIX locale and so it's bailing out. You could perhaps strace or ltrace the bug to find the culprit. – tripleee Aug 24 '22 at 06:48