# Getting Athena/Motif-based applications to match GTK/Qt themes



## hunter0one (Sep 25, 2022)

Hi,

I'm curious of any methods to get older applications based on Athena (Xaw) and Motif to match your current GTK or Qt theme. If I recall correctly, the MATE desktop environment does this out of the box (I think back to opening an Xaw application like xfontsel and it being dark to match my dark theme), but in standalone window managers how could this be achieved?


----------



## Holger (Sep 25, 2022)

You can change settings of these kinds of applications in the file `~/.Xdefaults`. They are called “X-resources”.

For example, here is how I configure `x11/rxvt-unicode`:

```
URxvt*font: -*-terminus-medium-*-*-*-*-140-*-*-*-*-iso8859-1
URxvt*boldFont: -*-terminus-bold-*-*-*-*-140-*-*-*-*-iso8859-1
URxvt*foreground: lightGray
URxvt*background: black
URxvt*scrollBar_right: True
URxvt*iconFile:  /usr/local/share/icons/Adwaita/48x48/legacy/utilities-terminal.png
URxvt*color0: #000000
URxvt*color1: #705050
URxvt*color2: #60B48A
…
```

To find out which settings are available for a particular application, you best look into the man-page of the application in question and look out for a section called “X-Resources”.

For Motif-based applications there are certain X-resources which are common to all of them, like `background`, `foreground`, etc. For example, to set the `background` resource for all such applications, add this to your `.Xdefaults` file:

```
*background: grey
```

I am not sure where these common X-resources are properly documented. My best bet would be the series “The Definite Guide the X Window system”, especially Volume Six A: “Motif Programming Manual”. They are freely available as PDF nowadays, I think.


----------



## sidetone (Sep 25, 2022)

In a recent thread, x11/xprop used with `grep` was mentioned as a way to get the name and (if available) class of an application. This is useful for ~/.Xdefaults.


meine said:


> on those windowname and windowclass,
> 
> how could I best obtain them? I tried x11/xprop but can't always find the proper name and class. Maybe there is a better way (?)





laurentis said:


> I usually use `xprop | grep WM_CLASS` to extract this information. I'm not aware if there are any easier method.


This is great, because it eliminates a lot of guesswork for this configuration.


https://forums.freebsd.org/threads/howto-jwm-configuration.59265/#post-556236 is one, but for a specific window manager of JWM using its configuration file for themes. That may give a hint for using themes on another window manager. This last example may be too specific.


----------

