modifications
This commit is contained in:
@@ -37,16 +37,18 @@ function notifyRemote(): void {
|
||||
}
|
||||
|
||||
function notifyLocal(): void {
|
||||
const { execFile } = require("child_process");
|
||||
const { execFile, exec } = require("child_process");
|
||||
if (process.platform === "darwin") {
|
||||
execFile("afplay", [LOCAL_SOUND_MAC]);
|
||||
} else if (process.platform === "linux") {
|
||||
execFile("paplay", [LOCAL_SOUND_LINUX]);
|
||||
exec("paplay /usr/share/sounds/freedesktop/stereo/window-attention.oga & notify-send -i ~/.pi/agent/extensions/assets/pi-logo.svg 'Pi' 'Done. Ready for input.'");
|
||||
}
|
||||
}
|
||||
|
||||
function sendNotification(): void {
|
||||
if (isSSH() || REMOTE_HOST) {
|
||||
// On Mac or SSH session: notify remote Linux
|
||||
// On Linux locally: notify local
|
||||
if (process.platform === "darwin" || isSSH()) {
|
||||
notifyRemote();
|
||||
} else {
|
||||
notifyLocal();
|
||||
|
||||
Reference in New Issue
Block a user