2023-07-22 23:56:23 +00:00
|
|
|
#!/bin/bash
|
2023-10-23 22:44:47 +00:00
|
|
|
# SPDX-License-Identifier: GPL-2.0
|
2023-07-22 23:56:23 +00:00
|
|
|
# Copyright (C) 2021-present Fewtarius (https://github.com/fewtarius)
|
|
|
|
|
|
|
|
. /etc/profile
|
|
|
|
|
|
|
|
hdmi_con() {
|
|
|
|
if [ -f "/sys/class/extcon/hdmi/state" ]
|
|
|
|
then
|
|
|
|
HDMI="$(cat /sys/class/extcon/hdmi/state)"
|
|
|
|
if [ "${HDMI}" = "HDMI=1" ]
|
|
|
|
then
|
|
|
|
if [ -f "/sys/devices/virtual/graphics/fbcon/rotate" ]
|
|
|
|
then
|
|
|
|
echo 0 >/sys/devices/virtual/graphics/fbcon/rotate
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
### If hdmi is connected, set the framebuffer rotation back to normal.
|
|
|
|
hdmi_con
|