Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 82 additions & 0 deletions ruixen-doctor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,88 @@ done
[[ "$any_backup" -eq 0 ]] && printf '(no backups found for any ruixen.* plugin -- install.sh has never replaced an existing copy of any of them)\n'
printf '\n'

# --- Clipboard capture -- answers "Ruixen's Clipboard History opens and
# shows old entries, but new copies never appear". Ruixen only READS
# ~/.local/state/omarchy/clipboard-history.json; it never captures
# anything (it has no wl-paste watcher of its own). Capture belongs to
# Omarchy's built-in clipboard service (omarchy.clipboard), which keeps
# persistent `wl-paste --watch` processes running. So this reports the
# capture side only: are the watchers alive, is the history file still
# being written, and is something else (another clipboard manager or a
# third-party clipboard plugin) sitting in the same space. Process and
# plugin NAMES/ids and counts only -- never command lines or clipboard
# content.
printf -- '-- Clipboard capture (Omarchy-owned; Ruixen only reads it) --\n'
history_file="$HOME/.local/state/omarchy/clipboard-history.json"
if [[ -f "$history_file" ]]; then
if jq empty "$history_file" >/dev/null 2>&1; then
entry_count="$(jq -r 'if type == "array" then length else "?" end' "$history_file" 2>/dev/null || echo "?")"
age="$(( $(date +%s) - $(stat -c %Y "$history_file" 2>/dev/null || date +%s) ))"
printf 'history file: valid, %s entries, last written %s ago\n' "$entry_count" "$(human_ago "$age")"
# Ruixen's parser (ClipboardHistory.js normalizeEntry) only shows
# {type:"text", text:<string>} and {type:"image", path:<string>};
# any other shape is skipped with no error. Count them and print
# their SHAPE (type value + key names), never their content, so a
# format change in Omarchy shows up here instead of as "new copies
# silently never appear".
skipped="$(jq -r 'if type == "array" then [.[] | select(((type == "object") and ((.type == "text" and (.text | type) == "string") or (.type == "image" and (.path | type) == "string"))) | not)] | length else 0 end' "$history_file" 2>/dev/null || echo "?")"
printf 'entries Ruixen cannot display (unknown shape): %s\n' "$skipped"
if [[ "$skipped" != "0" && "$skipped" != "?" ]]; then
shapes="$(jq -r '[.[] | select(((type == "object") and ((.type == "text" and (.text | type) == "string") or (.type == "image" and (.path | type) == "string"))) | not) | (if type == "object" then "type=" + ((.type // "none") | tostring) + " keys=" + (keys | join("+")) else type end)] | group_by(.) | map(.[0] + " x" + (length | tostring)) | join("; ")' "$history_file" 2>/dev/null || true)"
printf 'unknown shapes: %s\n' "$shapes"
fi
else
printf 'history file: exists but is NOT valid JSON -- Omarchy wrote a corrupt file, Ruixen shows whatever it last parsed\n'
fi
else
printf 'history file: not found -- Omarchy has never captured anything here\n'
fi

# Every clipboard-looking file/dir Omarchy keeps next to the history
# file, with its age. If Omarchy ever starts writing new copies to a
# different file than the one Ruixen reads, the old file's age stays
# frozen while a sibling here keeps getting newer -- names and ages only.
omarchy_state="$HOME/.local/state/omarchy"
if [[ -d "$omarchy_state" ]]; then
now_s="$(date +%s)"
found_any=0
while IFS= read -r -d '' p; do
found_any=1
printf 'state: %s (written %s ago)\n' "$(basename "$p")" "$(human_ago "$(( now_s - $(stat -c %Y "$p" 2>/dev/null || echo "$now_s") ))")"
done < <(find "$omarchy_state" -maxdepth 1 -iname '*clip*' -print0 2>/dev/null)
[[ "$found_any" -eq 0 ]] && printf 'state: no clipboard-looking files under the Omarchy state dir\n'
fi

if command -v wl-paste >/dev/null 2>&1; then
watch_count="$(pgrep -fc 'wl-paste.*--watch' 2>/dev/null || true)"
watch_count="${watch_count:-0}"
printf 'wl-paste --watch processes: %s\n' "$watch_count"
if [[ "$watch_count" == "0" ]]; then
printf 'LIKELY CAUSE: no clipboard watcher is running, so nothing new can be recorded -- Omarchy'"'"'s clipboard service is not up (omarchy restart shell; if it persists, check it is enabled and look at the journal for omarchy.clipboard errors)\n'
fi
else
printf 'wl-paste: NOT FOUND -- Omarchy'"'"'s clipboard capture depends on wl-clipboard (pacman -S --needed wl-clipboard)\n'
fi

other_managers=""
for proc in cliphist copyq clipse clipman wl-clip-persist gpaste-daemon klipper parcellite; do
pgrep -x "$proc" >/dev/null 2>&1 && other_managers+="$proc "
done
if [[ -n "$other_managers" ]]; then
printf 'other clipboard managers running: %s-- two managers fighting over the selection can drop or reorder copies; try stopping them to confirm\n' "$other_managers"
else
printf 'other clipboard managers running: none\n'
fi

if [[ -f "$HOME/.config/omarchy/shell.json" ]] && jq empty "$HOME/.config/omarchy/shell.json" >/dev/null 2>&1; then
clip_ids="$(jq -r '[.. | strings | select(test("clip"; "i"))] | unique | join(", ")' "$HOME/.config/omarchy/shell.json" 2>/dev/null || true)"
printf 'clipboard-related ids in shell.json: [%s]\n' "$clip_ids"
if [[ -z "$clip_ids" ]]; then
printf 'NOTE: no clipboard plugin id is listed in shell.json at all -- if Omarchy'"'"'s own clipboard service is not enabled by default on this version, nothing is capturing\n'
fi
fi
printf '\n'

# --- Bar layout shape -- ids only, never inline settings values, so
# nothing personal (a custom clock format, a hidden app list) ever
# prints here. -------------------------------------------------------
Expand Down
Loading