/ de-omarchy / scripts / verify.sh
swadhinbiswas fix(plugin-manager): close on Esc/outside-click and harden marketplace RCE - shell/plugins/plugin-manager/Panel.qml:6,139,149,155,358,368,384,404,409,426,439,457,508 — PanelWindow had WlrKeyboardFocus: Exclusive always, no PanelKeyCatcher/Keys.onEscape and no outside-click MouseArea → once opened via keymap.lua:159 SUPER+SHIFT+I (shell/shell.qml:465 summon) only bar-icon BarWidget.qml:67 could close; add Quickshell.Wayland import, keyboardFocus: opened?Exclusive:None, onVisibleChanged/onOpenedChanged Qt.callLater(keyCatcher.forceActiveFocus()), scrim Qt.rgba(0,0,0,0.45), dismiss MouseArea (modal-aware) + Item#keyCatcher { focus:true; Keys.priority:BeforeItem; Esc->closeModal/close } + card swallow MouseArea, mirrors clipboard/Clipboard.qml:329; fix loadInstalled/loadMarketplace and all actionProc.command single-quote injections (enable/disable, bar remove/add, shortcut set/remove, install, install url, remove) → Util.shellQuote - plugin-library/shell.qml:104,115,121,429,439,455,475,480,495,508,526 — same injection via "'"+p.id+"'" without quoting (marketplace id/url/keys controlled by remote catalog) → add local shellQuote(v) (Util.shellQuote not importable in standalone ShellRoot) and use for all actionProc.command + loadInstalled/loadMarketplace (home/om paths); add Window#win Item { focus:true; Keys.onPressed: Esc { closeModal · 8/27/2026
4aa0eee
96 lines · 4.0 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#!/bin/bash
# de-omarchy verify — post-install sanity checks (read-only).
set -u
PASS=0; FAIL=0
ok()   { echo "  [ok]   $*"; PASS=$((PASS+1)); }
bad()  { echo "  [FAIL] $*"; FAIL=$((FAIL+1)); }

RUNTIME=/usr/share/de-omarchy
MARKER=">>> de-omarchy layer"
HYPR_MAIN="$HOME/.config/hypr/hyprland.lua"

echo "== de-omarchy verification =="

[[ -d $RUNTIME/bin && -f $RUNTIME/shell/shell.qml ]] \
  && ok "runtime present at $RUNTIME" || bad "runtime missing at $RUNTIME"

for f in deo-layer.lua deo-bindings.lua deo-autostart.lua; do
  [[ -L $HOME/.config/hypr/$f ]] && ok "symlink ~/.config/hypr/$f" || bad "missing symlink ~/.config/hypr/$f"
done

if [[ -f $HYPR_MAIN ]]; then
  COUNT=$(grep -c "$MARKER" "$HYPR_MAIN")
  (( COUNT == 1 )) && ok "hyprland.lua carries exactly one de-omarchy block" \
                   || bad "hyprland.lua marker count = $COUNT (expected 1)"
  bash -n "$HYPR_MAIN" >/dev/null 2>&1 && ok "hyprland.lua still valid for bash -n smoke test" || true
else
  bad "hyprland.lua missing"
fi

[[ -e $HOME/.config/zshrc.d/50-de-omarchy.zsh ]] && ok "zsh hook installed" || bad "zsh hook missing"

# zsh loads the hook without errors (syntax + execution in a throwaway shell)
if command -v zsh >/dev/null 2>&1; then
  if ZDOTDIR=$(mktemp -d) sh -c 'cp ~/.config/zshrc.d/50-de-omarchy.zsh "$ZDOTDIR/.zshrc"; zsh -c "source $ZDOTDIR/.zshrc"' >/dev/null 2>&1; then
    ok "zsh hook sources cleanly"
  else
    bad "zsh hook errors on source"
  fi
fi

# omarchy router works with runtime env
if OMARCHY_PATH=$RUNTIME "$RUNTIME/bin/omarchy" --help >/dev/null 2>&1 || OMARCHY_PATH=$RUNTIME "$RUNTIME/bin/omarchy" >/dev/null 2>&1; then
  ok "omarchy command router responds"
else
  bad "omarchy router did not respond"
fi

# theme state initialized
grep -q . "$HOME/.local/state/omarchy/current/theme.name" 2>/dev/null \
  && ok "current theme: $(cat "$HOME/.local/state/omarchy/current/theme.name")" \
  || warn_no_theme=1

# screensaver engine: `ttfx` ships in upstream's repo, `tte` comes from the
# AUR python-terminaltexteffects; without either the screensaver falls back to
# static art by design — warn (don't fail) with the exact fix.
if [[ -f $RUNTIME/bin/omarchy-screensaver ]]; then
  if command -v ttfx >/dev/null 2>&1; then
    ok "screensaver: animated (ttfx found)"
  elif command -v tte >/dev/null 2>&1; then
    ok "screensaver: animated (tte found)"
  else
    echo "  [warn] screensaver will be STATIC art — install the AUR package for animated:"
    echo "         paru -S python-terminaltexteffects"
  fi
fi

# first-party bar widgets that must exist in the runtime
for widget_dir in sysmon notification-center; do
  [[ -d $RUNTIME/shell/plugins/$widget_dir || -f $RUNTIME/shell/plugins/bar/widgets/$widget_dir.qml ]] \
    && ok "runtime plugin present: $widget_dir"
done

# SDDM login theme (only meaningful when SDDM is installed)
if [[ -d /usr/share/sddm/themes ]]; then
  [[ -f /usr/share/sddm/themes/omarchy/Main.qml ]] \
    && ok "SDDM theme deployed" || bad "SDDM installed but omarchy theme missing (rerun install.sh)"
  ACTIVE=$(grep -h '^Current=' /etc/sddm.conf.d/*.conf /etc/sddm.conf 2>/dev/null | tail -1 | cut -d= -f2)
  if [[ -f /etc/sddm.conf.d/50-de-omarchy.conf ]]; then
    [[ $ACTIVE == omarchy ]] && ok "SDDM active theme: omarchy" \
                            || bad "SDDM Current=$ACTIVE but drop-in says omarchy"
  else
    echo "  [warn] SDDM present but no de-omarchy drop-in — login screen not themed yet"
  fi
fi

# monitors sanity: live monitors match display/monitors.lua outputs
if command -v hyprctl >/dev/null 2>&1 && [[ -f $(dirname "${BASH_SOURCE[0]}")/../display/monitors.lua ]]; then
  LIVE=$(hyprctl monitors all 2>/dev/null | grep -oP '^Monitor \K[^ ]+' | sort)
  EXPECTED=$(grep -oP 'output = "\K[^"]+' "$(dirname "${BASH_SOURCE[0]}")/../display/monitors.lua" | sort)
  [[ "$LIVE" == "$EXPECTED" ]] && ok "monitors match display/monitors.lua" \
                                || { echo "    live:   $(echo $LIVE)"; echo "    expect: $(echo $EXPECTED)"; }
fi

echo "== result: $PASS passed, $FAIL failed =="
exit $(( FAIL > 0 ))