Bash scripts for advanced power and performance management on ASUS laptops with hybrid graphics and AMD Ryzen CPUs. These scripts provide easy-to-use interfaces for GPU switching and CPU power profile management.
- Integrated Mode: iGPU only for maximum battery life
- Hybrid Mode: Automatic GPU switching for balanced performance
- AsusMuxDgpu Mode: Discrete GPU only for maximum performance
- Real-time GPU mode detection and switching
- 5 Power Profiles: Ultra Eco, Eco, Mid, Standard, Performance
- AMD Ryzen Optimization: Fine-tuned TDP, current, and temperature limits
- RyzenAdj Integration: Advanced AMD processor control
- Visual Profile Display: Easy-to-read status with emojis
- Auto-sudo: Automatically elevates privileges when needed
| Profile | STAPM Limit | Use Case | Battery Life |
|---|---|---|---|
| 🔋 Ultra | 10W | Web browsing, documents | Maximum |
| 🌱 Eco | 25W | Light multitasking | Extended |
| ⚖️ Mid | 45W | Daily work, video playback | Balanced |
| ⚙️ Standard | 55W | Development, photo editing | Moderate |
| 🚀 Performance | 60W | Gaming, rendering, compilation | Minimum |
supergfxctlinstalled (see asus-debian-tools)- ASUS laptop with hybrid graphics (Integrated + Discrete GPU)
- AMD Ryzen processor
ryzenadjinstalled
# Install dependencies
sudo apt install build-essential libpci-dev cmake
# Clone and build ryzenadj
git clone https://github.com/FlyGoat/RyzenAdj.git
cd RyzenAdj
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make
sudo make install
# Verify installation
ryzenadj --info# Clone the repository
git clone https://github.com/Kyworn/asus-x13-scripts.git
cd asus-x13-scripts
# Make scripts executable
chmod +x switch.sh Wcpu.sh
# Optional: Move to PATH for system-wide access
sudo cp switch.sh /usr/local/bin/gpu-switch
sudo cp Wcpu.sh /usr/local/bin/cpu-profile# Check current GPU mode
./switch.sh
# Switch to Integrated GPU (battery saving)
./switch.sh Integrated
# Switch to Hybrid mode (balanced)
./switch.sh Hybrid
# Switch to Discrete GPU (performance)
./switch.sh AsusMuxDgpuExample output:
Changement vers le mode Hybrid en cours...
Le mode est maintenant : Hybrid
# Check current profile
./Wcpu.sh status
# Apply power profiles
./Wcpu.sh ultra # 10W - Maximum battery
./Wcpu.sh eco # 25W - Extended battery
./Wcpu.sh mid # 45W - Balanced
./Wcpu.sh standard # 55W - Default
./Wcpu.sh perf # 60W - Maximum performanceExample output:
Profil Actuel : ⚙️ Standard (55W)
You can modify Wcpu.sh to create custom profiles:
custom)
echo "Application du profil 'Custom'..."
sudo ryzenadj \
--stapm-limit=30000 \ # Long-term power limit (mW)
--fast-limit=35000 \ # Short-term power limit (mW)
--slow-limit=32000 \ # Medium-term power limit (mW)
--tctl-temp=85 # Temperature limit (°C)
echo "Profil 'Custom' appliqué."
;;- STAPM Limit: Sustained power limit (long-term average)
- Fast Limit: Peak power limit (short bursts)
- Slow Limit: Medium-term power average
- APU Slow Limit: Integrated graphics power limit
- VRM Current: Voltage regulator current limits
- TCtl Temp: CPU temperature ceiling
Create a systemd service to apply profile at boot:
# Create service file
sudo nano /etc/systemd/system/cpu-profile.service[Unit]
Description=Apply CPU Power Profile
After=multi-user.target
[Service]
Type=oneshot
ExecStart=/usr/local/bin/cpu-profile standard
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target# Enable and start service
sudo systemctl daemon-reload
sudo systemctl enable cpu-profile.service
sudo systemctl start cpu-profile.service./switch.sh Integrated # Use integrated GPU only
./Wcpu.sh ultra # 10W TDP limit./switch.sh Hybrid # Automatic GPU switching
./Wcpu.sh standard # 55W TDP./switch.sh AsusMuxDgpu # Dedicated GPU
./Wcpu.sh perf # 60W TDP./switch.sh Integrated # iGPU handles video well
./Wcpu.sh eco # 25W is sufficient# Check supergfxctl service
systemctl status supergfxd
# Reinstall supergfxctl
# See: https://github.com/Kyworn/asus-debian-tools# Check if running as root
sudo ryzenadj --info
# Verify SMU (System Management Unit) access
dmesg | grep -i ryzen# GPU mode changes require logout/reboot
# CPU profile changes are instant but verify with:
sudo ryzenadj --info | grep STAPM- ASUS ROG Flow X13 (GV301)
- ASUS ROG Zephyrus G14
- ASUS ROG Zephyrus G15
- Any ASUS laptop with supergfxctl support
- Any AMD Ryzen laptop (for CPU power management)
- Lowering power limits is always safe
- Increasing beyond 60W may cause thermal throttling or reduced lifespan
- Monitor temperatures with
sensorsorbtop - The CPU will protect itself by throttling if limits are exceeded
Contributions welcome! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/improvement) - Test thoroughly on your hardware
- Commit changes (
git commit -m 'Add feature') - Push to branch (
git push origin feature/improvement) - Open a Pull Request
- asus-debian-tools - Installation scripts for supergfxctl and asusctl
- RyzenAdj - AMD Ryzen power management tool
- supergfxctl - GPU switching daemon
- ASUS Linux - Community resources
MIT License - Feel free to use and modify
Created by Kyworn
- FlyGoat for RyzenAdj
- asus-linux.org community
- AMD for detailed Ryzen documentation