/ de-omarchy / bin / omarchy-update-requires-free-space
swadhinbiswas Initial de-omarchy: Omarchy UI layer for Arch-based distros · 8/22/2026
9f393b2
18 lines · 448 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/bash

# omarchy:summary=Check free disk space required for an update
# omarchy:hidden=true

set -e

if [[ ${OMARCHY_UPDATE_FORCE:-0} == "1" ]]; then
  exit 0
elif read -r available_bytes < <(df --output=avail --block-size=1 / 2>/dev/null | tail -n 1) &&
  [[ $available_bytes =~ ^[0-9]+$ ]] &&
  (( available_bytes < 10 * 1024 * 1024 * 1024 )); then
  echo "You need at least 10 GiB free to safely update Omarchy."
  exit 1
else
  exit 0
fi