[SOLVED] 4K monitor/DPI/scaling

#1

Hey guys.

I’ve been using my new 4K monitor on Bspwm awhile and got things almost sorted out (custom fonts in xresources), set Polybar bigger and stuff. Some elements are still very small, for example navigation buttons in PCManFM (same with Thunar) and Pamac, in Spotify everything is small. Could it be a GTK thing or something else like that?

The system is usable as is, but it would be nice to fix those little things also.

EDIT: I tried to change DPI with xrandr, but it did nothing.

#2

@Dobbie03 you got this one? With your dueling 4k monitors, help the fellow out :wink:

#3

How exactly did you attempt this?

I think ArchLabs has a DPI setting in ~/.Xresources but that won’t apply to all applications.

The ArchWiki has a page dedicated to HiDPI:

https://wiki.archlinux.org/index.php/HiDPI

For simple window managers I think the best option might be setting the display size explicitly with an Xorg configuration file but I don’t have any HiDPI screens so I’m not completely sure.

#4

I recently got a 4k panel and to get everything looking nicely I do the following

~/.zprofile

exec startx -- -dpi 144

~/.xinitrc

echo 'Xft.dpi: 144' | xrdb

I use a 20px font with xft settings like this

xos4 Terminus:pixelsize=20:hinting=false:antialias=false

I don’t really use many gui applications aside from a browser and steam (both of which have their own way of handling it), so below is purely copy/paste from the wiki’s hidpi page. Also worth noting the panel I have is 28" so the default scale of most applications after setting xft dpi is perfectly usable.


For gtk2 has no way to set scaling so you’ll have to make a custom theme.

For gtk3

export GDK_SCALE=2          # UI scale
export GDK_DPI_SCALE=0.5    # text scale

For Qt

export QT_AUTO_SCREEN_SCALE_FACTOR=1  # can cause issues with text size
2 Likes
#5
xrandr --output YOUR_OUTPUT --auto --dpi 144
#6

Nate beat me to it! Was in a bit of a heavy slumber :smiley:

#7

Oomox the theme creator gives you the option to adapt the gtk2 assets of the theme for a hidpi screen. I personally haven’t used it as I found it a little unreliable @eesau it might be worth trying that for you though.

#8

Did those, nothings changed.

I added earlier this section (copied from this forum, just tweaked it a bit) to my Xresources:

!--------------------------------------------
! Custom DPI
!--------------------------------------------
!Xft.dpi: 144
Xft.dpi: 165
Xft.autohint: 0
Xft.lcdfilter: lcddefault
Xft.hintstyle: hintslight
Xft.hinting: true
Xft.antialias: 1
Xft.rgba: rgb

Xcursor.size: 32

That works fine, but like someone said, it doesn’t apply to all apps.

I don’t know, maybe things are ok as is. Spotify is a bummer though, i use it pretty much.

#9

Spotify you will need to launch with the scaling flag

https://wiki.archlinux.org/index.php/Spotify#HiDPI_Mode

1 Like
#10

I feel like you didn’t read the hidpi wiki page linked by HaoS above, as it has a small section dedicated to just this
https://wiki.archlinux.org/index.php/HiDPI#Spotify

Regarding GDK_* scaling settings, as described it doesn’t do anything for gtk2 applications, install

pcmanfm-gtk3

to have it work or that particular file manager.

Likewise you can grab the Qt version and use the Qt scale setting described above and in the wiki page.

Sadly this is just the state of things, Xft settings will only get you as far as it’s adoption and not everything uses it, luckily there is enough application specific configuration to get it usable (at least in my case)

1 Like
#11

Sorry, my concentration levels are very low. Certainly not my strongest point these days.

Yes, Spotify is ok now. Thanks! I don’t know what’s wrong with PCManFM, but changing to gtk3 -version didn’t help. I’ll check things tomorrow if feel sharper.

#12

Messed somehow with this. Did it again and now things are fine, no microscopic buttons anywhere to be seen. :sunglasses:

Thanks!