Xrandr e udev: configurare un monitor esterno in automatico: differenze tra le versioni

m
rimosso gruppo staff
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"status)" == "connected" ]]
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 | hexdump -v -e '"" "%X" ');
   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 754 /usr/local/sbin/monitor.sh
# chmod 744 /usr/local/sbin/monitor.sh
# chown root:staff /usr/local/sbin/monitor.sh
# chown root:root /usr/local/sbin/monitor.sh
</pre>
</pre>


3 581

contributi