From 16a9bc295c3d720efb1bacb9324bd301bdb72f21 Mon Sep 17 00:00:00 2001 From: Ryan Hughes Date: Sat, 3 Jan 2026 16:33:08 -0500 Subject: [PATCH] Add --no-sudo and --print to debug --- bin/omarchy-debug | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/bin/omarchy-debug b/bin/omarchy-debug index 05c35df8..c86ff9e2 100755 --- a/bin/omarchy-debug +++ b/bin/omarchy-debug @@ -1,7 +1,34 @@ #!/bin/bash +NO_SUDO=false +PRINT_ONLY=false + +while [[ $# -gt 0 ]]; do + case "$1" in + --no-sudo) + NO_SUDO=true + shift + ;; + --print) + PRINT_ONLY=true + shift + ;; + *) + echo "Unknown option: $1" + echo "Usage: omarchy-debug [--no-sudo] [--print]" + exit 1 + ;; + esac +done + LOG_FILE="/tmp/omarchy-debug.log" +if [ "$NO_SUDO" = true ]; then + DMESG_OUTPUT="(skipped - --no-sudo flag used)" +else + DMESG_OUTPUT="$(sudo dmesg)" +fi + cat > "$LOG_FILE" </dev/null; comm -13 <(pacman -Sql | sort) <(pacman -Qqe | sort) | xargs -r expac -Q '%n %v (AUR)'; } | sort) EOF +if [ "$PRINT_ONLY" = true ]; then + cat "$LOG_FILE" + exit 0 +fi + OPTIONS=("View log" "Save in current directory") if ping -c 1 8.8.8.8 >/dev/null 2>&1; then OPTIONS=("Upload log" "${OPTIONS[@]}")