AI-Helpers Tools
2026-09-19
Mode-Specific Tool for AI_Helpers
Script Breakdown: {mode}-tools.sh (Full Mode Tool Dispatcher)
This version is the fully populated iteration of the PlebMachine operational mode tool launcher. Unlike the single-item variant, this script maps tailored multi-application choices to all 12 operational modes in COGNITIVE state while maintaining instant auto-launching in AUTOMATIC state.
Key Functionality
- Environment Initialization: Sets explicit display variables (
DISPLAY,XAUTHORITY,GDK_BACKEND=x11) to ensure graphical applications launch smoothly when invoked asynchronously by desktop shortcuts or background triggers. - Dynamic Mode Context: Identifies its execution context by stripping file prefixes and extensions from
$0(e.g.,developer-tools.shbecomesdeveloper), allowing one unified template script to serve all 12 PlebMachine modes. - State-Driven Behavior: Reads
~/.config/plebmachine/state.confto checkPM_STATE:AUTOMATICState: Bypasses GUI prompts entirely and instantly launches the pre-assignedDEFAULT_APPas a detached background process (&).COGNITIVEState: Opens an interactive GTK Zenity checklist dynamically populated with context-relevant applications specific to that mode.
- Multi-Selection Application Spawning: Reads pipe-separated selections (
|), strips double quotes, matches strings inside acasestatement, and launches selected programs asynchronously (>/dev/null 2>&1 &) without locking the terminal session.
Mode-Specific Application Maps (COGNITIVE State)
| Operational Mode | Default App (AUTOMATIC) |
Checklist Applications (COGNITIVE) |
|---|---|---|
everyday |
logseq |
Logseq, Firefox, Thunderbird, VLC |
author |
libreoffice |
LibreOffice, Firefox, FocusWriter |
study |
bibletime (Flatpak) |
BibleTime, Firefox, Evince |
research |
vivaldi |
Firefox, Brave, Vivaldi |
graphics |
gimp |
GIMP, Inkscape, Firefox |
music |
audacity |
Audacity, VLC, Firefox |
video |
shotcut |
Shotcut, OpenShot, VLC |
broadcast |
obs |
OBS Studio, Firefox |
ai_helpers |
firefox |
Firefox, MetaAI (Local Wrapper), Terminal |
developer |
xfce4-terminal |
VS Code, Terminal, Firefox |
accounting |
gnucash |
GnuCash, Firefox |
leisure |
steam |
Steam, VLC, Firefox |
Dependencies
System Utilities & GUI Engine
bash: Required for string trimming, arrays (read -ra), and logic flow.grep,cut,tr,xargs: Parsers used to extract values fromstate.conf.zenity: Renders the GTK checklist window.
Executables Required Across Modes
To ensure all checklist items operate correctly, the host system needs these binaries installed and available in $PATH (or at their explicit paths):
- Browsers:
firefox,/usr/bin/brave-browser-stable,vivaldi - Writing & Office:
logseq,libreoffice,focuswriter,thunderbird,evince - Media & Audio:
vlc,audacity - Graphics & Video:
gimp,inkscape,shotcut,openshot-qt,obs - Development & Utilities:
code(VS Code),xfce4-terminal - Finance & Gaming:
gnucash,steam - Flatpaks & Custom Apps:
info.bibletime.BibleTime(via Flatpak)/opt/plebmachine/ai-apps/MetaAI-linux-x64/MetaAI
#!/bin/bash
export DISPLAY="${DISPLAY:-:0}"
export XAUTHORITY="${XAUTHORITY:-$HOME/.Xauthority}"
export GDK_BACKEND="${GDK_BACKEND:-x11}"
# Determine mode from script name
SCRIPT_NAME="$(basename "$0" .sh)"
MODE="${SCRIPT_NAME%-tools}"
# Read current system state
STATE_FILE="$HOME/.config/plebmachine/state.conf"
if [ -f "$STATE_FILE" ]; then
PM_STATE=$(grep -i "PM_STATE" "$STATE_FILE" | cut -d'=' -f2 | tr '[:lower:]' '[:upper:]' | xargs)
else
PM_STATE="COGNITIVE"
fi
# Mode-specific defaults
case "$MODE" in
everyday)
DEFAULT_APP="logseq"
ZENITY_ITEMS='FALSE "Logseq" FALSE "Firefox" FALSE "Thunderbird" FALSE "VLC"'
;;
author)
DEFAULT_APP="libreoffice"
ZENITY_ITEMS='FALSE "LibreOffice" FALSE "Firefox" FALSE "FocusWriter"'
;;
study)
DEFAULT_APP="flatpak run --branch=stable --arch=x86_64 --command=bibletime info.bibletime.BibleTime"
ZENITY_ITEMS='FALSE "BibleTime" FALSE "Firefox" FALSE "Evince"'
;;
research)
DEFAULT_APP="vivaldi"
ZENITY_ITEMS='FALSE "Firefox" FALSE "Brave" FALSE "Vivaldi"'
;;
graphics)
DEFAULT_APP="gimp"
ZENITY_ITEMS='FALSE "GIMP" FALSE "Inkscape" FALSE "Firefox"'
;;
music)
DEFAULT_APP="audacity"
ZENITY_ITEMS='FALSE "Audacity" FALSE "VLC" FALSE "Firefox"'
;;
video)
DEFAULT_APP="shotcut"
ZENITY_ITEMS='FALSE "Shotcut" FALSE "OpenShot" FALSE "VLC"'
;;
broadcast)
DEFAULT_APP="obs"
ZENITY_ITEMS='FALSE "OBS Studio" FALSE "Firefox"'
;;
ai_helpers)
DEFAULT_APP="firefox"
ZENITY_ITEMS='FALSE "Firefox" FALSE "MetaAI" FALSE "Terminal"'
;;
developer)
DEFAULT_APP="xfce4-terminal"
ZENITY_ITEMS='FALSE "VS Code" FALSE "Terminal" FALSE "Firefox"'
;;
accounting)
DEFAULT_APP="gnucash"
ZENITY_ITEMS='FALSE "GnuCash" FALSE "Firefox"'
;;
leisure)
DEFAULT_APP="steam"
ZENITY_ITEMS='FALSE "Steam" FALSE "VLC" FALSE "Firefox"'
;;
*)
echo "Unknown mode: $MODE"
exit 1
;;
esac
# If AUTOMATIC, launch default app immediately
if [ "$PM_STATE" = "AUTOMATIC" ]; then
$DEFAULT_APP >/dev/null 2>&1 &
exit 0
fi
# COGNITIVE mode: show zenity checklist
CHOICE=$(zenity --list \
--checklist \
--title="PlebMachine ${MODE^} Tools" \
--text="Select ${MODE} applications to launch:" \
--column="Pick" \
--column="App" \
$ZENITY_ITEMS \
--separator="|")
if [ $? -ne 0 ]; then
exit 0
fi
IFS="|" read -ra APPS <<< "$CHOICE"
for app in "${APPS[@]}"; do
# Remove leading and trailing double quotes
app="${app%\"}"
app="${app#\"}"
case "$app" in
"Logseq") logseq >/dev/null 2>&1 & ;;
"Firefox") firefox >/dev/null 2>&1 & ;;
"Thunderbird") thunderbird >/dev/null 2>&1 & ;;
"VLC") vlc >/dev/null 2>&1 & ;;
"LibreOffice") libreoffice >/dev/null 2>&1 & ;;
"FocusWriter") focuswriter >/dev/null 2>&1 & ;;
"BibleTime") flatpak run --branch=stable --arch=x86_64 --command=bibletime info.bibletime.BibleTime >/dev/null 2>&1 & ;;
"Evince") evince >/dev/null 2>&1 & ;;
"Brave") /usr/bin/brave-browser-stable >/dev/null 2>&1 & ;;
"Vivaldi") vivaldi >/dev/null 2>&1 & ;;
"GIMP") gimp >/dev/null 2>&1 & ;;
"Inkscape") inkscape >/dev/null 2>&1 & ;;
"Audacity") audacity >/dev/null 2>&1 & ;;
"Shotcut") shotcut >/dev/null 2>&1 & ;;
"OpenShot") openshot-qt >/dev/null 2>&1 & ;;
"OBS Studio") obs >/dev/null 2>&1 & ;;
"MetaAI") /opt/plebmachine/ai-apps/MetaAI-linux-x64/MetaAI >/dev/null 2>&1 & ;;
"Terminal") xfce4-terminal >/dev/null 2>&1 & ;;
"VS Code") code >/dev/null 2>&1 & ;;
"GnuCash") gnucash >/dev/null 2>&1 & ;;
"Steam") steam >/dev/null 2>&1 & ;;
*) echo "Unknown app: $app" ;;
esac
done
Review โ 2026-09-20
Review subject: AI Helpers Tools
- Documentation review: Complete for the version currently preserved in this article.
- Description: The article identifies the scriptโs role, execution flow, dependencies, and/or configuration where those details are available.
- Code preservation: The working code shown in this article has been retained as the reference copy; this review does not replace or rewrite the script itself.
- PlebVox: None. Script/code articles in the PlebMachine Working Code Library are intentionally kept free of PlebVox markers.
- Runtime verification: This repository review is not a substitute for running the script on the current PlebMachine test system. Runtime status should only be marked WORKING when the current installed copy has been tested successfully.
- Maintenance note: If the installed PlebMachine implementation changes, this article should be reviewed and updated so the documented code, paths, dependencies, and behaviour remain aligned with the tested version.
Review date: 2026-09-20
Review scope: Documentation, code preservation, description quality, and PlebVox exclusion.\n