diff --git a/bin/omarchy b/bin/omarchy index 77b75fd7..57501171 100755 --- a/bin/omarchy +++ b/bin/omarchy @@ -17,6 +17,7 @@ declare -A COMMAND_USAGE declare -A COMMAND_ARGS declare -A COMMAND_EXAMPLES declare -A COMMAND_REQUIRES_SUDO +declare -A COMMAND_HIDDEN declare -A COMMAND_ALIASES declare -A COMMAND_HAS_SUMMARY declare -A COMMAND_METADATA_ERRORS @@ -131,6 +132,7 @@ register_command() { local examples="" local aliases="" local requires_sudo="" + local hidden="" local line="" local metadata_key="" local metadata_value="" @@ -186,6 +188,10 @@ register_command() { requires_sudo="$metadata_value" [[ $metadata_value == "true" ]] || metadata_errors=$(append_pipe_value "$metadata_errors" "requires-sudo must be omitted or true") ;; + hidden) + hidden="$metadata_value" + [[ $metadata_value == "true" ]] || metadata_errors=$(append_pipe_value "$metadata_errors" "hidden must be omitted or true") + ;; *) ;; esac @@ -229,6 +235,7 @@ register_command() { fi [[ $requires_sudo == "true" ]] || requires_sudo="false" + [[ $hidden == "true" ]] || hidden="false" local key="$file_binary" COMMAND_KEYS+=("$key") @@ -242,6 +249,7 @@ register_command() { COMMAND_ARGS["$key"]="$args" COMMAND_EXAMPLES["$key"]="$examples" COMMAND_REQUIRES_SUDO["$key"]="$requires_sudo" + COMMAND_HIDDEN["$key"]="$hidden" COMMAND_HAS_SUMMARY["$key"]="$has_summary" COMMAND_METADATA_ERRORS["$key"]="$metadata_errors" @@ -377,6 +385,9 @@ sorted_keys() { local key="" for key in "${COMMAND_KEYS[@]}"; do + if [[ $include_all != "true" && ${COMMAND_HIDDEN[$key]} == "true" ]]; then + continue + fi printf '%s\t%s\n' "${COMMAND_ROUTE[$key]}" "$key" done | sort -u | cut -f2- } @@ -420,6 +431,10 @@ sorted_group_keys() { local route="" for key in "${COMMAND_KEYS[@]}"; do + if [[ $include_all != "true" && ${COMMAND_HIDDEN[$key]} == "true" ]]; then + continue + fi + fallback_group=$(fallback_group_for_key "$key") if [[ ${COMMAND_GROUP[$key]} != "$group" && $fallback_group != "$group" ]]; then continue @@ -510,7 +525,7 @@ Usage: List commands known to the Omarchy command center. Options: - --all Accepted for compatibility + --all Include commands explicitly marked hidden --json Emit machine-readable JSON --markdown Emit a Markdown command table --check Validate command metadata and route collisions @@ -562,6 +577,9 @@ show_commands() { for route in "${!ROUTE_IS_ALIAS[@]}"; do key="${ROUTE_TO_KEY[$route]}" + if [[ $include_all != "true" && ${COMMAND_HIDDEN[$key]} == "true" ]]; then + continue + fi alias_rows+="$route"$'\t'"${COMMAND_ROUTE[$key]}"$'\n' done @@ -600,13 +618,14 @@ emit_command_records() { while IFS= read -r key; do [[ -n $key ]] || continue - printf '%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n' \ + printf '%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n' \ "${COMMAND_ROUTE[$key]}" \ "${COMMAND_BINARY[$key]}" \ "${COMMAND_GROUP[$key]}" \ "${COMMAND_NAME[$key]}" \ "${COMMAND_SUMMARY[$key]}" \ "${COMMAND_REQUIRES_SUDO[$key]}" \ + "${COMMAND_HIDDEN[$key]}" \ "${COMMAND_ARGS[$key]}" \ "${COMMAND_EXAMPLES[$key]}" \ "${COMMAND_ALIASES[$key]}" \ @@ -624,11 +643,12 @@ commands_json_filter() { name: .[3], summary: .[4], requires_sudo: (.[5] == "true"), - args: .[6], - examples: (.[7] | split("|") | map(gsub("^ +| +$"; "")) | map(select(length > 0))), - aliases: (.[8] | split("|") | map(gsub("^ +| +$"; "")) | map(select(length > 0))), - filename_route: .[9], - routes: ([.[0], .[9]] + (.[8] | split("|") | map(gsub("^ +| +$"; "")) | map(select(length > 0))) | unique) + hidden: (.[6] == "true"), + args: .[7], + examples: (.[8] | split("|") | map(gsub("^ +| +$"; "")) | map(select(length > 0))), + aliases: (.[9] | split("|") | map(gsub("^ +| +$"; "")) | map(select(length > 0))), + filename_route: .[10], + routes: ([.[0], .[10]] + (.[9] | split("|") | map(gsub("^ +| +$"; "")) | map(select(length > 0))) | unique) }] | {ok: true, commands: .} EOF } @@ -682,13 +702,14 @@ show_command_json() { local key="$1" printf '%s\n' "$key" | while IFS= read -r key; do - printf '%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n' \ + printf '%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n' \ "${COMMAND_ROUTE[$key]}" \ "${COMMAND_BINARY[$key]}" \ "${COMMAND_GROUP[$key]}" \ "${COMMAND_NAME[$key]}" \ "${COMMAND_SUMMARY[$key]}" \ "${COMMAND_REQUIRES_SUDO[$key]}" \ + "${COMMAND_HIDDEN[$key]}" \ "${COMMAND_ARGS[$key]}" \ "${COMMAND_EXAMPLES[$key]}" \ "${COMMAND_ALIASES[$key]}" \ diff --git a/bin/omarchy-battery-monitor b/bin/omarchy-battery-monitor index 63b33277..1238791e 100755 --- a/bin/omarchy-battery-monitor +++ b/bin/omarchy-battery-monitor @@ -1,6 +1,7 @@ #!/bin/bash # omarchy:summary=Designed to be run by systemd timer every 30 seconds and alerts if battery is low +# omarchy:hidden=true BATTERY_THRESHOLD=10 NOTIFICATION_FLAG="/run/user/$UID/omarchy_battery_notified" diff --git a/bin/omarchy-cmd-terminal-cwd b/bin/omarchy-cmd-terminal-cwd index d0f731a4..88da9a69 100755 --- a/bin/omarchy-cmd-terminal-cwd +++ b/bin/omarchy-cmd-terminal-cwd @@ -1,6 +1,7 @@ #!/bin/bash # omarchy:summary=Print the current working directory of the active terminal window +# omarchy:hidden=true terminal_pid=$(hyprctl activewindow | awk '/pid:/ {print $2}') shell_pid=$(pgrep -P "$terminal_pid" | tail -n1) diff --git a/bin/omarchy-dev-bin-metadata b/bin/omarchy-dev-bin-metadata index c63667b9..99e87e86 100755 --- a/bin/omarchy-dev-bin-metadata +++ b/bin/omarchy-dev-bin-metadata @@ -22,7 +22,8 @@ show_json() { {name: "args", required: false, type: "string", note: "Only set when the command accepts arguments."}, {name: "examples", required: false, type: "string", note: "Pipe-separated examples."}, {name: "aliases", required: false, type: "string", note: "Pipe-separated alternate routes, e.g. omarchy screenshot."}, - {name: "requires-sudo", required: false, type: "true", default: false, note: "Only include when true."} + {name: "requires-sudo", required: false, type: "true", default: false, note: "Only include when true."}, + {name: "hidden", required: false, type: "true", default: false, note: "Hide from default command listings; visible with --all."} ] }' } @@ -43,6 +44,7 @@ Inferred defaults: route omarchy binary filename requires-sudo false + hidden false Optional fields: # omarchy:group= route override only @@ -51,6 +53,7 @@ Optional fields: # omarchy:examples= | pipe-separated examples # omarchy:aliases= | pipe-separated alternate routes # omarchy:requires-sudo=true only when true + # omarchy:hidden=true hide from default command listings Do not define: binary inferred from filename diff --git a/bin/omarchy-install-zed b/bin/omarchy-install-zed index 427659d2..9fa9f0ae 100755 --- a/bin/omarchy-install-zed +++ b/bin/omarchy-install-zed @@ -1,6 +1,6 @@ #!/bin/bash -# Install Zed Editor and omazed to use the current Omarchy theme. +# omarchy:summary=Install Zed Editor and configure it with the current Omarchy theme echo "Installing Zed Editor..." omarchy-pkg-add zed omazed diff --git a/bin/omarchy-theme-colors-from-alacritty b/bin/omarchy-theme-colors-from-alacritty index 7c41b5ec..a740c0ed 100755 --- a/bin/omarchy-theme-colors-from-alacritty +++ b/bin/omarchy-theme-colors-from-alacritty @@ -2,6 +2,7 @@ # omarchy:summary=Generate a theme's colors.toml from its alacritty.toml palette # omarchy:args= +# omarchy:hidden=true set -e diff --git a/bin/omarchy-theme-set-keyboard-asus-rog b/bin/omarchy-theme-set-keyboard-asus-rog index 971097e6..c485e795 100755 --- a/bin/omarchy-theme-set-keyboard-asus-rog +++ b/bin/omarchy-theme-set-keyboard-asus-rog @@ -1,6 +1,7 @@ #!/bin/bash # omarchy:summary=Apply the current theme keyboard color to ASUS ROG keyboards +# omarchy:hidden=true ASUSCTL_THEME=~/.config/omarchy/current/theme/keyboard.rgb diff --git a/bin/omarchy-theme-set-keyboard-f16 b/bin/omarchy-theme-set-keyboard-f16 index 466690d4..c8fb283e 100755 --- a/bin/omarchy-theme-set-keyboard-f16 +++ b/bin/omarchy-theme-set-keyboard-f16 @@ -1,6 +1,7 @@ #!/bin/bash # omarchy:summary=Apply the current theme keyboard color to Framework Laptop 16 keyboards +# omarchy:hidden=true FRAMEWORK16_THEME=~/.config/omarchy/current/theme/keyboard.rgb