Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Rotating SDDM with xrandr on Plasma-wayland
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
Rockman8
n00b
n00b


Joined: 19 Sep 2023
Posts: 5

PostPosted: Fri Jun 07, 2024 5:16 am    Post subject: Rotating SDDM with xrandr on Plasma-wayland Reply with quote

Hello,

I've been trying for some time to rotate my SDDM login screen using xrandr, I found out that following SDDM guide on gentoo wiki was not enough when launching SDDM-X11(default) on kde Plasma-wayland, xrandr output on wayland is "inaccurate", xrandr will not address properly the output monitors at SDDM-X11 launch time.

By running xrandr --listmonitors on wayland will output:

Code:

 0: +*HDMI-A-1 1920/530x1080/300+1200+420  HDMI-A-1
 1: +DP-3 1200/520x1920/320+3120+0  DP-3
 2: +DP-4 1200/520x1920/320+0+0  DP-4


but running xrandr --listmonitors >& ~userName/xrandr_listmonitors along with display-manager service will result in

Code:

 0: +HDMI-A-0 1920/532x1080/304+1200+0  HDMI-A-0
 1: +DisplayPort-2 1200/518x1920/324+3120+0  DisplayPort-2
 2: +DisplayPort-3 1200/518x1920/324+0+0  DisplayPort-3


First we must find out if the script (Xsetup) is being executed by checking /var/log/sddm.log

Code:

[00:09:19.363] (II) DAEMON: Initializing...
[00:09:19.369] (II) DAEMON: Starting...
[00:09:19.369] (II) DAEMON: Logind interface found
[00:09:19.370] (II) DAEMON: Adding new display...
[00:09:19.370] (II) DAEMON: Loaded empty theme configuration
[00:09:19.370] (II) DAEMON: Xauthority path: "/run/sddm/xauth_hfypdb"
[00:09:19.370] (II) DAEMON: Using VT 7
[00:09:19.370] (II) DAEMON: Display server starting...
[00:09:19.370] (II) DAEMON: Writing cookie to "/run/sddm/xauth_hfypdb"
[00:09:19.370] (II) DAEMON: Running: /usr/bin/X -nolisten tcp -background none -seat seat0 vt7 -auth /run/sddm/xauth_hfypdb -noreset -displayfd 16
[00:09:21.796] (II) DAEMON: Setting default cursor

=================================================================

[00:09:21.805] (II) DAEMON: Running display setup script  "/etc/sddm/scripts/Xsetup"

=================================================================

[00:09:22.765] (II) DAEMON: Display server started.
[00:09:22.765] (II) DAEMON: Socket server starting...
[00:09:22.765] (II) DAEMON: Socket server started.
[00:09:22.765] (II) DAEMON: Loading theme configuration from "/usr/share/sddm/themes/breeze/theme.conf"
[00:09:22.766] (II) DAEMON: Greeter starting...
[00:09:22.777] (II) HELPER: [PAM] Starting...
[00:09:22.777] (II) HELPER: [PAM] Authenticating...
[00:09:22.777] (II) HELPER: [PAM] returning.
[00:09:22.800] (II) HELPER: Writing cookie to "/tmp/xauth_WkDfQp"
[00:09:22.800] (II) HELPER: Starting X11 session: "" "/usr/bin/sddm-greeter --socket /tmp/sddm-:0-FdBbWc --theme /usr/share/sddm/themes/breeze"
[00:09:22.802] (II) DAEMON: Greeter session started successfully
[00:09:22.861] (II) DAEMON: Message received from greeter: Connect
[00:09:53.155] (II) DAEMON: Message received from greeter: Login
[00:09:53.155] (II) DAEMON: Reading from "/usr/share/wayland-sessions/plasmawayland.desktop"
[00:09:53.156] (II) DAEMON: Session "/usr/share/wayland-sessions/plasmawayland.desktop" selected, command: "/usr/lib64/libexec/plasma-dbus-run-session-if-needed /usr/bin/startplasma-wayland" for VT 8
[00:09:53.170] (II) HELPER: [PAM] Starting...
[00:09:53.170] (II) HELPER: [PAM] Authenticating...
[00:09:53.170] (II) HELPER: [PAM] Preparing to converse...
[00:09:53.170] (II) HELPER: [PAM] Conversation with 1 messages
[00:09:53.177] (II) HELPER: [PAM] returning.
[00:09:53.177] (II) DAEMON: Authentication for user  "username"  successful
[00:09:53.262] (II) HELPER: Starting Wayland user session: "/usr/share/sddm/scripts/wayland-session" "/usr/lib64/libexec/plasma-dbus-run-session-if-needed /usr/bin/startplasma-wayland"
[00:09:53.265] (II) HELPER: Jumping to VT 8
[00:09:53.265] (II) HELPER: VT mode didn't need to be fixed
[00:09:53.270] (II) HELPER: [PAM] Closing session
[00:09:53.272] (II) HELPER: [PAM] Ended.
[00:09:53.273] (II) DAEMON: Auth: sddm-helper exited successfully
[00:09:53.273] (II) DAEMON: Greeter stopped. SDDM::Auth::HELPER_SUCCESS
[00:09:53.424] (II) DAEMON: Session started true


Once we have checked if the script (Xsetup) is being executed then we proceed to check the command output, if not then, we must check /etc/sddm.conf.d/override.conf

Code:

# /etc/sddm.conf.d/override.conf

[X11]
DisplayCommand=/etc/sddm/scripts/Xsetup


xrandr will not output to any other means other than stdout and stderr meaning it will not show up on log, and as soon display-manager is started we will not have access to TTY to check its output, to remedy this then we must bring its output to file.

Code:

# /etc/sddm/scripts/Xsetup

#default
xrandr --output HDMI-A-1 --auto --primary >& ~userName/xrandr_std0

#portrait
xrandr --output DP-3 --right-of HDMI-A-0 --rotate right --noprimary >& ~userName/xrandr_std1

#portrait
xrandr --output DP-4 --left-of HDMI-A-0 --rotate left --noprimary >& ~userName/xrandr_std2

#list all available monitors
xrandr --listmonitors >& ~userName/xrandr_listmonitors


Done that, then logout, just CTRL+ALT+FN (N=any other other TTY that's not being used by SDDM usually F1 is fine) to login into terminal and

Code:

rc-service display-manager status

# if display-manager has somehow crashed, zap it, if not, then stop
rc-service display-manager stop/zap


Code:

cat ~userName/xrandr_listmonitors

# if xrandr is executed without any errors/messages, it won't output a readable file
cat ~userName/xrandr_std0
cat ~userName/xrandr_std1
cat ~userName/xrandr_std2


Check for misnamed monitors and some other possible errors and restart the display-manager

Code:

rc-service display-manager start


Check if SDDM has rotated and is positioned accondingly, then procceed to clean up the Xsetup file by deleting the "output to file" entry.

Code:

# /etc/sddm/scripts/Xsetup

xrandr --output HDMI-A-0 --auto --primary
xrandr --output DisplayPort-2 --right-of HDMI-A-0 --rotate right --noprimary
xrandr --output DisplayPort-3 --left-of HDMI-A-0 --rotate left --noprimary


tl;dr

Just place >% path/fileName at the end of xrandr command in Xsetup to fetch for some possible errors and list X11's monitor's name with xrandr --listmonitors and correct the Xsetup entry.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum