Set display off after boot

Volumio Information

Volumio Version: 2.861
Hardware: x86
DAC: n/a

I would like to set my display off at all times regardless of lid open or closed or touch screen. I’ve tried the following.

/lib/systemd/system/screen_off.service

	[Unit]
	Description=screen off
	After=volumio.service

	[Service]
	Type=oneshot
	User=root
	Group=root
	ExecStart=/bin/bash /usr/bin/screen_off.sh

	[Install]
	WantedBy=multi-user.target

sudo chown root.root /lib/systemd/system/screen_off.service

/usr/bin/screen_off.sh

	#!/bin/bash
	xrandr -d :0 --output LVDS1 --off

chmod +x /usr/bin/screen_off.sh
sudo chown root.root /usr/bin/screen_off.sh

systemctl enable screen_off.service

My shell script works flawlessly from the CLI but not as a service.

Thanks

The following works. Display turns off after 2 minutes.

/lib/systemd/system/screen_off.service

	[Unit]
	Description=screen off

	[Service]
	Type=oneshot
	ExecStart=/usr/bin/screen_off.sh

/lib/systemd/system/screen_off.timer

	[Unit]
	Description=timer for screen_off

	[Timer]
	OnBootSec=2min

	[Install]
	WantedBy=timers.target

sudo chown root.root /lib/systemd/system/screen_off.service
sudo chown root.root /lib/systemd/system/screen_off.timer

/usr/bin/screen_off.sh (use xrandr -d :0 to determine display name)

	#!/bin/bash
	export XAUTHORITY=/home/volumio/.Xauthority
	xrandr -d :0 --output LVDS1 --off

sudo chmod +x /usr/bin/screen_off.sh
sudo chown root.root /usr/bin/screen_off.sh

systemctl daemon-reload
systemctl enable screen_off.timer

In case you wish to run it headless, you can also prevent the UI from starting by disabling the volumio-kiosk.service