Compare commits

...

2 Commits

Author SHA1 Message Date
David Heinemeier Hansson
e4b7372666 Cannot get suspend to hibernate to work consistently across different laptops
Too many failures where it's stuck in a suspend-wake-up loop
2026-02-10 14:07:40 +01:00
David Heinemeier Hansson
a30448ceec Allow the ssh forwarding functions to take multiple ports 2026-02-10 13:39:48 +01:00
4 changed files with 11 additions and 14 deletions

View File

@@ -59,11 +59,7 @@ sudo mkdir -p /etc/mkinitcpio.conf.d
echo "Adding resume hook to $MKINITCPIO_CONF"
echo "HOOKS+=(resume)" | sudo tee "$MKINITCPIO_CONF" >/dev/null
# Configure suspend-then-hibernate
echo "Configuring suspend-then-hibernate"
sudo mkdir -p /etc/systemd/logind.conf.d /etc/systemd/sleep.conf.d /usr/lib/systemd/system-sleep
sudo cp "$OMARCHY_PATH/default/systemd/lid.conf" /etc/systemd/logind.conf.d/
sudo cp "$OMARCHY_PATH/default/systemd/hibernate.conf" /etc/systemd/sleep.conf.d/
# Ensure keyboard backlight doesn't prevent sleep
sudo cp -p "$OMARCHY_PATH/default/systemd/system-sleep/keyboard-backlight" /usr/lib/systemd/system-sleep/
# Use ACPI alarm for RTC wakeup on s2idle systems (needed for suspend-then-hibernate)

View File

@@ -90,13 +90,19 @@ img2png() {
# SSH Port Forwarding Functions
fip() {
[[ -z "$1" || -z "$2" ]] && echo "Usage: fip <port> <host>" && return 1
ssh -f -N -L "$1:localhost:$1" "$2" && echo "Forwarding localhost:$1 -> $2:$1"
[[ $# -lt 2 ]] && echo "Usage: fip <host> <port1> [port2] ..." && return 1
local host="$1"
shift
for port in "$@"; do
ssh -f -N -L "$port:localhost:$port" "$host" && echo "Forwarding localhost:$port -> $host:$port"
done
}
dip() {
[[ -z "$1" ]] && echo "Usage: dip <port>" && return 1
pkill -f "ssh.*-L $1:localhost:$1" && echo "Stopped forwarding port $1" || echo "No forwarding on port $1"
[[ $# -eq 0 ]] && echo "Usage: dip <port1> [port2] ..." && return 1
for port in "$@"; do
pkill -f "ssh.*-L $port:localhost:$port" && echo "Stopped forwarding port $port" || echo "No forwarding on port $port"
done
}
lip() {

View File

@@ -1,3 +0,0 @@
[Sleep]
HibernateDelaySec=90min
SuspendEstimationSec=0

View File

@@ -1,2 +0,0 @@
[Login]
HandleLidSwitch=suspend-then-hibernate