You are not logged in.

#1 2020-01-31 15:54:13

nrcngominh
Member
Registered: 2020-01-30
Posts: 4

[SOLVED] Font size of i3 is different when using LightDM

I noticed when I start i3 from LightDM, the font size is smaller compared to when I start i3 from TTY (using "startx" command).

This screenshot was taken when I started i3 from TTY.
https://i.imgur.com/MTGq1uu.png

This screenshot was taken when I started i3 from LightDM.
https://i.imgur.com/01cMb1i.png

Is there any idea to fix the scaling of LightDM?

Mod Edit - Replaced oversized images with links.
CoC - Pasting pictures and code

Last edited by nrcngominh (2020-02-01 05:25:19)

Offline

#2 2020-01-31 16:04:45

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: [SOLVED] Font size of i3 is different when using LightDM

Welcome to the forums nrcngominh smile

You haven't given us any relevant information to go on...
Please post the contents of your startx and lightdm configuration files.


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#3 2020-01-31 16:58:05

nrcngominh
Member
Registered: 2020-01-30
Posts: 4

Re: [SOLVED] Font size of i3 is different when using LightDM

Slithery wrote:

Welcome to the forums nrcngominh smile

You haven't given us any relevant information to go on...
Please post the contents of your startx and lightdm configuration files.

My bad, I'm sorry. Here is my X configuration

$ cat ~/.xinitrc
xrdb -merge ~/.Xresources
exec dbus-launch i3
$ cat ~/.Xresources
Xft.dpi: 120
Xft.autohint: 0
Xft.lcdfilter:  lcddefault
Xft.hintstyle:  hintfull
Xft.hinting: 1
Xft.antialias: 1
Xft.rgba: rgb

Here is my LightDM configuration

$ cat /etc/lightdm/lightdm.conf | grep "^[^#]"
[LightDM]
run-directory=/run/lightdm
[Seat:*]
greeter-session=lightdm-gtk-greeter
session-wrapper=/etc/lightdm/Xsession
[XDMCPServer]
[VNCServer]
$ cat /etc/lightdm/Xsession
#!/bin/sh
#
# LightDM wrapper to run around X sessions.

echo "Running X session wrapper"

# Load profile
for file in "/etc/profile" "$HOME/.profile" "/etc/xprofile" "$HOME/.xprofile"; do
    if [ -f "$file" ]; then
        echo "Loading profile from $file";
        . "$file"
    fi
done

# Load resources
for file in "/etc/X11/Xresources" "$HOME/.Xresources"; do
    if [ -f "$file" ]; then
        echo "Loading resource: $file"
        xrdb -merge "$file"
    fi
done

# Load keymaps
for file in "/etc/X11/Xkbmap" "$HOME/.Xkbmap"; do
    if [ -f "$file" ]; then
        echo "Loading keymap: $file"
        setxkbmap `cat "$file"`
        XKB_IN_USE=yes
    fi
done

# Load xmodmap if not using XKB
if [ -z "$XKB_IN_USE" ]; then
    for file in "/etc/X11/Xmodmap" "$HOME/.Xmodmap"; do
        if [ -f "$file" ]; then
           echo "Loading modmap: $file"
           xmodmap "$file"
        fi
    done
fi

unset XKB_IN_USE

# Run all system xinitrc shell scripts
xinitdir="/etc/X11/xinit/xinitrc.d"
if [ -d "$xinitdir" ]; then
    for script in $xinitdir/*; do
        echo "Loading xinit script $script"
        if [ -x "$script" -a ! -d "$script" ]; then
            . "$script"
        fi
    done
fi

# Run user xsession shell script
script="$HOME/.xsession"
if [ -x "$script" -a ! -d "$script" ]; then
    echo "Loading xsession script $script"
    . "$script"
fi

echo "X session wrapper complete, running session $@"

Here is my xsessions

cat /usr/share/xsessions/*
[Desktop Entry]
Name=i3
Comment=improved dynamic tiling window manager
Exec=i3
TryExec=i3
Type=Application
X-LightDM-DesktopName=i3
DesktopNames=i3
Keywords=tiling;wm;windowmanager;window;manager;
[Desktop Entry]
Name=i3 (with debug log)
Comment=improved dynamic tiling window manager
Exec=i3-with-shmlog
Type=Application
Keywords=tiling;wm;windowmanager;window;manager;

Last edited by nrcngominh (2020-02-01 04:38:06)

Offline

#4 2020-01-31 18:03:29

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,052

Re: [SOLVED] Font size of i3 is different when using LightDM

$ cat ~/.xinitrc
xrdb -merge ~/.Xresources
exec dbus-launch i3

Lose the dbus-launch and see the second note in https://wiki.archlinux.org/index.php/Xinit#xinitrc

As for the font: "xdpyinfo | grep resolution" in either session will likely show different results?
Try to add "xrandr --dpi 120" in the lightdm wrapper.

Offline

#5 2020-02-01 04:30:00

nrcngominh
Member
Registered: 2020-01-30
Posts: 4

Re: [SOLVED] Font size of i3 is different when using LightDM

seth wrote:
$ cat ~/.xinitrc
xrdb -merge ~/.Xresources
exec dbus-launch i3

Lose the dbus-launch and see the second note in https://wiki.archlinux.org/index.php/Xinit#xinitrc

As for the font: "xdpyinfo | grep resolution" in either session will likely show different results?
Try to add "xrandr --dpi 120" in the lightdm wrapper.

Result of "xdpyinfo | grep resolution" is "resolution: 96x96 dots per inch" in either session.
After I add "xrandr --dpi 120" to /etc/lightdm/xsession, the result in i3 from LightDM is "resolution: 120x120 dots per inch" but the font size doesn't change.

Offline

#6 2020-02-01 05:32:05

nrcngominh
Member
Registered: 2020-01-30
Posts: 4

Re: [SOLVED] Font size of i3 is different when using LightDM

I found the problem.
I have a ~/.profile file that be sourced by /etc/lightdm/Xsession but not by .xinitrc.

$ cat ~/.profile
export GDK_SCALE=1.25
export GDK_DPI_SCALE=0.8
export QT_AUTO_SCREEN_SET_FACTOR=0
export QT_SCALE_FACTOR=1.25
export QT_FONT_DPI=96

After I remove this file, the font size goes back to normal.
Thank you.

Offline

Board footer

Powered by FluxBB