@@ -551,6 +551,65 @@ create_marker() {
551551 echo " Version: 1.0" >> " $MARKER_FILE "
552552}
553553
554+ # Configure for VM environment (picom compatibility)
555+ configure_vm () {
556+ local is_vm=false
557+ local picom_config=" $HOME /.config/picom/picom.conf"
558+
559+ # Auto-detect VM environment
560+ if command -v systemd-detect-virt & > /dev/null; then
561+ local virt_type
562+ virt_type=$( systemd-detect-virt 2> /dev/null || echo " none" )
563+ if [ " $virt_type " != " none" ]; then
564+ is_vm=true
565+ print_step " VM detected: $virt_type "
566+ fi
567+ fi
568+
569+ # Fallback detection via DMI
570+ if [ " $is_vm " = false ]; then
571+ if grep -qiE " virtualbox|vmware|qemu|kvm|hyper-v|parallels" /sys/class/dmi/id/product_name 2> /dev/null; then
572+ is_vm=true
573+ print_step " VM detected via DMI"
574+ fi
575+ fi
576+
577+ # If not auto-detected, ask user
578+ if [ " $is_vm " = false ]; then
579+ echo -e " Are you installing in a ${YELLOW} virtual machine${NC} ? (y/n)"
580+ read -r response < /dev/tty || response=" n"
581+ if [[ " $response " =~ ^[Yy]$ ]]; then
582+ is_vm=true
583+ fi
584+ fi
585+
586+ # Apply VM-specific picom settings
587+ if [ " $is_vm " = true ]; then
588+ print_step " Applying VM-optimized picom settings..."
589+
590+ if [ -f " $picom_config " ]; then
591+ # Change backend from glx to xrender
592+ sed -i ' s/^backend = "glx";/backend = "xrender";/' " $picom_config " 2> /dev/null || true
593+
594+ # Disable corner radius (not supported with xrender)
595+ sed -i ' s/^corner-radius = [0-9]*;/corner-radius = 0;/' " $picom_config " 2> /dev/null || true
596+
597+ # Disable vsync
598+ sed -i ' s/^vsync = true;/vsync = false;/' " $picom_config " 2> /dev/null || true
599+
600+ # Disable use-damage
601+ sed -i ' s/^use-damage = true;/use-damage = false;/' " $picom_config " 2> /dev/null || true
602+
603+ # Mark as VM install
604+ echo " VM_MODE=true" >> " $MARKER_FILE " 2> /dev/null || true
605+
606+ print_success " VM mode configured (xrender backend, no rounded corners)"
607+ else
608+ print_warning " Picom config not found, skipping VM optimization"
609+ fi
610+ fi
611+ }
612+
554613# Main installation
555614main () {
556615 print_header
@@ -572,6 +631,7 @@ main() {
572631 backup_configs
573632 install_configs
574633 configure_hardware
634+ configure_vm
575635 setup_fish
576636 configure_lightdm
577637 configure_battery_limit
0 commit comments