mirror of
https://github.com/arthur-pbty/arthur-os.git
synced 2026-08-01 20:28:16 +02:00
* Add omarchy CLI * Remove outdated or internal * Add bash completions for command * Add omarchy command documentation * Add missing docs * Correct to what's now right * Fix tests --------- Co-authored-by: David Heinemeier Hansson <david@hey.com>
20 lines
464 B
Bash
Executable File
20 lines
464 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# omarchy:summary=Check if hibernation is supported
|
|
|
|
if [[ ! -f /sys/power/image_size ]]; then
|
|
exit 1
|
|
fi
|
|
|
|
# Sum all swap sizes (excluding zram)
|
|
SWAPSIZE_KB=$(awk '!/Filename|zram/ {sum += $3} END {print sum+0}' /proc/swaps)
|
|
SWAPSIZE=$(( 1024 * ${SWAPSIZE_KB:-0} ))
|
|
|
|
HIBERNATION_IMAGE_SIZE=$(cat /sys/power/image_size)
|
|
|
|
if (( SWAPSIZE > HIBERNATION_IMAGE_SIZE )) && [[ -f /etc/mkinitcpio.conf.d/omarchy_resume.conf ]]; then
|
|
exit 0
|
|
else
|
|
exit 1
|
|
fi
|