From 9814d1900079102348f39217641f9d009dec7b9e Mon Sep 17 00:00:00 2001 From: David Raphi Date: Wed, 10 Dec 2025 14:22:23 +0530 Subject: [PATCH] feat: Auto VM detection --- README.md | 8 +++++-- install.sh | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++ uninstall.sh | 4 ++++ 3 files changed, 70 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 761d45d..0baadf5 100644 --- a/README.md +++ b/README.md @@ -233,7 +233,9 @@ Every tool in draphyOS was chosen with a purpose. Here's why: | `xdotool` | X11 automation | | `xclip` | Clipboard manager | | `fira-code-fonts` | Programming font | -| `fontawesome4-fonts` | Icon font | +| `google-noto-sans-mono-vf-fonts` | Fallback mono font | +| `fontawesome-6-free-fonts` | Icon font (solid) | +| `fontawesome-6-brands-fonts` | Icon font (brands) | | `mint-y-icons` | Icon theme | | `adwaita-cursor-theme` | Cursor theme | @@ -316,7 +318,9 @@ This will:
Running in a VM? Display not refreshing? -Picom's `glx` backend doesn't work well in virtual machines. Fix: +**Note:** The installer auto-detects VM environments (VirtualBox, VMware, QEMU/KVM, Hyper-V) and applies these fixes automatically. + +If not auto-detected or you need to apply manually, picom's `glx` backend doesn't work well in virtual machines. Fix: 1. Edit `~/.config/picom/picom.conf`: ```ini diff --git a/install.sh b/install.sh index e5fdf96..617865c 100755 --- a/install.sh +++ b/install.sh @@ -551,6 +551,65 @@ create_marker() { echo "Version: 1.0" >> "$MARKER_FILE" } +# Configure for VM environment (picom compatibility) +configure_vm() { + local is_vm=false + local picom_config="$HOME/.config/picom/picom.conf" + + # Auto-detect VM environment + if command -v systemd-detect-virt &>/dev/null; then + local virt_type + virt_type=$(systemd-detect-virt 2>/dev/null || echo "none") + if [ "$virt_type" != "none" ]; then + is_vm=true + print_step "VM detected: $virt_type" + fi + fi + + # Fallback detection via DMI + if [ "$is_vm" = false ]; then + if grep -qiE "virtualbox|vmware|qemu|kvm|hyper-v|parallels" /sys/class/dmi/id/product_name 2>/dev/null; then + is_vm=true + print_step "VM detected via DMI" + fi + fi + + # If not auto-detected, ask user + if [ "$is_vm" = false ]; then + echo -e "Are you installing in a ${YELLOW}virtual machine${NC}? (y/n)" + read -r response /dev/null || true + + # Disable corner radius (not supported with xrender) + sed -i 's/^corner-radius = [0-9]*;/corner-radius = 0;/' "$picom_config" 2>/dev/null || true + + # Disable vsync + sed -i 's/^vsync = true;/vsync = false;/' "$picom_config" 2>/dev/null || true + + # Disable use-damage + sed -i 's/^use-damage = true;/use-damage = false;/' "$picom_config" 2>/dev/null || true + + # Mark as VM install + echo "VM_MODE=true" >> "$MARKER_FILE" 2>/dev/null || true + + print_success "VM mode configured (xrender backend, no rounded corners)" + else + print_warning "Picom config not found, skipping VM optimization" + fi + fi +} + # Main installation main() { print_header @@ -572,6 +631,7 @@ main() { backup_configs install_configs configure_hardware + configure_vm setup_fish configure_lightdm configure_battery_limit diff --git a/uninstall.sh b/uninstall.sh index 46ce6a2..87dea59 100755 --- a/uninstall.sh +++ b/uninstall.sh @@ -290,6 +290,10 @@ main() { echo " - Wallpaper and cheatsheets" echo " - LightDM customization" echo " - Battery limit service (if set)" + # Check for VM mode + if [ -f "$MARKER_FILE" ] && grep -q "VM_MODE=true" "$MARKER_FILE" 2>/dev/null; then + echo " - VM-optimized picom settings" + fi echo "" echo "You will be asked about:" echo " - Reverting shell to bash"