Question on xterm*iconHint in VMs

I am trying to find the exact reason Xterm instances of VMs do not show their Icon and revert to the Qube icon instead.

To my understanding, it is possible to select the desired .xpm icon by using something like:

xterm -xrm "xterm*iconHint: /usr/share/pixmaps/xterm-color_48x48"

Or any of the other .xpm icon variants rather than xterm-color_48x48.xpm

The above command works well in dom0. Not in VMs. Is this some issue with qubes-gui-daemon?

BTW, if you have a public .Xdefaults optimized for Qubes minimal templates (on light or dark theme), I appreciate if you could share it with me. I am too lazy to read all the docs and write my own.

Here are my files for debian-12-minimal:

Xresources.dark
!fonts&stuff
XTerm*faceName: JetBrains Mono Light
xterm*faceSize: 11
!xterm*eightBitInput: false

!Turning off scrollbar
!XTerm*scrollBar:  off

! Solarized color scheme for the X Window System
!
! http://ethanschoonover.com/solarized

XTerm*fading:                  40

! https://github.com/solarized/xresources/blob/master/Xresources.dark
#define S_base03        #002b36
#define S_base02        #073642
#define S_base01        #586e75
#define S_base00        #657b83
#define S_base0         #839496
#define S_base1         #93a1a1
#define S_base2         #eee8d5
#define S_base3         #fdf6e3

XTerm*background:            S_base03
XTerm*foreground:            S_base0
XTerm*fadeColor:             S_base03
XTerm*cursorColor:           S_base1
XTerm*pointerColorBackground:S_base01
XTerm*pointerColorForeground:S_base1

#define S_yellow        #b58900
#define S_orange        #cb4b16
#define S_red           #dc322f
#define S_magenta       #d33682
#define S_violet        #6c71c4
#define S_blue          #268bd2
#define S_cyan          #2aa198
#define S_green         #859900

!! black dark/light
XTerm*color0:                S_base02
XTerm*color8:                S_base03

!! red dark/light
XTerm*color1:                S_red
XTerm*color9:                S_orange

!! green dark/light
XTerm*color2:                S_green
XTerm*color10:               S_base01

!! yellow dark/light
XTerm*color3:                S_yellow
XTerm*color11:               S_base00

!! blue dark/light
XTerm*color4:                S_blue
XTerm*color12:               S_base0

!! magenta dark/light
XTerm*color5:                S_magenta
XTerm*color13:               S_violet

!! cyan dark/light
XTerm*color6:                S_cyan
XTerm*color14:               S_base1

!! white dark/light
XTerm*color7:                S_base2
XTerm*color15:               S_base3
Xresources.light
!fonts&stuff
XTerm*faceName: JetBrains Mono Light
xterm*faceSize: 11
!xterm*eightBitInput: false

!Turning off scrollbar
!XTerm*scrollBar:  off

! Solarized color scheme for the X Window System
!
! http://ethanschoonover.com/solarized

XTerm*fading:                  40

! https://github.com/solarized/xresources/blob/master/Xresources.light
#define S_base03        #002b36
#define S_base02        #073642
#define S_base01        #586e75
#define S_base00        #657b83
#define S_base0         #839496
#define S_base1         #93a1a1
#define S_base2         #eee8d5
#define S_base3         #fdf6e3

XTerm*background:            S_base3
XTerm*foreground:            S_base00
XTerm*fadeColor:             S_base3
XTerm*cursorColor:           S_base01
XTerm*pointerColorBackground:S_base1
XTerm*pointerColorForeground:S_base01

#define S_yellow        #b58900
#define S_orange        #cb4b16
#define S_red           #dc322f
#define S_magenta       #d33682
#define S_violet        #6c71c4
#define S_blue          #268bd2
#define S_cyan          #2aa198
#define S_green         #859900

!! black dark/light
XTerm*color0:                S_base02
XTerm*color8:                S_base03

!! red dark/light
XTerm*color1:                S_red
XTerm*color9:                S_orange

!! green dark/light
XTerm*color2:                S_green
XTerm*color10:               S_base01

!! yellow dark/light
XTerm*color3:                S_yellow
XTerm*color11:               S_base00

!! blue dark/light
XTerm*color4:                S_blue
XTerm*color12:               S_base0

!! magenta dark/light
XTerm*color5:                S_magenta
XTerm*color13:               S_violet

!! cyan dark/light
XTerm*color6:                S_cyan
XTerm*color14:               S_base1

!! white dark/light
XTerm*color7:                S_base2
XTerm*color15:               S_base3

The only problem with the dark theme is the *.swp files are the same color as the background and are not visible.

1 Like

I can also recommend adding to /etc/X11/Xresources/x11-common as in Ubuntu

Xft.antialias: 1                                                                                                                                              
Xft.hinting: 1                                                                                                                                                
Xft.rgba: rgb                                                                                                                                                 
Xft.hintstyle: hintslight                                                                                                                                     
Xft.lcdfilter: lcddefault

This is a known problem for some programs with no solution at this time.

Thank you very much for those. I appreciate them very much.

Very nice

I am working on it. I believe I might have some ideas. The problem is with QubesOS GUI Daemon. This is the current logic used to load the icon data in the xside.c code. There should be another case which is used by xterm and some other programs. If you get the Window ID of the VMs xterm in dom0 by using wmctrl -l and query it via xrop -id <WINDOWID>, you will get the window id within VM by looking at _QUBES_VMWINDOWID key. And then if you query it in the VM by using xprop -id <VMWINDOWID>, you will see that the icon is provided via WM_HINTS.

I have to study the mechanism to add another condition in xside.c and load the bitmap & its mask. Should take some time.

@Euwiiwueir You recently worked on the file and did a contribution. Could you recommend me some resource on X-Window programming mechanism?

2 Likes

I think much of X programming reference material is stranded in published paper form, unfortunately, though I could be wrong. There are API manpages in package libx11-doc (Debian) – somewhat helpful – and some more documentation in xorg-docs – probably less helpful for what you’re looking into. Sometimes a targeted web search about a specific question or function has helped.

Your best bet may be to take the plunge and clone relevant repositories: xorg · GitLab

Especially: xorg / xserver · GitLab

And then, a further step, set up your editor with LSP on each repo. When you have an LSP working you can jump around the source (which, regrettably, is not a work of art) pretty easily and this is probably better in the long run than reference material. But this means building X, effectively. It’s much easier to build than in the past but it will surely still take some time to get all dependencies in place.

This will get you pretty far:

apt-get build-dep xserver-xorg-core

Then, the xorg build system needs these packages:

meson
cmake
pkg-config

Standard gcc/autotools stuff if the build-dep step didn’t catch them:

gcc
make
autoconf
automake
libtool

In my notes, some more X stuff, but probably these are already captured by the build-dep step:

xorg-dev
libx11-dev
xcvt
libxcvt0
libxcvt-dev

Good luck!


(All named packages are as under Debian)

1 Like

Thank you very much for comprehensive reply and the shared knowledge.

1 Like