You are not logged in.
Pages: 1
So I want to create a service to autostart a small shell script to change my resolution and position of my screen, but it fails every time.
The script runs fine on its own.
Here is the systemctl status output:
219rez.service - 21:9 resolution fix
Loaded: loaded (/etc/systemd/system/219rez.service; disabled; vendor preset:
Active: failed (Result: exit-code) since Fri 2017-02-10 00:26:04 EET; 4s ago
Process: 684 ExecStart=/usr/bin/xrandr219 (code=exited, status=1/FAILURE)
Feb 10 00:26:04 desktop systemd[1]: Starting 21:9 resolution fix...
Feb 10 00:26:04 desktop xrandr219[684]: Can't open display
Feb 10 00:26:04 desktop xrandr219[684]: Can't open display
Feb 10 00:26:04 desktop xrandr219[684]: Can't open display
Feb 10 00:26:04 desktop xrandr219[684]: Can't open display
Feb 10 00:26:04 desktop systemd[1]: 219rez.service: Control process exited, code
Feb 10 00:26:04 desktop systemd[1]: Failed to start 21:9 resolution fix.
Feb 10 00:26:04 desktop systemd[1]: 219rez.service: Unit entered failed state.
Feb 10 00:26:04 desktop systemd[1]: 219rez.service: Failed with result 'exit-codHere is the script
#!/bin/sh -
xrandr --newmode "2160x912_60.00" 162.50 2160 2288 2512 2864 912 915 925 947$
xrandr --addmode HDMI-0 2160x912_60.00
xrandr --output DVI-1 --auto --output HDMI-0 --auto --right-of DVI-1
xrandr --output HDMI-0 --mode 2160x912_60.00And here is the service file
[Unit]
Description=21:9 resolution fix
[Service]
ExecStart=/usr/bin/xrandr219
Requires=lightdm.service
Type=forking
[Install]
WantedBy=multi-user.targetAny help would be appreciated.
Offline
Offline
Where is this script forking?
Anyway, as this is for lightdm, you could probably let lightdm run it by setting display-setup-script in the config. But, then again, why not go with https://wiki.archlinux.org/index.php/Mu … _xorg.conf
Offline
Thank you both, that worked a lot better.
Offline
Pages: 1