#!/bin/bash
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2024 ArchR (https://github.com/archr-linux/Arch-R)

count=$(modetest | awk '$3 == "connected" {print $0}' | wc -l)

if [ "$count" -eq 2 ]; then
    dual_screen=true
else
    dual_screen=false
fi

cat <<EOF >/storage/.config/profile.d/080-dual_screen_mode
DEVICE_HAS_DUAL_SCREEN=$dual_screen
EOF
