/ de-omarchy / bin / omarchy-version
swadhinbiswas Fix installer: batch repo pkgs + stdin-safe AUR prompts, create /etc/environment.d, retarget all runtime fallbacks to /usr/share/de-omarchy · 8/22/2026
3eba9d4
29 lines · 636 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash

# omarchy:summary=Print the installed Omarchy version

omarchy_path=${OMARCHY_PATH:-/usr/share/de-omarchy}
omarchy_path=${omarchy_path%/}

if [[ $omarchy_path != "/usr/share/de-omarchy" ]]; then
  hash=$(git -C "$omarchy_path" rev-parse --short HEAD 2>/dev/null || true)

  if [[ -n $hash ]]; then
    echo "dev ($hash)"
  else
    echo "dev"
  fi

  exit 0
fi

# The edge channel installs omarchy-dev instead of omarchy, so check both.
for package in omarchy-dev omarchy; do
  version=$(pacman -Q "$package" 2>/dev/null | awk '{ print $2 }')
  [[ -n $version ]] && break
done

[[ -n $version ]] || exit 1

echo "$version"