Skip to content

Instantly share code, notes, and snippets.

View shadmansaleh's full-sized avatar
🚫
Might be slow to respond.

Shadman shadmansaleh

🚫
Might be slow to respond.
View GitHub Profile
@shadmansaleh
shadmansaleh / lenovo-fn-q.sh
Last active February 26, 2023 08:53 — forked from JoveYu/lenovo-fn-q.sh
Linux Lenove Fn+Q Power Mode Script
#!/bin/bash
ACPI_BALANCE="\_SB.PCI0.LPC0.EC0.VPC0.DYTC 0x000FB001"
ACPI_POWER="\_SB.PCI0.LPC0.EC0.VPC0.DYTC 0x0012B001"
ACPI_ECO="\_SB.PCI0.LPC0.EC0.VPC0.DYTC 0x0013B001"
ACPI_MODE="\_SB.PCI0.LPC0.EC0.SPMO"
MODE=$(sh -c "echo '$ACPI_MODE' > /proc/acpi/call; tr -d '\0' < /proc/acpi/call")
MODE=${MODE:2}
TARGET=$(((MODE+1)%3))