-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
af0802c
commit d077d2d
Showing
1 changed file
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/usr/bin/sh | ||
|
||
while true; do | ||
cat <<EOF | ||
[ \ | ||
{ \ | ||
"application_id": 0, \ | ||
"state": "$(uname -r)", \ | ||
"details": "$(uname -n)", \ | ||
"large_image": { \ | ||
"key": "some_image", \ | ||
"text": null \ | ||
}, \ | ||
"small_image": null, \ | ||
"start_timestamp": $(date -d "$(uptime -s)" +%s), \ | ||
"end_timestamp": null, \ | ||
"buttons": [ \ | ||
{ \ | ||
"label": "some_button", \ | ||
"url": "https://example.com/" \ | ||
} \ | ||
] \ | ||
} \ | ||
] | ||
EOF | ||
|
||
sleep 10 | ||
|
||
pids="$(pidof code) $(pidof wineserver)" # for example; you can put your own processes here | ||
|
||
if [ "${#pids}" != 0 ]; then | ||
echo "[]" | ||
|
||
for pid in $pids; do | ||
if [ -d "/proc/$pid" ]; then # if process haven't exited yet | ||
tail --pid=$pid -f /dev/null # wait for process to exit | ||
fi | ||
done | ||
fi | ||
done |