Skip to content

Commit c4348b4

Browse files
committed
fix: comprehensive edge case handling and install/uninstall symmetry
1 parent bbef0a9 commit c4348b4

3 files changed

Lines changed: 1178 additions & 114 deletions

File tree

README.md

Lines changed: 97 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -70,16 +70,17 @@ If you love that vibe — welcome home.
7070
### System Management
7171
- 🔄 **System updater** (`update-draphyOS`) — Interactive tool for system updates, security patches, and Fedora version upgrades
7272
- ⬆️ **Config updates** — Update draphyOS configs from GitHub with intelligent three-way merge (preserves your customizations)
73-
- 📦 **Smart uninstall** — Tracks packages installed by draphyOS for clean removal
74-
- 🔋 **Battery health** — Configurable charge limit (60-100%) for laptop battery longevity
73+
- 📦 **Smart uninstall** — Tracks packages installed by draphyOS for clean removal (full reset to pre-install state)
74+
- 🔋 **Battery health** — Configurable charge limit with auto-detection for 10+ laptop vendors
7575
- 🔀 **Version migrations** — Seamless upgrades between draphyOS versions
76+
- 🖥️ **VM detection** — Automatic picom optimizations for virtual machines
7677

7778
### Development Tools
7879
- 🐳 **Docker** — Container runtime with rootless setup (user added to docker group)
7980
- 🟢 **Node.js** — fnm version manager with LTS pre-installed
8081
- 🐘 **PostgreSQL** — Database server with user/database auto-created
8182
- 🤖 **Claude Code** — AI coding assistant CLI
82-
- 🎮 **NVIDIA** — Auto-detection and driver installation (akmod-nvidia)
83+
- 🎮 **NVIDIA** — Auto-detection, Secure Boot handling, hybrid graphics support (akmod-nvidia)
8384

8485
---
8586

@@ -466,6 +467,12 @@ Auto-detected and installed only if NVIDIA GPU is present.
466467
| Package | What it does | Why it's here |
467468
| ------- | ------------ | ------------- |
468469
| `akmod-nvidia` | NVIDIA driver | Proprietary driver — auto-rebuilds on kernel updates |
470+
| `switcheroo-control` | GPU switching | Enables hybrid graphics (Intel/AMD + NVIDIA) on laptops |
471+
472+
**Features:**
473+
- Automatic GPU detection via `lspci`
474+
- Secure Boot detection with MOK enrollment guidance
475+
- Hybrid graphics support (switcheroo-control for laptops with dual GPUs)
469476

470477
</details>
471478

@@ -584,6 +591,9 @@ Config: `~/.config/gammastep/config.ini`
584591
- Use `--auto-tune` for automatic power optimization
585592
- Great for laptops to extend battery life
586593

594+
**TLP vs power-profiles-daemon:**
595+
The installer automatically handles conflicts between TLP and power-profiles-daemon. If you have TLP installed, power-profiles-daemon is disabled to avoid conflicts.
596+
587597
</details>
588598

589599
<details>
@@ -613,24 +623,40 @@ No setup needed — works automatically with PAM.
613623
<details>
614624
<summary><strong>🔋 Battery Charge Limit</strong></summary>
615625

616-
During installation, you can set a charge limit (60-100%) to extend battery lifespan:
617-
- Reduces battery wear from constant 100% charging
618-
- Best for laptops that are often plugged in
619-
- Uses a systemd service to persist across reboots
620-
621-
To change the limit later:
626+
During installation, you can set a charge limit to extend battery lifespan. The installer automatically detects your laptop brand and uses the appropriate interface.
627+
628+
**Supported Laptops:**
629+
| Brand | Interface | Limit Type | Notes |
630+
|-------|-----------|------------|-------|
631+
| **ThinkPad** (2012+) | natacpi | 60-100% | Native kernel support |
632+
| **ThinkPad** (pre-2012) | tp_smapi | 60-100% | Requires tp_smapi module |
633+
| **ASUS** | asus-nb-wmi | 40/60/80/100 | Only these 4 values work |
634+
| **Dell** | dell-wmi | 55-100% | Requires kernel 6.12+ |
635+
| **Lenovo IdeaPad** | ideapad_acpi | ~60% toggle | Conservation mode on/off |
636+
| **Huawei MateBook** | huawei-wmi | 1-100% | Supports start/stop thresholds |
637+
| **LG Gram** | lg_laptop | 80% toggle | Battery care on/off |
638+
| **Samsung** | samsung_laptop | ~80% toggle | Battery life extender on/off |
639+
| **MSI** | msi_ec | Variable | Hardware enforces start=stop-10 |
640+
| **Framework** | Standard | 1-100% | Stop threshold only |
641+
| **System76** | Standard | Variable | Open EC firmware only |
642+
643+
**To check/change the limit later:**
622644
```bash
623-
# Check current limit
645+
# Check current limit (standard interface)
624646
cat /sys/class/power_supply/BAT0/charge_control_end_threshold
625647

626-
# Set to 80%
648+
# Set to 80% (standard interface)
627649
echo 80 | sudo tee /sys/class/power_supply/BAT0/charge_control_end_threshold
628650

629-
# Set back to 100%
630-
echo 100 | sudo tee /sys/class/power_supply/BAT0/charge_control_end_threshold
651+
# Lenovo IdeaPad conservation mode
652+
cat /sys/bus/platform/drivers/ideapad_acpi/VPC*/conservation_mode
653+
echo 1 | sudo tee /sys/bus/platform/drivers/ideapad_acpi/VPC*/conservation_mode
654+
655+
# Diagnostic info (install TLP first)
656+
sudo tlp-stat -b
631657
```
632658

633-
> **Note:** Not all laptops support charge limits. The installer only offers this if your hardware supports it.
659+
> **Note:** VMs, desktops, and some older laptops don't support charge limits. The installer auto-detects support.
634660
635661
</details>
636662

@@ -639,6 +665,7 @@ echo 100 | sudo tee /sys/class/power_supply/BAT0/charge_control_end_threshold
639665

640666
Docker is pre-configured with your user added to the `docker` group:
641667
- **Log out and back in** after install to use Docker without sudo
668+
- cgroups v2 delegation enabled for rootless resource limits
642669
- Verify: `docker run hello-world`
643670

644671
```bash
@@ -672,6 +699,7 @@ createdb myapp # Create new database
672699
Node.js is managed via fnm (Fast Node Manager):
673700
- LTS version pre-installed
674701
- Automatic version switching per project
702+
- System Node.js conflict detection (warns if `nodejs` package is installed)
675703

676704
```bash
677705
# Common commands
@@ -683,6 +711,8 @@ fnm default 20 # Set default version
683711

684712
Add a `.node-version` or `.nvmrc` file to project directories for automatic switching.
685713

714+
> **Note:** If you have system-installed Node.js (`dnf install nodejs`), fnm will still work but you may see version conflicts. The installer warns about this.
715+
686716
</details>
687717

688718
<details>
@@ -778,12 +808,25 @@ The uninstaller is smart about your base system:
778808

779809
### What Gets Removed
780810

781-
- draphyOS config symlinks
811+
**Automatic:**
812+
- draphyOS config symlinks (all 25 config files)
782813
- System update script (`/usr/local/bin/update-draphyOS`)
783-
- Battery charge limit service (if configured)
814+
- Battery charge limit service and udev rules
815+
- cgroup delegation config (Docker rootless)
784816
- LightDM customization (restored from backup)
785-
- Optionally: shell reverted to bash
786-
- Optionally: backup configs restored
817+
- GNOME/GTK dark mode settings (reset to defaults)
818+
- Third-party repositories (Brave, Chrome, VS Code, Docker, yazi COPR)
819+
- draphyOS state files (checksums, package state, etc.)
820+
821+
**Interactive prompts:**
822+
- fnm and all Node.js versions
823+
- Claude Code CLI
824+
- Docker group membership and service
825+
- PostgreSQL service
826+
- switcheroo-control (GPU switching)
827+
- NVIDIA drivers (with dracut regeneration)
828+
- Shell revert to bash
829+
- Backup restoration
787830

788831
---
789832

@@ -880,6 +923,42 @@ update-draphyOS -d
880923

881924
</details>
882925

926+
<details>
927+
<summary><strong>NVIDIA driver not loading with Secure Boot?</strong></summary>
928+
929+
NVIDIA's proprietary drivers need to be signed for Secure Boot. The installer detects this and provides guidance:
930+
931+
1. After install, reboot and watch for MOK (Machine Owner Key) enrollment prompt
932+
2. Select "Enroll MOK" → "Continue" → Enter the password shown during install
933+
3. Reboot again — NVIDIA driver should now load
934+
935+
To check if Secure Boot is blocking the driver:
936+
```bash
937+
mokutil --sb-state # Check Secure Boot status
938+
lsmod | grep nvidia # Check if driver loaded
939+
journalctl -b | grep -i nvidia # Check for errors
940+
```
941+
942+
</details>
943+
944+
<details>
945+
<summary><strong>Hybrid graphics (laptop with dual GPU)?</strong></summary>
946+
947+
For laptops with Intel/AMD integrated + NVIDIA discrete GPU, switcheroo-control is auto-enabled:
948+
949+
```bash
950+
# Check GPU switching status
951+
switcherooctl list
952+
953+
# Run app on discrete GPU
954+
switcherooctl launch <app>
955+
956+
# Or use environment variable
957+
DRI_PRIME=1 <app>
958+
```
959+
960+
</details>
961+
883962
---
884963

885964
## 🤝 Contributing

0 commit comments

Comments
 (0)