You are not logged in.
Hi all
I am trying to make Xfce4 honour my custom DPI for my laptop.
It does not get it automatically since Nvidia + Prime seem to fail to publish it properly.
I managed to initialize Prime in following script called init_prime.sh
===============================================
...
# set dpi for fonts at login screen
xrdb -merge /etc/X11/Xresources/* >>$LOG 2>&1
# NVidia prime init for login screen
xrandr --setprovideroutputsource modesetting NVIDIA-0 >>$LOG 2>&1
xrandr --auto >>$LOG 2>&1
================================================
My /etc/X11/Xresource/xfont file contains just:
Xft.dpi: 266
denis@devuan-nb:~$ cat ~/.Xresources
Xft.dpi: 266
So far so good. LightDm now starts fine with proper font size.
However after logging into Xfce4 session my DPI gets overwritten somewhere.
Even though I try to change it back in ~/.config/xfce4/xinitrc. See below.
#!/bin/bash
LOG=~/autostart.log
echo "=====================" >>$LOG 2>&1
date >>$LOG 2>&1
echo "Setting DPI" >>$LOG 2>&1
xrandr --dpi 266 >>$LOG 2>&1
echo "Merging ~/.Xresources" >>$LOG 2>&1
xrdb -merge ~/.Xresources >>$LOG 2>&1
#xset b off
echo "Starting yeahconsole" >>$LOG 2>&1
DISPLAY=:0 yeahconsole >>$LOG 2>&1 &
# sync clipboards
echo "Starting clipboard autosync" >>$LOG 2>&1
autocutsel -fork -selection CLIPBOARD
autocutsel -fork -selection PRIMARY
echo "xdpyinfo" >> $LOG
xdpyinfo | grep -B 2 resolution >>$LOG 2>&1
# set dpi for fonts at login screen
echo "xrdb" >> $LOG
xrdb -query | grep dpi >>$LOG 2>&1
echo "Other xfce4 init" >>$LOG 2>&1
. /etc/xdg/xfce4/xinitrc
===================================================
Log shows DPI equals to 266 before ". /etc/xdg/xfce4/xinitrc" line.
However after session starts:
denis@devuan-nb:~$ xrdb -query |grep dp
[empty]
denis@devuan-nb:~$ xdpyinfo | grep -B 2 resolution
screen #0:
dimensions: 3840x2400 pixels (1016x635 millimeters)
resolution: 96x96 dots per inch
denis@devuan-nb:~$ sudo apt policy xfce4
xfce4:
Installed: 4.16
Candidate: 4.16
Version table:
*** 4.16 500
500 http://deb.devuan.org/merged chimaera/main amd64 Packages
100 /var/lib/dpkg/status
Any help?
BR,
Denis
Last edited by MageSlayer (2022-04-05 10:54:05)
Offline
Hello and welcome.
xfsettingsd will be overwritting that. Xfce sets the DPI at Settings Manager > Appearance > Fonts. Is it enabled there and what is set to?
You can try disabling (unchecking) the value to see if it uses the one that you specify, or try changing it to 266 to see if that helps.
Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki | Community | Contribute ---
Online
Yes. I found that option. It corresponds to ~/.Xresources, right?
However, it does not help. Windows are still scaled incorrectly, icons are tiny.
Is it also the cause for overriding xdpyinfo?
Offline
A bit of a rabbit's hole here.
Start with https://bugzilla.xfce.org/show_bug.cgi?id=10633 and https://bugzilla.xfce.org/show_bug.cgi?id=14236. A dpi value of 96 is hardcoded into xfce4-settings. So when xfsettingsd starts up, it overwrites that value.
This leads to this report and merge request which was approved and pushed in June of 2020 to the 4.16 tree. However, it was reverted 2 months later (https://git.xfce.org/xfce/xfce4-setting … d508c3bf66. Unfortunately, the reference points to an incorrect bug, so its unclear as to why it was reverted.
You may want to create a new bug report asking why it was reverted.
As a workaround, you could also try creating an application autostart entry that runs something like this:
bash -c "sleep 3 && xrandr --dpi 266"
...adjust the sleep value to a value that will execute after xfsettingsd starts.
Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki | Community | Contribute ---
Online
Offline
Unfortunately, the reference points to an incorrect bug, so its unclear as to why it was reverted
I got this issue, which seems to be fully related to described behaviour:
https://gitlab.xfce.org/xfce/xfce4-sett … issues/190
It's just made by different author than reverting commit.
For proposal - I have better idea, preserving autodetected DPI before modification and restoring after:
https://gitlab.xfce.org/xfce/xfce4-sett … note_61438
Offline
[ Generated in 0.009 seconds, 7 queries executed - Memory usage: 546.22 KiB (Peak: 547.06 KiB) ]