3 581
contributi
m (verificata) |
m (rimosso gruppo staff) |
||
(Una versione intermedia di uno stesso utente non è mostrata) | |||
Riga 61: | Riga 61: | ||
UNI="stringa esadecimale contenente l'edid dello schermo" | UNI="stringa esadecimale contenente l'edid dello schermo" | ||
VGA="/sys/class/drm/card0/card0-VGA-1 | VGA="/sys/class/drm/card0/card0-VGA-1" | ||
export DISPLAY=":0.0" | export DISPLAY=":0.0" | ||
Riga 68: | Riga 68: | ||
pidof /usr/lib/xorg/Xorg > /dev/null 2>&1 || exit 0 | pidof /usr/lib/xorg/Xorg > /dev/null 2>&1 || exit 0 | ||
if [[ "$(cat -- "$VGA" | if [[ "$(cat -- "${VGA}/status")" == "connected" ]] | ||
then | then | ||
xrandr --output LVDS1 --primary --output VGA1 --auto; | xrandr --output LVDS1 --primary --output VGA1 --auto; | ||
EDID=$(cat $VGA | EDID=$(cat -- "${VGA}/edid" | hexdump -v -e '"" "%X" '); | ||
if [[ "$UNI" == "$EDID" ]] | if [[ "$UNI" == "$EDID" ]] | ||
then | then | ||
Riga 83: | Riga 83: | ||
Poi renderlo eseguibile, assegnandogli i giusti permessi e utente/gruppo riservati: | Poi renderlo eseguibile, assegnandogli i giusti permessi e utente/gruppo riservati: | ||
<pre> | <pre> | ||
# chmod | # chmod 744 /usr/local/sbin/monitor.sh | ||
# chown root: | # chown root:root /usr/local/sbin/monitor.sh | ||
</pre> | </pre> | ||
contributi