Xresources and scaling

Hi Community,

I have a question about the BSPWM edition and scaling. My 4K monitor shows everything clearly too small (factor 2 would probably make sense). I read in a post here that I can adjust this in .Xresources. Unfortunately I can’t find the file ( ~./Xresources). This is probably a stupid question, but where is the file or do I have to create it first?

Thank you very much!

Small typo in your post, the location should be at;

If you don’t have that file, you can generate it like so;
xrdb ~/.Xresources

Thank you for your answer. Yes, that was a typo. Sorry!

xrdb ~/.Xresources
Strangely enough, it does not create the file but only reports that it does not exist and can´t open it. I don’t get any other result with sudo either.
sudo xrdb ~/.Xresources

Am I doing something wrong?

Oh, well in that case you can just create the file yourself. You don’t need sudo permissions if it’s in your home directory.

mhh any idea what I can do then to get the config or alternatively what other options I have to change the scaling to see something on a 4k screen?

There’s an example config here that might help with a high DPI display:

Thanks a lot! It worked :slight_smile:

1 Like

I have a related question, some programmes do not scale due to the change. I have fixed this individually for the most part. Rofi, however, does not want to work. I have used rofi.dpi: XXX in ~/.Xresources for this. Unfortunately, Rofi is not affected by this. Is there another way to change the size? This concerns the “dmenu” and the power menu. Thanks again!

There is another way I know of…
You can change the font size in the .rasi files ( ~/.config/rofi/ ), e.g.

in powermenu.rasi →

configuration {
    font:                           "Sourcecode Pro Regular 26";
window {
    width:                          260px;

in rofidmenu.rasi → change fontsize there: …
in rofikeyhint.rasi → change fontsize and here too: …

I change the resolution at startup (similar but with fractional scaling)
( source: https://ricostacruz.com/til/fractional-scaling-on-xorg-linux )

# screen settings here i3 config
# exec --no-startup-id xrandr --output eDP --dpi 243 # my screen is 2880x1800
exec --no-startup-id xrandr --output eDP --scale '1.14x1.14' # scaling 175% (needs update?)
exec --no-startup-id xrdb ~/.Xresources # ensure Xresources been loaded

the .Xresources (don’t forget to update the cursor sizes in the gtk-2 and gtk3/settings too)

Xcursor.theme: capitaine-cursors-light
Xft.dpi: 243
Xcursor.size: 46


# HiDPI-Settings
export GDK_SCALE=2
#export GDK_SCALE=1.75
export GDK_DPI_SCALE=0.5
export QT_FONT_DPI=243
#export QT_FONT_DPI=96
# Env-Exports

I hope the additional details are working in your favor.

Best regards

1 Like

Thank you for your comprehensive post! Awesome!

Can you tell me in which file you adjust this step?

Of course, it’s the i3 config file.
I believe with BSPWM you have a similar file, bspwmrc (?).
You can use the same command without the exec --no-startup-id and of course you also would need to change the --output --scale to whatever suits your hardware.

If you want to learn more about this topic you can read these link1 link2.

Thank you again!
Either I’m just too stupid or I’m missing something… Neither the cursor changes nor is rofi affected.

Unfortunately, I can’t find rofidmenu.rasi and rofikeyhint.rasi. I have edited powermenu.rasi like all the other things, but unfortunately without any effect.

Do both rasi files have to be created first?

I am really sorry!

If your Distro does not come with that .rasi file you probably won’t need it necessarily.
But you can always make one if you want to…

Have you corrected the fontsize in the powermenu.sh (line 19)?

Have you added your cursor size (e.g.gtk-cursor-theme-size=46) in .config/gtk-3.0/settings.ini (line 6)?

If you think it is related to gtk-2.0 have you added a .gtkrc-2.0-File in your root directory (and adjusted the cursor settings)?

If you think it is a Bug or something was not properly implemented … you can post the bug in the bug report area.

If you’re new to BSPWM (link to Community-Edition-Repo.)

I can also link you the Arch-Wiki-Link and hope you get it working.

This is all I got.
Best regards

And once again, many thanks!

In fact, I had not changed the size in powermenu.sh. This has now led to the fact that it works with powermenu. Unfortunately, dmenu is still small. I have changed several things in config.rasi (which has the same content as rofidmenu.rasi on i3). Neither the change in font nor the font size had any effect on the dmenu.
Even the mouse pointer is still small in Firefox, for example (but it works in almost all cases).
However, I think it is more likely to be my fault than a bug.I will work on it again next weekend.

Thanks a lot for your help :slight_smile:

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.