### Slackware Installer script ###########################################################
# Script......: /usr/share/hwm-configure/platform/aarch64/installer/helper.scr/010-pwrmgmt
# Called from : /usr/lib/setup/armedslack-postinstall-scripts/001-hwm-os-configure
# Purpose.....: Power management configuration helper for all Hardware Models
# Author......: Stuart Winter <mozes@slackware.com>
# Date........: 26-Feb-2024
# Contributors: Brenton Earl
### Slackware Installer script ###########################################################

# Hardware Model settings:
#case $HWM in
#   "Pine64 RockPro64"*|"Pine64 Pinebook Pro"*)
#esac

# Aug 2026: Commented this out, retaining for posterity.
# This has been moved into the 'a/elogind' package because instead of making HWM-specific
# changes, we're providing a blanket configuration.
# Doing this within the Installer created a later problem - because we edited the config here,
# when the new a/elogind package was released, the user would always be confronted with handling
# a .new file.
# Therefore it makes sense to move this logic into that package.

# Feb-2024
# We had planned to restrict this to specific Hardware Models, but power management
# just doesn't seem to work well for us on ARM at the moment, so we'll disable it
# across the board.
#eloginsleepconf=${T_PX}/etc/elogind/sleep.conf
#if [ -f ${eloginsleepconf} ]; then
#   # Hard set to "no"
#   sed -i 's?^#AllowSuspend=yes?AllowSuspend=no?g' ${eloginsleepconf}
#   sed -i 's?^#AllowHibernation=yes?AllowHibernation=no?g' ${eloginsleepconf}
#   sed -i 's?^#AllowSuspendThenHibernate=yes?AllowSuspendThenHibernate=no?g' ${eloginsleepconf}
#   sed -i 's?^#AllowHybridSleep=yes?AllowHybridSleep=no?g' ${eloginsleepconf}
#   #sed -i 's?^#SuspendState=mem standby freeze?SuspendState=mem standby freeze?g' ${eloginsleepconf}
#   #sed -i 's?^#SuspendMode=.*?SuspendMode=s2idle?g' ${eloginsleepconf}
#fi
