Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 18 additions & 3 deletions runs/atreboot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,22 @@ chmod 666 "$LOGFILE"
echo "'tvservice' not found, assuming a display is present"
fi
echo "displayDetected: $displayDetected"
mosquitto_pub -p 1886 -t "openWB/optional/int_display/detected" -r -m "$displayDetected"
forceDisplaySetup=0
if displayDetected_old=$(mosquitto_sub -p 1886 -t "openWB/optional/int_display/detected" -C 1 -W 1); then
echo "previous displayDetected value: $displayDetected_old"
if [[ $displayDetected_old != "$displayDetected" ]]; then
echo "displayDetected value changed, publishing new value"
mosquitto_pub -p 1886 -t "openWB/optional/int_display/detected" -r -m "$displayDetected"
else
echo "no change in displayDetected value, skipping publish"
fi
else
echo "no previous displayDetected value found, assuming initial boot"
echo "update of display settings forced"
forceDisplaySetup=1
mosquitto_pub -p 1886 -t "openWB/optional/int_display/detected" -r -m "$displayDetected"
mosquitto_pub -p 1886 -t "openWB/optional/int_display/active" -r -m "true"
fi

# display setup
echo "display setup..."
Expand Down Expand Up @@ -285,8 +300,8 @@ chmod 666 "$LOGFILE"
cp "${OPENWBBASEDIR}/data/config/display/lxdeautostart" "/home/openwb/.config/lxsession/LXDE/autostart"
displaySetupModified=1
fi
if ((displaySetupModified == 1)); then
"${OPENWBBASEDIR}/runs/update_local_display.sh"
if ((displaySetupModified == 1)) || ((forceDisplaySetup == 1)); then
"${OPENWBBASEDIR}/runs/update_local_display.sh" $forceDisplaySetup
fi

# check apache configuration
Expand Down
6 changes: 4 additions & 2 deletions runs/update_local_display.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash
OPENWBBASEDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)
# set "forceUpdate" to parameter $1, set to 0 if not set
forceUpdate=${1:-0}

# update display standby timeout
if timeout=$(mosquitto_sub -p 1886 -t "openWB/optional/int_display/standby" -C 1 -W 1); then
Expand All @@ -20,8 +22,8 @@ if display_active=$(mosquitto_sub -p 1886 -t "openWB/optional/int_display/active
echo "setting graphical target as default"
sudo systemctl set-default graphical.target
fi
# only restart display manager if boot done
if [[ -f "${OPENWBBASEDIR}/ramdisk/bootdone" ]]; then
# only restart display manager if boot done or forceUpdate is set
if [[ -f "${OPENWBBASEDIR}/ramdisk/bootdone" ]] || ((forceUpdate == 1)); then
echo "restarting lightdm service"
sudo systemctl restart lightdm.service
fi
Expand Down