13 November, 2025

AOSP 15 Setup on ThinkBook 16p G5 IRX – Part 2

System Update & Essentials

System Refresh Script

#!/bin/bash
echo "============================================="
echo "🕒 System refresh started at: $(date)"
echo "============================================="
sudo apt update
sudo apt upgrade -y
sudo apt autoremove -y
sudo apt autoclean
echo "---------------------------------------------"
echo "✅ Last refresh completed: $(date)"
echo "---------------------------------------------"

AOSP Repository Setup

Emulator Scripts

#!/bin/bash
case "$1" in
  start)
    emulator &
    ;;
  stop)
    pkill -f emulator
    ;;
  status)
    ps aux | grep -E 'emulator|qemu' 
    ;;
  clean)
    rm -rf ~/.android/avd/*
    ;;
  *)
    echo "Usage: $0 {start|stop|status|clean}"
    ;;
esac

Dual Monitor Script

#!/bin/bash
INTERNAL="eDP-1"
EXTERNAL="HDMI-1-0"

if xrandr | grep "^$EXTERNAL connected" >/dev/null; then
    xrandr --output $INTERNAL --auto --primary --output $EXTERNAL --mode 3840x2160 --scale 2x2
    echo "Dual monitor setup applied: $INTERNAL + $EXTERNAL"
else
    xrandr --output $INTERNAL --auto --primary
    echo "External monitor not detected. Using internal display only."
fi

Automated Monitor Detection

#!/bin/bash
EXT_MON=$(xrandr | grep " connected " | grep -v "eDP" | cut -d' ' -f1)
if [ -z "$EXT_MON" ]; then
    xrandr --output eDP-1 --auto --scale 1x1 --primary
else
    xrandr --output eDP-1 --off \
           --output "$EXT_MON" --auto --scale 2x2 --primary
fi

Collapsible Tips & Warnings

No comments:

Post a Comment