NoSignal-OS/os updates/fish-to-bash/bash/completions
28allday 19fd794b6b NoSignal — fully-offline Arch → Hyprland desktop installer
Single-script builder (nosignal.sh) that turns a stock Arch Linux ISO into a
fully-offline installer for a themed Hyprland + caelestia (Quickshell) desktop:
matching SDDM greeter, Btrfs/Limine bootable snapshots, chwd-style GPU
detection, and a curated "os updates" layer (keybind cheatsheet, settings
panels, system polish, on-box management skill). See README.md.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21 11:03:10 +01:00

64 lines
1.7 KiB
Text
Executable file

_omarchy_complete() {
COMPREPLY=()
local cur="${COMP_WORDS[COMP_CWORD]}"
local omarchy_path bin_dir
omarchy_path=$(command -v omarchy 2>/dev/null) || return 0
bin_dir=$(dirname -- "$(readlink -f -- "$omarchy_path" 2>/dev/null || printf '%s' "$omarchy_path")")
[[ -d $bin_dir ]] || return 0
local prefix="omarchy"
local i part
for ((i = 1; i < COMP_CWORD; i++)); do
part="${COMP_WORDS[i]}"
[[ -z $part || $part == -* ]] && continue
prefix+="-$part"
done
local -A seen=()
local candidates=()
local file basename rest next
shopt -s nullglob
for file in "$bin_dir/$prefix"-*; do
[[ -f $file && -x $file ]] || continue
basename="${file##*/}"
rest="${basename#"$prefix"-}"
next="${rest%%-*}"
if [[ -n $next && -z ${seen[$next]:-} ]]; then
seen[$next]=1
candidates+=("$next")
fi
done
shopt -u nullglob
if (( COMP_CWORD == 1 )); then
candidates+=("commands")
fi
if [[ ${COMP_WORDS[1]:-} == "commands" ]] && (( COMP_CWORD >= 2 )); then
candidates+=("--all" "--json" "--markdown" "--check")
fi
if (( ${#candidates[@]} == 0 )) && [[ -x $bin_dir/$prefix ]]; then
local args enum
args=$(grep -m 1 '^# omarchy:args=<' "$bin_dir/$prefix" 2>/dev/null)
enum="${args#*<}"
enum="${enum%%>*}"
if [[ $enum == *"|"* && $enum != *" "* ]]; then
read -r -a candidates <<<"${enum//|/ }"
fi
fi
if (( ${#candidates[@]} > 0 )); then
local IFS=$'\n'
COMPREPLY=($(compgen -W "${candidates[*]}" -- "$cur"))
fi
}
complete -o default -F _omarchy_complete omarchy
# Hide individual omarchy-* binaries from initial-word command completion;
# the unified `omarchy` dispatcher is the user-facing entry point.
complete -I -A command -X 'omarchy-*'