We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7799afd commit fd87c27Copy full SHA for fd87c27
bin/omarchy-hibernation-available
@@ -1,9 +1,10 @@
1
#!/bin/bash
2
# Checks if swap is big enough to hibernate
3
4
-SWAPSIZE=$(( 1024 * $(cat /proc/swaps |grep -v -e "Filename" -e "zram"| awk '{print $3}') ));
+SWAPSIZE_KB=$(cat /proc/swaps |grep -v -e "Filename" -e "zram"| awk '{print $3}');
5
+SWAPSIZE=$(( 1024 * ${SWAPSIZE_KB:-0} ));
6
HIBERNATION_IMAGE_SIZE=$(cat /sys/power/image_size)
-if [ "${SWAPSIZE:-0}" -gt "$HIBERNATION_IMAGE_SIZE" ]; then
7
+if [ "${SWAPSIZE}" -gt "$HIBERNATION_IMAGE_SIZE" ]; then
8
exit 0;
9
else
10
exit 1;
0 commit comments