Add setup_resolution.sh

This commit is contained in:
Quynh Nguyen 2025-08-29 06:09:06 +00:00
parent 2bcb5952a1
commit aee7ca6be7

28
setup_resolution.sh Normal file
View File

@ -0,0 +1,28 @@
#!/bin/bash
# setup_resolution.sh
CONFIG_DIR="/etc/X11/xorg.conf.d"
CONFIG_FILE="$CONFIG_DIR/10-monitor.conf"
# Create config directory if it does not exist
sudo mkdir -p "$CONFIG_DIR"
# Write monitor configuration to file
sudo tee "$CONFIG_FILE" > /dev/null << 'EOF'
Section "Monitor"
Identifier "HDMI-1"
Modeline "1280x800_60.00" 83.50 1280 1352 1480 1680 800 803 809 831 -hsync +vsync
Option "PreferredMode" "1280x800_60.00"
EndSection
Section "Screen"
Identifier "Screen0"
Monitor "HDMI-1"
EndSection
EOF
# Restart display manager to apply changes
echo "Restarting display manager..."
sudo systemctl restart display-manager
echo "✅ Resolution 1280x800 has been configured."