Skip to content

Instantly share code, notes, and snippets.

@yangon99
Created March 22, 2021 07:27
Show Gist options
  • Save yangon99/8d2a232789e20a67714c560c7865220e to your computer and use it in GitHub Desktop.
Save yangon99/8d2a232789e20a67714c560c7865220e to your computer and use it in GitHub Desktop.
#!/usr/bin/bash
# Refer: http://www.baozy.com/archives/12084.html
msg_file=$HOME/Music/sp/msg.wav
icon_file=/usr/share/icons/hicolor/16x16/apps/com.qq.im.deepin.svg
inotifywait -mq $msg_file --format %e -e OPEN |while read event
do
notify-send "There's new message from QQ" \
"Just someone opened $msg_file" \
-i $icon_file \
-h string:desktop-entry:"QQ" \
-a "QQ" \
-t 10000
echo ${event}
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment