The PocketClaw dashboard displays a process list showing running Android services and their memory usage. On the Moto E2's 4.5-inch 540x960 screen, space is extremely limited. Raw Android package names like com.google.android.gms.persistent or com.motorola.android.providers.settings take up most of the screen width, leaving no room for memory values.
Android package names follow a reverse-domain convention that adds 15-30 characters of redundant prefix to every name. A cleanup pass makes the dashboard actually usable.
Apply a regex chain to each process name before displaying it. The chain strips common prefixes in order from most specific to least:
// In dashboard rendering code (hijack.js or launcher):
function cleanProcessName(name) {
return name
.replace(/^com\.android\./, "")
.replace(/^android\.process\./, "")
.replace(/^com\.motorola\./, "moto.")
.replace(/^com\.google\.android\./, "goog.")
.replace(/^com\.pocketclaw\./, "")
.replace(/^com\.qualcomm\./, "qc.")
.replace(/^com\.termux\.?/, "termux");
}
// Examples:
// "com.android.systemui" -> "systemui"
// "com.google.android.gms.persistent" -> "goog.gms.persistent"
// "com.motorola.process.system" -> "moto.process.system"
// "com.pocketclaw.launcher" -> "launcher"
// "com.termux" -> "termux"
// "com.qualcomm.qcrilmsgtunnel" -> "qc.qcrilmsgtunnel"The order matters — more specific prefixes are checked first so com.google.android.* matches before the fallthrough.
# Check the dashboard output on port 9003:
curl -s http://localhost:9003/dashboard | grep -o 'class="proc-name">[^<]*'
# Expected: cleaned names like "systemui", "goog.gms", "termux"
# Verify no raw "com.android" names remain:
curl -s http://localhost:9003/dashboard | grep "com\.android\."
# Expected: no output (all names cleaned)com.android. before com.google.android., Google packages won't match their specific prefixcom.* convention (e.g., android.process.media). The android.process. rule catches theseString.replaceFirst() syntaxsystem_server or zygote should remain as-is (they don't match any prefix)| Metric | Before | After |
|---|---|---|
| Avg name length | ~35 chars | ~12 chars |
| Readable on 4.5" screen | No | Yes |
| Process list visible | 3-4 entries | 8-10 entries |