DEV Community

Brisbane Web Developer
Brisbane Web Developer

Posted on

Not relying on KDE Plasma to correct monitor layout

Summary

  • KDE Plasma seems to forget the setting for monitor layout at certain event. I lost the setting while I was investigating about how I can avoid my X1E2 to get crashed with an extra monitor when turning on vsync to play a game.
  • This corrects the monitor layout issue.
  • My X1E2 has 1920x1080 and the external monitors have 2560x1440.

Scripts

/usr/local/bin/layout-monitors
====================
#!/bin/bash

xrandr \
  --output DP-0 --auto --size 2560x1440 --panning 2560x1440 \
  --output DP-1 --auto --pos 2560x0 \
  --output eDP-1-1 --auto --primary --pos 640x1440
Enter fullscreen mode Exit fullscreen mode
/usr/share/sddm/scripts/Xsetup
====================
#!/bin/sh
# Xsetup - run as root before the login dialog appears

if [ -e /sbin/prime-offload ]; then
    echo running NVIDIA Prime setup /sbin/prime-offload
    /sbin/prime-offload
fi

# Important: Put at last because it does not work otherwise
# ===== FROM HERE =====
if [ -e /usr/local/bin/layout-monitors ]; then
    echo running layout script /usr/local/bin/layout-monitors
    /usr/local/bin/layout-monitors
fi
# ===== TO HERE =====
Enter fullscreen mode Exit fullscreen mode

Original Post

Here

Top comments (0)