• Varyag@lemmy.dbzer0.com
    link
    fedilink
    English
    arrow-up
    3
    ·
    2 months ago

    I was trying to figure this out until like 3AM last night. How do I set environment variables to be loaded into my X session when XFCE loads? I’m on Arch btw. I want to set DRI_PRIME=1 so that applications started from the launcher actually use the discrete graphics card by default. Right now it only works like that if I launch from the terminal.

    I tried multiple potential config files to put it at, and the one time it actually worked, I lost my window manager… The other times, the desktop environment didnt even load or start the session. Undid everything and decided to come back later.

    • adr1anOPM
      link
      fedilink
      arrow-up
      3
      ·
      2 months ago

      I was thinking of either /etc/environment or /etc/profile which would be standard way to set up global variables. But the archwiki mentions using a script in /etc/X11/xinit/xinitrc.d/ so make a file there, add the executable permition and write export DRI_PRIME=1

      • Varyag@lemmy.dbzer0.com
        link
        fedilink
        English
        arrow-up
        3
        ·
        2 months ago

        well, good news is: it works. Bad news is, it borks my window manager. After so many attempts, I am forced to admit defeat. So, at least a few of my different methods that I tried did work, but with that comes a problem that my window manager does not want to run on my discrete GPU and then I get a bare desktop with no panels or proper windows.

        Quake does launch correctly at that point but I rather have the rest of my DE actually function, and I did figure out how to set individual applications to launch on the second GPU. I’ll consider this solved for my use case… This combo of intel onboard graphics and AMD GPU was always my headache with this machine even in the times of windows.

      • Varyag@lemmy.dbzer0.com
        link
        fedilink
        English
        arrow-up
        2
        ·
        2 months ago

        I tried certain iterations of those, and the usual result is that my session fails to initiate. I’m probably doing that wrong.