Toggle an HDMI screen off/on from a raspberry pi. Can be mapped to a hotkey in /etc/xdg/openbox/lxde-pi-rc.xml
#!/bin/bash status=$(DISPLAY=:0 wlr-randr |grep Enabled |sed '1p;d') if [[ "$status" = *"yes"* ]]; then echo "Screen is on, turning off" DISPLAY=:0 wlr-randr --output HDMI-A-1 --off else echo "Screen is off, turning on" DISPLAY=:0 wlr-randr --output HDMI-A-1 --on fi