From 80384c3824aa4c6d7a30dd74949b90b711006034 Mon Sep 17 00:00:00 2001 From: Leonardo Graboski Veiga Date: Wed, 29 Mar 2017 10:34:21 +0200 Subject: hdmi-hotplug: fix issue for the apalis/colibri tegra modules The hdmi.sh script, triggered by udev, export the DISPLAY environment variable and uses the Xauthority configuration file to enable xrandr to run. Also restarts LXDE after xrandr, adjusting the taskbar length to the new display width. Signed-off-by: Leonardo Graboski Veiga Acked-by: Marcel Ziswiler --- recipes-core/hdmi-hotplug/files/apalis-tk1/hdmi.rules | 11 ----------- recipes-core/hdmi-hotplug/files/apalis-tk1/hdmi.sh | 6 ++++++ recipes-core/hdmi-hotplug/files/hdmi.rules | 2 +- recipes-core/hdmi-hotplug/files/hdmi.sh | 6 ++++++ recipes-core/hdmi-hotplug/hdmi-hotplug.bb | 8 +++++++- 5 files changed, 20 insertions(+), 13 deletions(-) delete mode 100644 recipes-core/hdmi-hotplug/files/apalis-tk1/hdmi.rules create mode 100644 recipes-core/hdmi-hotplug/files/apalis-tk1/hdmi.sh create mode 100644 recipes-core/hdmi-hotplug/files/hdmi.sh (limited to 'recipes-core') diff --git a/recipes-core/hdmi-hotplug/files/apalis-tk1/hdmi.rules b/recipes-core/hdmi-hotplug/files/apalis-tk1/hdmi.rules deleted file mode 100644 index 445bd72..0000000 --- a/recipes-core/hdmi-hotplug/files/apalis-tk1/hdmi.rules +++ /dev/null @@ -1,11 +0,0 @@ -#UDEV [504.185864] change /devices/virtual/switch/hdmi (switch) -#ACTION=change -#DEVPATH=/devices/virtual/switch/hdmi -#SEQNUM=1794 -#SUBSYSTEM=switch -#SWITCH_NAME=hdmi -#SWITCH_STATE=0 -#USEC_INITIALIZED=4180704 - -SUBSYSTEM=="switch", DEVPATH=="/devices/virtual/switch/hdmi", ATTR{state}=="1", RUN+="/bin/sh -c 'DISPLAY=:0.0 xrandr --output HDMI-0 --auto --primary --output LVDS-0 --auto --right-of HDMI-0'" -#SUBSYSTEM=="switch", DEVPATH=="/devices/virtual/switch/hdmi", ATTR{state}=="1", RUN+="/bin/sh -c 'DISPLAY=:0.0 xrandr --output LVDS-0 --auto --primary --output HDMI-0 --auto --right-of LVDS-0'" diff --git a/recipes-core/hdmi-hotplug/files/apalis-tk1/hdmi.sh b/recipes-core/hdmi-hotplug/files/apalis-tk1/hdmi.sh new file mode 100644 index 0000000..43c5459 --- /dev/null +++ b/recipes-core/hdmi-hotplug/files/apalis-tk1/hdmi.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +export XAUTHORITY=/home/root/.Xauthority +export DISPLAY=:0.0 +DISPLAY=:0.0 xrandr --output HDMI-0 --auto --primary --output LVDS-0 --auto --right-of HDMI-0 +lxpanelctl restart diff --git a/recipes-core/hdmi-hotplug/files/hdmi.rules b/recipes-core/hdmi-hotplug/files/hdmi.rules index fe6a1a1..adb63b2 100644 --- a/recipes-core/hdmi-hotplug/files/hdmi.rules +++ b/recipes-core/hdmi-hotplug/files/hdmi.rules @@ -7,4 +7,4 @@ #SWITCH_STATE=0 #USEC_INITIALIZED=4180704 -SUBSYSTEM=="switch", DEVPATH=="/devices/virtual/switch/hdmi", ATTR{state}=="1", RUN+="/bin/sh -c 'DISPLAY=:0.0 xrandr --output HDMI-1 --auto'" +SUBSYSTEM=="switch", DEVPATH=="/devices/virtual/switch/hdmi", ATTR{state}=="1", RUN+="/etc/udev/scripts/hdmi.sh" diff --git a/recipes-core/hdmi-hotplug/files/hdmi.sh b/recipes-core/hdmi-hotplug/files/hdmi.sh new file mode 100644 index 0000000..6a3a6dc --- /dev/null +++ b/recipes-core/hdmi-hotplug/files/hdmi.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +export XAUTHORITY=/home/root/.Xauthority +export DISPLAY=:0.0 +DISPLAY=:0.0 xrandr --output HDMI-1 --auto +lxpanelctl restart diff --git a/recipes-core/hdmi-hotplug/hdmi-hotplug.bb b/recipes-core/hdmi-hotplug/hdmi-hotplug.bb index 5c75d52..6147243 100644 --- a/recipes-core/hdmi-hotplug/hdmi-hotplug.bb +++ b/recipes-core/hdmi-hotplug/hdmi-hotplug.bb @@ -9,9 +9,15 @@ PR = "r1" PACKAGE_ARCH = "all" -SRC_URI = "file://hdmi.rules" +SRC_URI = " \ + file://hdmi.rules \ + file://hdmi.sh \ +" do_install() { install -d ${D}/${sysconfdir}/udev/rules.d install -m 0644 ${WORKDIR}/hdmi.rules ${D}/${sysconfdir}/udev/rules.d/ + + install -d ${D}/${sysconfdir}/udev/scripts + install -m 0755 ${WORKDIR}/hdmi.sh ${D}/${sysconfdir}/udev/scripts/ } -- cgit v1.2.3