Sample Header Ad - 728x90

Unix & Linux Stack Exchange

Q&A for users of Linux, FreeBSD and other Unix-like operating systems

Latest Questions

4 votes
1 answers
8831 views
How do I make all GTK applications use a custom DPI setting?
After upgrading from Debian 8 to Debian 9, the text editor Pluma (a Gedit fork) no longer use my custom DPI setting. I noticed the same thing with the editor Geany. Here are my Xft settings in `~/.Xresources`: Xft.antialias: true Xft.autohint: false Xft.dpi: 100 Xft.hinting: true Xft.hintstyle: hint...
After upgrading from Debian 8 to Debian 9, the text editor Pluma (a Gedit fork) no longer use my custom DPI setting. I noticed the same thing with the editor Geany. Here are my Xft settings in ~/.Xresources: Xft.antialias: true Xft.autohint: false Xft.dpi: 100 Xft.hinting: true Xft.hintstyle: hintslight Xft.lcdfilter: lcddefault Xft.rgba: rgb The other Xft settings above are picked up Pluma, however. On the other hand, the text editor Leafpad correctly uses the DPI setting. Any clues? I use the window manager Blackbox started from a console. Pluma (with DejaVu Sans 10): enter image description here Leafpad (with DejaVu Sans 10): enter image description here
August Karlstrom (1986 rep)
Jun 21, 2017, 10:32 AM • Last activity: Jul 11, 2025, 09:05 AM
9 votes
1 answers
7505 views
Multi-DPI screen scaling with Wayland on Fedora 24
I'm playing around with Wayland (on Fedora 24) and multi-DPI screens. With X, I am setting my secondary non-HDPI screen to scaled with ```sh xrandr --output eDP-1 --auto --output DP-1-8 --auto --panning 3840x2400+3840+0 --scale 2x2 --right-of eDP-1 ``` How can I make my secondary monitor scale with...
I'm playing around with Wayland (on Fedora 24) and multi-DPI screens. With X, I am setting my secondary non-HDPI screen to scaled with
xrandr --output eDP-1 --auto --output DP-1-8 --auto --panning 3840x2400+3840+0 --scale 2x2 --right-of eDP-1
How can I make my secondary monitor scale with Wayland or achieve a reasonable experience on multi-DPI screens with Wayland?
Ben Flowers (181 rep)
Oct 12, 2016, 03:43 PM • Last activity: Apr 13, 2025, 02:03 PM
0 votes
2 answers
91 views
What's the proper way to specify the image resolution of a scanned and postprocessed PNG file in its metadata?
What's the proper way to specify the image resolution of a scanned and postprocessed PNG file in its metadata? We currently use this command: ```bash $ exiftool -o outfile.png \ -Title="Title of the scanned document" \ -XResolution=1200 \ -YResolution=1200 \ -ResolutionUnit=inches \ -PixelsPerUnitX=...
What's the proper way to specify the image resolution of a scanned and postprocessed PNG file in its metadata? We currently use this command:
$ exiftool -o outfile.png \
           -Title="Title of the scanned document" \
           -XResolution=1200 \
           -YResolution=1200 \
           -ResolutionUnit=inches \
           -PixelsPerUnitX=47244.09 \
           -PixelsPerUnitY=47244.09 \
           -PixelUnits=meters infile.png
    1 image files created
$ exiftool outfile.png
…
Pixels Per Unit X               : 47244
Pixels Per Unit Y               : 47244
Pixel Units                     : meters
Exif Byte Order                 : Big-endian (Motorola, MM)
X Resolution                    : 1200
Y Resolution                    : 1200
Resolution Unit                 : inches
Y Cb Cr Positioning             : Centered
…
Ignoring the part that sets the title (which we included just because we do this all the time anyway), is this the right way to specify the image resolution or density, or are some parts superfluous or even completely useless, or is anything missing? In case *Pixels Per Unit {X|Y}* are needed (which programs use it over *{X|Y} resolution* ?), we wish to be more precise and specify 1200 dpi × (100/2.54 inch/m) = 6000000/127 dots/m or, in decimal notation, with some reasonable precision, say, ≈ 47244.094488188976378 dots/m in *Pixels Per Unit {X|Y}*.
AlMa1r (1 rep)
Feb 14, 2025, 04:01 AM • Last activity: Feb 16, 2025, 05:36 PM
1 votes
1 answers
2060 views
How to reload font file configuration in KDE5 plasma
I'm trying to set font config in file `~/.config/kcmfonts` cat > ~/.config/kcmfonts /dev/null & kwin_x11 --replace &>/dev/null & But this gives no effects. How to reload this settings from command line? It's equivalent to plasma 5.19 `System Settings → Appearance → Font → Fonts → Force fonts DPI`
I'm trying to set font config in file ~/.config/kcmfonts cat > ~/.config/kcmfonts /dev/null & kwin_x11 --replace &>/dev/null & But this gives no effects. How to reload this settings from command line? It's equivalent to plasma 5.19 System Settings → Appearance → Font → Fonts → Force fonts DPI
Kuba (111 rep)
Nov 24, 2020, 08:10 AM • Last activity: Nov 13, 2024, 06:05 AM
5 votes
1 answers
302 views
X Logical Font Description and HiDPI
**The problem**: X-server serves fonts at a fixed resolution of **100dpi**, rather than the current window system resolution (`xdpyinfo | grep -F resolution`). **A bit of theory**. There are legacy server-side fonts which are sent to X clients over the network (via TCP or UNIX socket) either by the...
**The problem**: X-server serves fonts at a fixed resolution of **100dpi**, rather than the current window system resolution (xdpyinfo | grep -F resolution). **A bit of theory**. There are legacy server-side fonts which are sent to X clients over the network (via TCP or UNIX socket) either by the X server itself, or by a separate _X Font Server_ (single or multiple). Unlike the usual client-side fonts (Xft, GTK 2+, Qt 2+), the "server" backend (also called the _core X font_ backend) does not support anti-aliasing, but supports network transparency (that is, bitmaps, without any alpha channel, are sent over the network). At the application level, server-side fonts are specified not as an [XftFontStruct](https://keithp.com/~keithp/talks/xtc2001/paper/) (which most often translates into the familiar DejaVu Sans Mono:size=12:antialias=true), but as an [_XLFD_](https://wiki.archlinux.org/index.php/X_Logical_Font_Description) . If we are talking about a local machine, then the same font file can be registered in both font backends at once and be available to both modern GTK and Qt-based applications, and legacy ones (Xt, Athena, Motif, GTK 1.2, Qt 1.x). Historically, there were raster server-side fonts (*.pcf), and a raster has a resolution of its own (not necessarily the same as the window system resolution). Therefore, XLFD has fields such as RESOLUTION_X and RESOLUTION_Y. For a raster font not to look ugly when rendered onto the screen and still have the requested rasterized glyph size (PIXEL_SIZE), the raster resolution must be close to the screen resolution, therefore raster fonts were usually shipped with native resolutions of **75dpi** and **100dpi** (that's why we still have directories such as /usr/share/fonts/X11/75dpi and /usr/share/fonts/X11/100dpi). So, the below lines represent the same 12 pt font
-bitstream-charter-bold-r-normal--12-120-75-75-p-75-iso8859-1
-bitstream-charter-bold-r-normal--17-120-100-100-p-107-iso8859-1
with a rasterized glyph size of * **12px** at **75dpi**, and * **17px** at **100dpi**, respectively. But, in addition to raster fonts, there are vector, or outline fonts (_TrueType_, _OpenType_, _Adobe Type 1_), which can be scaled by any factor and still look good when rendered onto the screen. Some X-server implementations (notably, _XSun_) also supported the _Adobe Type 3_ format, where glyphs were described using the Turing-complete _PostScript_ language. Of course, the concept of raster resolution does not apply to vector fonts, so I can request zeroes (0) or even asterisks (*) in the RESOLUTION_X and RESOLUTION_Y fields, and, in theory, my X server should give me exactly the font requested. This is directly stated in the _Arch Linux Wiki_ article at the link above: > Scalable fonts were designed to be resized. A scalable font name, as shown in the example below, has zeroes in the pixel and point size fields, the two resolution fields, and the average width field. > > ... > > To specify a scalable font at a particular size you only need to provide a value for the POINT_SIZE field, the other size related values ​​can remain at zero. The POINT_SIZE value is in tenths of a point, so the entered value must be the desired point size multiplied by ten. So, either of the following two queries should return a **12pt** Courier New font at the window system resolution:
-monotype-courier new-medium-r-normal--*-120-*-*-m-*-iso10646-1
-monotype-courier new-medium-r-normal--0-120-0-0-m-0-iso10646-1
**Or so I thought**. The thing is, after migration from 96...115dpi monitors to a **162dpi** 4k monitor, I noticed that my carefully selected vector fonts suddenly became too small. And it turned out that unless you explicitly set RESOLUTION_X and RESOLUTION_Y fields to **162** (and no one in his right mind would do so -- it would require rewriting dozens of Xresources lines every time one changes his monitor), then X server defaults to rendering the font at **100dpi** instead of **162**. The difference between **17** and **27** pixels (the factor of 1.62 = 162 / 100) is quite noticeable. Here's an example for a modern _Debian 10_ box: Debian 10, Courier New 12pt at 162dpi I thought this regression was a consequence of people gradually cutting out obsolete subsystems from X11, but in _Debian Woody_, released in 2002 and having a 2.2 kernel, I saw exactly the same thing: Debian 3, Courier New 12pt at 162dpi The only difference is that _Debian Woody_ renders fonts in a "cleaner" manner, apparently, applying hinting on the server side, before sending bitmaps over the network. So this is not a regression. The problem has always been there and equally affects all vector font types (_TrueType_, _OpenType_, _Type 1_). **Now, the question**. Is there a way, without hard-coding window system resolution into user settings for each individual resource, to get by with less pain than recommended by the author of the [_Sharing Xresources between systems_](https://jnrowe.github.io/articles/tips/Sharing_Xresources_between_systems.html) article? Is it possible to solve the problem by changing the global configuration of the X server itself or the libraries it relies on (libfreetype, libxfont)?
Bass (281 rep)
Feb 3, 2021, 11:30 AM • Last activity: Nov 1, 2024, 08:51 PM
4 votes
2 answers
3925 views
Is X DPI (dot per inch) setting just meant for text scaling?
On Linux the DPI (dot per inch) is set to `96` per default, it can be changed globally on the `X` start up parameter for instance `X -dpi 120` This seem to **mainly impact** text/font scaling. In comparison when screen resolution (ex 1920x1080) is changed this impact everything (window/text/image/et...
On Linux the DPI (dot per inch) is set to 96 per default, it can be changed globally on the X start up parameter for instance X -dpi 120 This seem to **mainly impact** text/font scaling. In comparison when screen resolution (ex 1920x1080) is changed this impact everything (window/text/image/etc). **Is DPI meant only for text scaling?**
intika (15066 rep)
Jul 4, 2020, 11:24 PM • Last activity: Oct 31, 2024, 11:27 PM
31 votes
3 answers
41668 views
How to get the DPI of an image file (PNG)
If I export an image with lets say 300 DPI and I read out its meta-info with any application that can do it (like `file`, `exiftool`, `identify`,`mediainfo` etc.), I always get a value showing Image-Width and Image-Height. In this case: `2254 x 288` how do I get the 300 DPI value, or the correspondi...
If I export an image with lets say 300 DPI and I read out its meta-info with any application that can do it (like file, exiftool, identify,mediainfo etc.), I always get a value showing Image-Width and Image-Height. In this case: 2254 x 288 how do I get the 300 DPI value, or the corresponding value from any other image file? Since in my case the proportional value of Image-Width and Image-Height does not matter I want to be able to check the resolution of any image to be able to compile new images with the same quality independent of their proportion, since this varies on every file. For my workflow I'm especially interested in any command line solution, though any others are of course highly appreciated too.
nath (6094 rep)
Nov 23, 2017, 02:35 AM • Last activity: Nov 3, 2022, 10:32 AM
3 votes
0 answers
2195 views
Gnome + i3wm on a 4K display - ruined my DPI scaling in Gnome
I have an issue with the user interface scaling under Gnome 3.38. I am using it only on the internal display of a Dell XPS 15 inch laptop with a 2160p 4K display. Nvidia dGPU with proprietary driver. Wayland is disabled, I'm on a standard xorg session. Before installing the i3 window manager, the UI...
I have an issue with the user interface scaling under Gnome 3.38. I am using it only on the internal display of a Dell XPS 15 inch laptop with a 2160p 4K display. Nvidia dGPU with proprietary driver. Wayland is disabled, I'm on a standard xorg session. Before installing the i3 window manager, the UI Scaling setting in gnome-settings worked as expected and applied to all the UI elements. Today I installed i3. Since the standard configuration of i3 left all the fonts unscaled and tiny, I created a new file ".Xresources-i3wm" in my home directory with the following content:
Xft.dpi: 192
Xft.autohint: 0
Xft.lcdfilter: lcddefault
Xft.hintstyle: hintfull
Xft.hinting: 1
Xft.antialias: 1
Xft.rgba: rgb
Xcursor.size: 80
For i3wm to load this configuration on login, I modified the i3-config under ~/.config/i3/config, adding the following line: exec_always --no-startup-id "xrdb -merge ~/.Xresources-i3wm" That works and the window manager now launches with the correct *2 scaling on login. After logging into a Gnome session again, SOME elements of the UI did not scale correctly anymore. Affected Shell elements are: The Gnome Top Bar font size, button font sizes, window title bar font sizes and app-icon font sizes in the Gnome App Launcher. Also I've noticed that Java Swing GUI Applications with Gtk+ Look and Feel do not recognize that "Scale" under gnome-settings->Displays is already set to 200%. They now scale to double the size (400%) since "GDK_SCALE=2" is set as an environment variable. I was able to workaround the issue by doubling the Fontsizes in the Gnome Shell Theme *.CSS file. That fixed the Top Bar and App Launcher fonts, but not the ones on windows's title bars. If I export $GDK_SCALE=1 and launch a Java App with Gtk+, I get the correct scaling but afterwards the $GDK_SCALE is automatically set to 2 again, for whatever reason. Since this occured, I reset my dconf, switched Themes back and forth using gnome-tweaks, switched resolution back and forth, rebooted the system several times and played with "xrandr --dpi" setting. All of this didn't help, it looks like i3wm and me screwed up the DPI scaling within Gnome. This is the output of "xrdb -query -all" for me, under Gnome right now:
Xft.dpi: 192
Xft.antialias: 1
Xft.hinting: 1
Xft.hintstyle: hintslight
Xft.rgba: rgb
Xcursor.size: 96
Xcursor.theme: Adwaita
I hope somebody can help me out with this. Thanks in advance, Euda
Euda (31 rep)
Mar 21, 2021, 08:52 AM • Last activity: Apr 13, 2022, 11:15 AM
14 votes
6 answers
17883 views
Multiple monitors HiDPI scaling
I have a Dell p2715q 27" 4K monitor and a HP 23xi pavilion 23" 1080p monitor for my dual monitor setup. The Dell monitor is currently running at a resolution of 3840x2160 @ 60Hz, while the HP is running at 1920x1080 @ 60Hz. When I initially setup the monitors on my desktop computer, which is running...
I have a Dell p2715q 27" 4K monitor and a HP 23xi pavilion 23" 1080p monitor for my dual monitor setup. The Dell monitor is currently running at a resolution of 3840x2160 @ 60Hz, while the HP is running at 1920x1080 @ 60Hz. When I initially setup the monitors on my desktop computer, which is running Linux Mint 17.3 Cinnamon (version 2.8.6) 64-bit, the scaling on the Dell was still set at 1, so everything was really tiny in comparison to the HP, which was scaling everything appropriately since it is not a HiDPI monitor like the Dell. When I changed the scaling to 2, everything on the Dell looked great, but the HP now makes everything twice as large. Is there a way to scale the HiDPI Dell monitor at 2x, while keeping the HP monitor at 1x to make everything on both screens scale properly?
Isaac Mast (141 rep)
Jan 5, 2016, 05:49 PM • Last activity: Feb 19, 2022, 04:53 AM
1 votes
0 answers
167 views
Two monitors with same resolution but very different DPI
I am using Manjaro on a Lenovo P51. The internal monitor is 1080p and so is the external. However, the internal is 144 dpi and the external 70 dpi. I run KDE and global scaling is set to 150% which makes the icons, etc. a pleasing size for me. The NVIDIA GPU uses nouveau ``` ➜ ~ lspci -k | grep -B 2...
I am using Manjaro on a Lenovo P51. The internal monitor is 1080p and so is the external. However, the internal is 144 dpi and the external 70 dpi. I run KDE and global scaling is set to 150% which makes the icons, etc. a pleasing size for me. The NVIDIA GPU uses nouveau
➜  ~ lspci -k | grep -B 2 nouveau
01:00.0 3D controller: NVIDIA Corporation GM107GLM [Quadro M1200 Mobile] (rev a2)
        Subsystem: Lenovo Device 224d
        Kernel driver in use: nouveau
and the Intel GPU uses i915
➜  ~ lspci -k | grep -B 2 i915 
00:02.0 VGA compatible controller: Intel Corporation HD Graphics 630 (rev 04)
        Subsystem: Lenovo Device 224d
        Kernel driver in use: i915
The Optimus setup is this:
➜  ~ xrandr --listproviders 
Providers: number : 2
Provider 0: id: 0x43 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 3 outputs: 1 associated providers: 1 name:modesetting
Provider 1: id: 0x80f cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 4 outputs: 3 associated providers: 1 name:modesetting
I have looked at a great number of answers and recommendations, but when I include --scale 2x2 the frame buffer grows, but the external monitor only displays the upper left quarter. How can one get the scaling on the external monitor in this case?
Marko (155 rep)
Oct 11, 2021, 03:50 PM
0 votes
1 answers
234 views
Canon printer driver: low DPI
My printer (Canon G7050) can print up to 4800 x 1200 dpi. However, the linux driver I got from Canon is set to 600 dpi only: *OpenUI *Resolution/Output Resolution: PickOne *de.Translation Resolution/Output Resolution: PickOne: "" *fr.Translation Resolution/Output Resolution: PickOne: "" *zh.Translat...
My printer (Canon G7050) can print up to 4800 x 1200 dpi. However, the linux driver I got from Canon is set to 600 dpi only: *OpenUI *Resolution/Output Resolution: PickOne *de.Translation Resolution/Output Resolution: PickOne: "" *fr.Translation Resolution/Output Resolution: PickOne: "" *zh.Translation Resolution/Output Resolution: PickOne: "" *ja.Translation Resolution/Output Resolution: PickOne: "" *DefaultResolution: 600dpi *Resolution 600dpi/600 dpi: ">setpagedevice" *de.Resolution 600dpi/600 dpi: ">setpagedevice": "" *fr.Resolution 600dpi/600 dpi: ">setpagedevice": "" *zh.Resolution 600dpi/600 dpi: ">setpagedevice": "" *ja.Resolution 600dpi/600 dpi: ">setpagedevice": "" *CloseUI: *Resolution - Could you confirm that I lose potential printing quality with this PPD? - Can I manually add new DPI settings?
jfk (45 rep)
Jul 1, 2021, 07:35 AM • Last activity: Jul 1, 2021, 01:07 PM
5 votes
1 answers
2183 views
Losslessly change the dpi value of a JPEG on Linux
How can I change the `dpi` value recorded in a JPEG file without actually touching anything else, nor recompressing the image? Linux compatible solutions are welcome. [This 2011 link][1] says we may not have had a tool to do it back then... [1]: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=6183...
How can I change the dpi value recorded in a JPEG file without actually touching anything else, nor recompressing the image? Linux compatible solutions are welcome. This 2011 link says we may not have had a tool to do it back then...
Totor (21020 rep)
Jan 4, 2016, 02:41 PM • Last activity: Mar 25, 2021, 11:44 AM
1 votes
1 answers
2096 views
How to scale down PDF file (in pixels and in cm)?
I need to automatically convert my pupils' solutions which are photos and scans of various orientations, resolution, quality and file format into a single PDF with fitting dimensions. The dimensions in cm should be approximately A4 such that Xournal++, which I use for annotating the PDFs, uses a sui...
I need to automatically convert my pupils' solutions which are photos and scans of various orientations, resolution, quality and file format into a single PDF with fitting dimensions. The dimensions in cm should be approximately A4 such that Xournal++, which I use for annotating the PDFs, uses a suiting pen thickness, see https://github.com/xournalpp/xournalpp/issues/2424 The dimensions in pixels should be such that the content is not blurry on one hand but Xournal++ is not hanging because of too large file size on the other hand. Currently, I scale down PDF files with ps2pdf if they are larger than 5MB and individual image files (which later are merged into a PDF) if they are larger than 1,5MB. Also I set the size in cm to A4 (see link above). However, some of the files are still too large in terms of pixels, though the file size and the dimensions in cm are fine, so Xournal++ hangs a lot on them. I tried to set the DPI to 120 (155 would be A4 width on 1280px) but still get pages with 3000x4000 px. Here is my complete script: https://pastebin.com/jHxhUJvN What did I mess up? Thanks for any input!
Photon (119 rep)
Feb 28, 2021, 11:25 AM • Last activity: Feb 28, 2021, 07:03 PM
5 votes
1 answers
4325 views
Change xfce4-settings:appearance (dpi scaling) options via terminal
I want to set the dpi scaling in **xfce4-settings:appearance** via bash script, so that I can bind it to a key shortcut. In the official docs I can only find the method to change it via GUI. Is there a terminal command to set the dpi value? Thanks for help! Basti
I want to set the dpi scaling in **xfce4-settings:appearance** via bash script, so that I can bind it to a key shortcut. In the official docs I can only find the method to change it via GUI. Is there a terminal command to set the dpi value? Thanks for help! Basti
Sebastian Hoelzl (153 rep)
Jun 17, 2018, 08:59 AM • Last activity: Jan 28, 2021, 04:13 PM
10 votes
3 answers
18322 views
Who is setting the Xresource Xft.dpi?
We recently received new laptops with a 2160p display. I received it with Ubuntu 16.04 installed with the Unity desktop. I've since installed and use Xfce 4, but kept the Unity greeter (because pretty). I fully expected to see font scaling issues with the high-DPI display, but something has set the...
We recently received new laptops with a 2160p display. I received it with Ubuntu 16.04 installed with the Unity desktop. I've since installed and use Xfce 4, but kept the Unity greeter (because pretty). I fully expected to see font scaling issues with the high-DPI display, but something has set the Xresource Xft.dpi to 192, rather than the typical 96. This is picked up by nearly all applications, making the internal display mostly usable. 10 out of 10, right? Well, no, because I can't figure out where this is being set. Xfce's appearance panel claims the DPI is 96. dconf variables where they exist also show 96. xdpyinfo also says it's 96. Xorg.0.log has one message regarding DPI, and says it's 96. lightdm.conf (configuration file for the Unity greeter) shows no attempt to change it. And xrandr is reporting an identity transformation matrix (no scaling). My suspicion is that either GNOME or the Unity greeter are the culprit, since the greeter starts out rendered in Flyspeck 3, but then rescales itself after a moment. But I can't figure out where it was told to do this, or how it persists to the desktop session. My goal is to plug in an external 1080p display and tweak the DPI such that both displays are vaguely legible. But I can't effectively do that if I'm fighting with something else trying to do it behind my back. All clues welcome. ### System Info ### - Ubuntu 16.04.3 - unity 7.4.0+16.04.20160906-0ubuntu1 - xorg 1:7.7+13ubuntu3 - xfce 4.12.2
ewhac (1043 rep)
Aug 30, 2017, 08:26 PM • Last activity: Oct 9, 2020, 02:36 PM
2 votes
1 answers
1215 views
How to determine what entity changes Xorg DPI settings?
I've installed Xubuntu 19.04, and to account for my laptop's screen resolution, in `/etc/lightdm/lightdm.conf` I've added the line ``` xserver-command=X -dpi 166 ``` The result is that XFCE panel, terminal and other GTK2 and GTK3 programs take on the correct font sizes (the same as if I had set _Cus...
I've installed Xubuntu 19.04, and to account for my laptop's screen resolution, in /etc/lightdm/lightdm.conf I've added the line
xserver-command=X -dpi 166
The result is that XFCE panel, terminal and other GTK2 and GTK3 programs take on the correct font sizes (the same as if I had set _Custom DPI setting_ in _Appearance_→_Fonts_ to 166), but all the others like e.g. Yakuake still see 96 DPI. Moreover, if I try xdpyinfo, I do get this 96 DPI:
$ xdpyinfo | grep dot
  resolution:    96x96 dots per inch
Also, if I tick and untick back the _Custom DPI setting_ option, the fonts shrink back in XFCE too (apparently, DPI gets re-queried from X server). So I suspect that, during session startup, some entity changes the screen DPI setting as if by running xrandr --dpi 96. If I manually run xrandr --dpi 166, programs start behaving correctly. I'd like to find out what exactly entity is doing this, so as to fix this at the core instead of adding post-startup workarounds. How can I find it?
Ruslan (3429 rep)
Mar 19, 2020, 07:37 AM • Last activity: Mar 19, 2020, 10:23 AM
2 votes
0 answers
272 views
Force Firefoxe's chrome change font size when DPI changes
I sometimes need to switch between displays of vastly different DPIs. For that, I change the X database using `xfconf`, a part of Xfce, like so: ```sh xfconf-query -c xsettings -p /Xft/DPI -s 144 # or 96, etc. ``` All applications I run, both GTK2, GTK3, and Qt, react correctly to that, and change t...
I sometimes need to switch between displays of vastly different DPIs. For that, I change the X database using xfconf, a part of Xfce, like so:
xfconf-query -c xsettings -p /Xft/DPI -s 144  # or 96, etc.
All applications I run, both GTK2, GTK3, and Qt, react correctly to that, and change their dimensions. Firefox (all the versions up to 71) ignores the DPI change completely: address bar, menus, etc remain the same size pixel size until I restart the browser. After a restart, the current DPI is honored. Changing layout.css.devPixelsPerPx does affect page content scaling, but not the UI font scaling. Setting it to -1 or positive values does not make Firefox react to the DPI change. Is there any way to make Firefox change these font sizes dynamically? I'd be OK to do it even manually, just without a restart. Some about:config flags, user chrome overrides, etc? I run Void Linux and the Firefox packaged with it.
9000 (1681 rep)
Dec 26, 2019, 06:17 PM • Last activity: Dec 26, 2019, 06:33 PM
17 votes
1 answers
12693 views
xrandr scale 2x2 for multi display (4K HiDPI and Full HD mix) - blurred output
On Kubuntu 17.04 with `nouveau`, I'm trying to obtain a dual monitor setup with a 4K as main one and a Full HD (actually 1920x1200 but makes no difference) on the right. I'm using double KDE system scale (as described in https://wiki.archlinux.org/index.php/HiDPI#Using_KDE_system_settings) along wit...
On Kubuntu 17.04 with nouveau, I'm trying to obtain a dual monitor setup with a 4K as main one and a Full HD (actually 1920x1200 but makes no difference) on the right. I'm using double KDE system scale (as described in https://wiki.archlinux.org/index.php/HiDPI#Using_KDE_system_settings) along with xrandr scaling (as described in https://wiki.archlinux.org/index.php/HiDPI#Side_display) . More specifically: xrandr \ --output eDP-1 --mode 3840x2160 --pos 0x0 --auto \ --output DP-2 --mode 1920x1200 --pos 3840x0 --auto \ --panning 3840x2400+3840+0 --scale 2.0x2.0 \ --fb 7680x2400 The problem is that DP-2 has slight blur, especially on the fonts, due to downsampling from 3840x2400 to 1920x1200. This is noted at the end of https://wiki.archlinux.org/index.php/HiDPI#Side_display , with the suggested solution being the sharpness setting on the monitor. Tried it, doesn't work. The filter being used when scaling is bilinear: https://cgit.freedesktop.org/xorg/app/xrandr/tree/xrandr.c?id=5d5db88d106a49d7560a8042fa054df8b609f00a#n2993 . Nearest neighbor is also supported with "nearest" but looks abysmal even though it is exactly 2x2 downsampling, which I don't understand. I went ahead and built this with "lanczos" instead of "bilinear". Apparently, this is not supported: X Error of failed request: BadName (named color or font does not exist) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 26 (RRSetCrtcTransform) Serial number of failed request: 36 Current serial number in output stream: 37 Is there a way to support lanczos (or a better filter)? I don't mind filtering done in software. Right now, I have double KDE scaling and xrandr scaling disabled with 1920x1080 native resolution on my main display as a workaround. The secondary display is super sharp, including the fonts, as expected. However, from normal viewing distance, the main display looks even worse than the scaled secondary, which is also weird as half resolution is still Full HD, which looks amazingly sharp on other displays that are not 4K. So the real question is, there any way of getting sharp images on both displays? **Edit:** Forgot to mention the important fact that I'm on an Nvidia PRIME system with GeForce 940MX and Intel HD Graphics 620. On nvidia-384 the results are the same when using Intel, i.e the same blurs. When using GeForce, --scale 2x2 option has no effect and --panning option generates a Failed Request error similar to the above.
Ayberk Özgür (309 rep)
Jul 12, 2017, 08:04 AM • Last activity: Nov 8, 2019, 08:00 PM
4 votes
1 answers
1443 views
KDE dynamic high-dpi text scaling
I am looking for an equivalent of the following gnome setup, in KDE: Under **gnome+X11**, I can get instant scaling of gnome apps, KDE apps and chrome/chromium (>v49) when plugging my high-dpi monitor (27" 4K) by running: gsettings set org.gnome.desktop.interface text-scaling-factor 1.4 Note that (i...
I am looking for an equivalent of the following gnome setup, in KDE: Under **gnome+X11**, I can get instant scaling of gnome apps, KDE apps and chrome/chromium (>v49) when plugging my high-dpi monitor (27" 4K) by running: gsettings set org.gnome.desktop.interface text-scaling-factor 1.4 Note that (in a neophyte's words) this is not doing framebuffer-level scaling (that would be gnome's scaling-factor), it' only telling the toolkits to use bigger fonts (images are not affected). This gets picked-up **instantly** by gnome, qt, chrome. Other aps, like Intellij IDEs or Firefox need a restart (for Firefox I could script in a change of layout.css.devPixelsPerPx). On the other hand, in **KDE**, both Plasma "*Displays - Scale Display*" and "*Fonts - Force fonts DPI*" settings require a restart of all apps **including the same KDE apps which autodetected the gnome scaling change**!! This may be due to the KDE-GTK theme picking up the gnome setting, but still, it means Qt *can* redraw the interface in response to the change. Am I overlooking something? Can I modify the same low-level setting underlying the gnome one, from KDE? Is there something that can be improved in KDE code to improve the situation? I ran through [Arch](https://wiki.archlinux.org/index.php/HiDPI) and [Debian](https://wiki.debian.org/MonitorDPI) doc without success.
eddygeek (1341 rep)
Mar 21, 2018, 12:13 PM • Last activity: Aug 21, 2019, 08:59 PM
1 votes
1 answers
1600 views
urxvt not picking up the correct DPI
I'm running Manjaro Gnome on a HiDPI display. Most things work fine but some programs like `urxvt` or `rofi` don't seem to pick up the correct system-wide DPI settings and look very TINY. I thought I could add something `Xft.dpi` to my `.XResources` but it doesn't have any effect. I know it's pickin...
I'm running Manjaro Gnome on a HiDPI display. Most things work fine but some programs like urxvt or rofi don't seem to pick up the correct system-wide DPI settings and look very TINY. I thought I could add something Xft.dpi to my .XResources but it doesn't have any effect. I know it's picking up the configs in that file because I can change colours etc and they're applied to urxvt but not the DPI for some reason. Should I poke something else as well?
Milad (131 rep)
Apr 28, 2019, 12:04 PM • Last activity: Apr 28, 2019, 10:37 PM
Showing page 1 of 20 total questions