#!/bin/bash # run_once_60-configure-laptop.sh # Laptop only configuration. set -euo pipefail SYS="{{ .system | default "desktop" }}" DISTRO_ID="{{ .chezmoi.osRelease.id | default "" }}" if [ "$SYS" != "laptop" ]; then echo ">>> [configure-laptop] system=$SYS, skipping (not a laptop)" exit 0 fi case "$DISTRO_ID" in arch) echo ">>> [configure-laptop] arch" sudo pacman -Syu --noconfirm --needed tlp power-profiles-daemon sudo systemctl enable tlp sudo systemctl enable power-profiles-daemon ;; ubuntu) echo ">>> [configure-laptop] ubuntu" sudo apt-get install -y tlp tlp-rdw power-profiles-daemon sudo systemctl enable tlp # tlp and power-profiles-daemon conflict on most hardware — mask the latter sudo systemctl mask power-profiles-daemon || true ;; *) echo ">>> [configure-laptop] unsupported distro: ${DISTRO_ID:-unknown}, skipping" exit 0 ;; esac echo ">>> [configure-laptop] done"