diff --git a/config/desktop/bookworm/environments/gnome/debian/postinst b/config/desktop/bookworm/environments/gnome/debian/postinst index d19f4438df72..0f87e0681d15 100644 --- a/config/desktop/bookworm/environments/gnome/debian/postinst +++ b/config/desktop/bookworm/environments/gnome/debian/postinst @@ -19,7 +19,10 @@ primary-color='#456789' secondary-color='#FFFFFF' [org/gnome/settings-daemon/plugins/power] +sleep-inactive-ac-type='nothing' +sleep-inactive-battery-type='nothing' sleep-inactive-ac-timeout='0' +sleep-inactive-battery-timeout='0' [org/gnome/desktop/screensaver] picture-uri='file:///usr/share/backgrounds/armbian/armbian03-Dre0x-Minum-dark-3840x2160.jpg' diff --git a/config/desktop/common/environments/gnome/debian/postinst b/config/desktop/common/environments/gnome/debian/postinst index e37219bbae61..abf652a1d9f2 100644 --- a/config/desktop/common/environments/gnome/debian/postinst +++ b/config/desktop/common/environments/gnome/debian/postinst @@ -18,7 +18,10 @@ echo " favorite-apps = ['terminator.desktop', 'org.gnome.Nautilus.desktop', 'google-chrome.desktop', 'thunderbird.desktop', 'code.desktop', 'Zoom.desktop'] [org/gnome/settings-daemon/plugins/power] +sleep-inactive-ac-type='nothing' +sleep-inactive-battery-type='nothing' sleep-inactive-ac-timeout='0' +sleep-inactive-battery-timeout='0' [org/gnome/desktop/background] picture-uri='file:///usr/share/backgrounds/armbian/armbian03-Dre0x-Minum-dark-3840x2160.jpg' diff --git a/config/desktop/trixie/environments/gnome/debian/postinst b/config/desktop/trixie/environments/gnome/debian/postinst index d19f4438df72..0f87e0681d15 100644 --- a/config/desktop/trixie/environments/gnome/debian/postinst +++ b/config/desktop/trixie/environments/gnome/debian/postinst @@ -19,7 +19,10 @@ primary-color='#456789' secondary-color='#FFFFFF' [org/gnome/settings-daemon/plugins/power] +sleep-inactive-ac-type='nothing' +sleep-inactive-battery-type='nothing' sleep-inactive-ac-timeout='0' +sleep-inactive-battery-timeout='0' [org/gnome/desktop/screensaver] picture-uri='file:///usr/share/backgrounds/armbian/armbian03-Dre0x-Minum-dark-3840x2160.jpg' diff --git a/lib/functions/rootfs/distro-specific.sh b/lib/functions/rootfs/distro-specific.sh index 81350da96056..6bb2e330f2a3 100644 --- a/lib/functions/rootfs/distro-specific.sh +++ b/lib/functions/rootfs/distro-specific.sh @@ -35,6 +35,33 @@ function install_distribution_specific() { truncate --size=0 "${SDCARD}"/etc/apt/apt.conf.d/20apt-esm-hook.conf fi + # Apply power management overrides only for desktop builds + if [[ "${BUILD_DESKTOP}" == "yes" ]]; then + # power management override on systemd level + # we want to prevent system going into suspend + mkdir -p "${SDCARD}/etc/systemd/logind.conf.d" + cat <<- EOF > "${SDCARD}/etc/systemd/logind.conf.d/90-nosuspend.conf" + [Login] + HandleLidSwitch=ignore + HandleLidSwitchExternalPower=ignore + HandleLidSwitchDocked=ignore + IdleAction=ignore + IdleActionSec=0 + HandleSuspendKey=ignore + HandleHibernateKey=ignore + HandlePowerKey=ignore + EOF + # Tell systemd there is NO suspend/hibernate at all + mkdir -p "${SDCARD}/etc/systemd/sleep.conf.d" + cat <<- EOF > "${SDCARD}/etc/systemd/sleep.conf.d/00-disable.conf" + [Sleep] + AllowSuspend=no + AllowHibernation=no + AllowHybridSleep=no + AllowSuspendThenHibernate=no + EOF + fi + # install our base-files package (this replaces the original from Debian/Ubuntu) if [[ "${KEEP_ORIGINAL_OS_RELEASE:-"no"}" != "yes" ]]; then install_artifact_deb_chroot "armbian-base-files" "--allow-downgrades"