#!/bin/bash
# Set reTerminal DM (labwc/Wayland) rotation to Left at every login.
# Runs from autostart when user pi logs in; does not remove itself.
# Use this when wlr-randr transform does not persist across reboots.
sleep 5
OUTPUT=""
if command -v wlr-randr &>/dev/null; then
  OUTPUT=$(wlr-randr 2>/dev/null | awk '/^[A-Za-z0-9_-]+ /{print $1; exit}')
fi
[[ -z "$OUTPUT" ]] && OUTPUT="DSI-1"
if [[ -n "$OUTPUT" ]] && command -v wlr-randr &>/dev/null; then
  wlr-randr --output "$OUTPUT" --transform 270
fi
