Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |

Expand Down Expand Up @@ -316,7 +318,9 @@ This will:
<details>
<summary><strong>Running in a VM? Display not refreshing?</strong></summary>

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
Expand Down
60 changes: 60 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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/tty || response="n"
if [[ "$response" =~ ^[Yy]$ ]]; then
is_vm=true
fi
fi

# Apply VM-specific picom settings
if [ "$is_vm" = true ]; then
print_step "Applying VM-optimized picom settings..."

if [ -f "$picom_config" ]; then
# Change backend from glx to xrender
sed -i 's/^backend = "glx";/backend = "xrender";/' "$picom_config" 2>/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
Expand All @@ -572,6 +631,7 @@ main() {
backup_configs
install_configs
configure_hardware
configure_vm
setup_fish
configure_lightdm
configure_battery_limit
Expand Down
4 changes: 4 additions & 0 deletions uninstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down