Skip to content

Commit

Permalink
📝 Add another config template
Browse files Browse the repository at this point in the history
  • Loading branch information
trickybestia committed Oct 12, 2022
1 parent af0802c commit d077d2d
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions doc/configs/hide-presence-when-some-process-is-running.sh
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

0 comments on commit d077d2d

Please sign in to comment.