Quantcast
Viewing all articles
Browse latest Browse all 5402

Troubleshooting • Re: Turn on/off HDMI: not tvservice, not vcenvcmd, not dtparam (despite man pages), so how...?

heres a script I wrote to help with this

Code:

#!/bin/bash# Enable and disable HDMI output on the Raspberry Piis_off (){ddcutil getvcp d6 | grep "0x04" >/dev/null}turn_on (){output=$(ddcutil setvcp d6 01 2>&1)# Loop until the output does not contain the verification failed messagewhile [[ $output == *"Verification failed for feature d6"* ]]; do    sleep 1 # Wait a bit before retrying to avoid spamming the command    output=$(ddcutil setvcp d6 01 2>&1)done}case $1 inoff)ddcutil setvcp d6 04;;on)if is_offthen    turn_onfi;;status)if is_offthenecho offelseecho onfi;;toggle)if is_offthen    turn_onelse    ddcutil setvcp d6 04 fi;;*)echo "Usage: $0 on|off|toggle|status" >&2exit 2;;esacexit 0

Statistics: Posted by p1r473 — Wed Mar 06, 2024 12:27 am



Viewing all articles
Browse latest Browse all 5402

Trending Articles