Initial commit: linux-provision repo
Distribution-agnostic provisioning script that sets up a new Linux machine (Detected via lib/distro.sh - supports Debian/Ubuntu/Pop and Fedora families). 13 stages covering: - System packages, external repos, toolchains (nvm, uv, Python) - Shell config (zsh, oh-my-zsh, p10k), git, SSH - Custom uv tools from ~40 git repos - Desktop config (keybindings, hotkeys, ghostty, fonts) - Docker, system tweaks, browser/app installs - Custom systemd user services (porridge, swayidle, mempi-sync, etc.) - API keys loaded from Bitwarden at shell startup
This commit is contained in:
11
config/scripts/idle-battery-suspend.sh
Normal file
11
config/scripts/idle-battery-suspend.sh
Normal file
@@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
# ===========================================================================
|
||||
# idle-battery-suspend.sh — Suspend laptop only when on battery
|
||||
# Checks AC power status before suspending. If on AC power, does nothing.
|
||||
# Used by swayidle.service (systemd user service).
|
||||
# ===========================================================================
|
||||
# Only suspend if on battery (AC online = 0)
|
||||
AC_ONLINE=$(cat /sys/class/power_supply/AC/online 2>/dev/null)
|
||||
if [ "$AC_ONLINE" = "0" ]; then
|
||||
systemctl suspend-then-hibernate
|
||||
fi
|
||||
Reference in New Issue
Block a user