/ de-omarchy / bin / omarchy-channel-current
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
31 lines · 1019 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
30
31
#!/bin/bash

# omarchy:summary=Print the active Omarchy package channel

set -euo pipefail

# Dev is a linked source checkout: OMARCHY_PATH points somewhere other than
# the package-backed install at /usr/share/de-omarchy. This takes precedence over
# the package channels, since the checkout overrides whatever is installed.
if [[ $OMARCHY_PATH != "/usr/share/de-omarchy" ]]; then
  echo dev
  exit 0
fi

# omarchy-dev / omarchy-settings-dev are only shipped from the edge package
# repo, so their presence alone means edge. omarchy / omarchy-settings come
# from either the stable or rc mirror, distinguished by omarchy-version-channel
# (which reports the mirror as its first token).
if pacman -Q omarchy-dev omarchy-settings-dev >/dev/null 2>&1; then
  echo edge
elif pacman -Q omarchy omarchy-settings >/dev/null 2>&1; then
  channel=$(omarchy-version-channel 2>/dev/null | awk '{ print $1 }')
  case "$channel" in
    stable) echo stable ;;
    rc) echo rc ;;
    *) echo unknown ;;
  esac
else
  echo unknown
fi