24 lines
695 B
Bash
Executable File
24 lines
695 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# ollie:prompt
|
|
# ## process_dismiss
|
|
#
|
|
# Dismiss a finished detached process, removing it from the list.
|
|
#
|
|
# **Args**: `[pid]`
|
|
#
|
|
# ```
|
|
# call_tool: calls=[{tool: "process_dismiss", args: ["12345"]}]
|
|
# ```
|
|
# ollie:end
|
|
|
|
set -euo pipefail
|
|
|
|
pid="${1:?usage: process_dismiss <pid>}"
|
|
session="${OLLIE_SESSION_ID:?OLLIE_SESSION_ID not set}"
|
|
|
|
dbus-send --session --dest=org.ollie.SessionManager --type=method_call --print-reply \
|
|
/org/ollie/SessionManager org.ollie.SessionManager.DismissDetached \
|
|
"string:$session" "int32:$pid" 2>&1 | grep -q 'boolean true' && \
|
|
echo "Dismissed PID $pid" || \
|
|
{ echo "Failed to dismiss PID $pid (still running or not found)" >&2; exit 1; }
|