Skip to content

Commit

Permalink
chore: set upower CriticalPowerAction to ignore
Browse files Browse the repository at this point in the history
  • Loading branch information
zsien committed Dec 3, 2024
1 parent 9403198 commit eb9ae8e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions debian/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@ prepareGfxmodeDetect () {
/usr/lib/deepin-daemon/grub2 -prepare-gfxmode-detect && update-grub || true
}

modifyUPowerConfig () {
if [ -f /etc/UPower/UPower.conf ]; then
sed '/^\[UPower]/,/^\[/{s/^AllowRiskyCriticalPowerAction=false/AllowRiskyCriticalPowerAction=true/};/^\[UPower]/,/^\[/{s/^CriticalPowerAction=HybridSleep/CriticalPowerAction=Ignore/}' /etc/UPower/UPower.conf

deb-systemd-invoke reload upower.service
fi
}

case "$1" in
configure)
if [ -x /usr/lib/deepin-daemon/default-terminal ];then
Expand All @@ -43,6 +51,7 @@ case "$1" in
fi
linkJavaFallbackFont
prepareGfxmodeDetect
modifyUPowerConfig
;;
triggered)
linkJavaFallbackFont
Expand Down

0 comments on commit eb9ae8e

Please sign in to comment.