You are not logged in.

#1 2020-11-27 20:00:38

CloudOne
Member
Registered: 2020-11-27
Posts: 1

Can't get multimonitor configuration using qtile

Hello all,

I've got Arch linux installed using a laptop with an external monitor using intel and nvidia GPUs. I installed optimus-manager and I have it configured in hybrid mode. Then I decided to use qtile as window tile manager. When trying to use both monitors, I have both screens turned on and duplicated instead of having them extended. The problem here is that if you have optimus-manager you can't have a custum xorg.conf file. Since it is generated by optimus-manager. After many modifications I got them tearfree and able to use HDMI and thunderbolt using this optimus-manager configuration in /etc/optimus-manager/optimus-manager.conf

[intel]
DRI=3
accel=
driver=intel
modeset=yes
tearfree=yes

[nvidia]
DPI=96
PAT=yes
allow_external_gpus=no
ignore_abi=no
modeset=yes
options=overclocking

[optimus]
auto_logout=yes
pci_power_control=no
pci_remove=no
pci_reset=no
startup_auto_battery_mode=hybrid
startup_auto_extpower_mode=nvidia
startup_mode=hybrid
switching=none

Then in qtile I have this configuration for managing screens:

from libqtile.config import Screen
from libqtile import bar
from settings.widgets import primary_widgets, secondary_widgets
import subprocess

status_bar = lambda widgets: bar.Bar(widgets, 24, opacity=1)

screens = [Screen(top=status_bar(primary_widgets))]

connected_monitors = subprocess.run(
    "xrandr | grep 'connected' | cut -d ' ' -f 2",
    shell=True,
    stdout=subprocess.PIPE
).stdout.decode("UTF-8").split("\n")[:-1].count("connected")

if connected_monitors > 1:
    for i in range(1, connected_monitors):
        screens.append(Screen(top=status_bar(secondary_widgets)))

I've got no errors in Xorg.0.log and optimus-manager logs.

I tried this and autorandr and it didn't work for me.
At startup I find duplicate screens and I have to run this script generated by arandr and then restart qtile.

#!/bin/sh
xrandr --output eDP1 --mode 1920x1080 --pos 1920x0 --rotate normal --output DP1 --primary --mode 1920x1080 --pos 0x0 --rotate normal --output HDMI1 --off --output VIRTUAL1 --off

After 3 days stuck with this, how can I have xrandr command run at startup without having to do it manually every time?

Offline

Board footer

Powered by FluxBB