I'm trying to set the resolution and refresh rate of a screen when i launch an application on a new xserver.
The xrandr commands i usually use to get this screen to work are:
xrandr --newmode 2560x1440 146.27 2560 2680 2944 3328 1440 1441 1444 1465 -HSync +Vsync xrandr --addmode HDMI1 2560x1440 xrandr --output HDMI1 --mode 2560x1440 xrandr --output LVDS1 --off
The command i am using to start the xserver is
xinit /usr/bin/urbanterror $* -- :1
Here is what i have tried so far
I think i need to put these xrandr settings in a xorg config file and pass it in:
xinit /usr/bin/urbanterror $* -- :1 -xf86config xorg.conf
I'm really unsure on how to do write the conf file to replicate these settings, the closest i have found is at the bottom of this webpage, but i feel that it is incomplete.
I have also tried putting the xrandr commands in a script using that as the program to be started in the new xserver.
xinit /home/user/.urtrc $* -- :1
with .urtrc containing
#!/bin/sh xrandr --newmode 2560x1440 146.27 2560 2680 2944 3328 1440 1441 1444 1465 -HSync +Vsync xrandr --addmode HDMI1 2560x1440 xrandr --output HDMI1 --mode 2560x1440 xrandr --output LVDS1 --off exec urbanterror
This worked, but the performance was aweful, i was barely getting 3fps on the lowest settings. I have no idea why.
Any help would be much appreciated.
Running glxgears in the new xserver gives these 2 errors:
libGL error: failed to open drm device: Permission denied libGL error: failed to load driver: i965
So i know it's a permission problem. The script with the xrandr commands runs fine when run from root, and glxgears reports no errors. However i really don't want to have to run this as root for a number of reasons.
Before systemd this problem was solved by adding the user to group video. However after systemd there is no video group.
Any help on fixing those 2 errors would be appreciated.